WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

wNT
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Check For Disabled Computer Account


Question:

How would I go about checking to see if a computer account is disabled?

Answer:

Use the wntUserGetDat function in the NT Extender.

A computer account is basically a user account with a name that ends in "$".

Don't forget the account flag bits that differentiate the user accounts from the domain trust accounts from the workstation / member server accounts.

The trailing "$" character simply makes the name invisible w/respect to normal tools that list accounts in the SAM database on domain controller.

Here is a sample for you.

AddExtender("wwwnt34i.dll")

sServer = ""
sUser = "JoeBlow"

flags = wntUserGetDat(sServer, sUser, "flags", 0)

If flags & 1 Then Message(sUser, "Account Enabled")
If flags & 2 Then Message(sUser, "Account Disabled")

Article ID:   W16041
File Created: 2004:03:30:15:42:28
Last Updated: 2004:03:30:15:42:28