Find the primary domain controller

Find the primary domain controller

July 20, 2009

With native Windows 2000 commands:

    NETDOM QUERY /D:MyDomain PDC

or, to find the FSMO with (native) Windows Server 2003 commands (Active Directory only):

    NETDOM QUERY /D:mydomain.com FSMO

NETDOM is part of the support tools found in the \SUPPORT directory of the Windows 2000 installation CDROM.

List all member servers

List all member servers

July 20, 2009

With native Windows 2000 commands:

    NETDOM QUERY /D:MyDomain SERVER

NETDOM is part of the support tools found in the \SUPPORT directory of the Windows 2000 installation CDROM.

List all computers in the network

List all computers in the network

July 20, 2009

With the native NET command:

    NET VIEW

or, to list the names only:

    FOR /F "skip=3 delims=\  " %%A IN ('NET VIEW') DO ECHO.%%A

delims is a backslash, followed by a tab and a space.

List all domain controllers

List all domain controllers

July 20, 2009

With native Windows 2000 commands:

    NETDOM QUERY /D:MyDomain DC

NETDOM is part of the support tools found in the \SUPPORT directory of the Windows 2000 installation CDROM.

With (native) Windows Server 2003 commands (Active Directory only):

    DSQUERY Server

or, if you prefer host names only (tip by Jim Christian Flatin):

    DSQUERY Server -o rdn
How to unlock a locked account

How to unlock a locked account

July 20, 2009

With the native NET command:

    NET USER loginname /DOMAIN /ACTIVE:YES

or, if the password needs to be reset as well:

    NET USER loginname newpassword /DOMAIN /ACTIVE:YES

List all domains and workgroups in the network

List all domains and workgroups in the network

July 20, 2009

With the native NET command:

    NET VIEW /DOMAIN
Is someone's account locked?

Is someone's account locked?

July 20, 2009

With the native NET command:

    NET USER loginname /DOMAIN | FIND /I "Account active"

The account is either locked ("Locked") or active ("Yes").