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").

When did someone last change his password?

When did someone last change his password?

July 20, 2009

With the native NET command:

    NET USER loginname /DOMAIN | FIND /I "Password last set"
How do I reset someone's password?

How do I reset someone's password?

July 20, 2009

With the native NET command:

    NET USER loginname newpassword /DOMAIN

With (native) Windows Server 2003 commands:

    DSQUERY USER -samid loginname | DSMOD USER -pwd newpassword
Note: To prevent the new password from being displayed on screen replace it with an asterisk (*); you will then be prompted (twice) to type the new password "blindly".