Solved

Need a script or Windows command

Posted on 2012-04-04
3
292 Views
Last Modified: 2012-05-17
I have a list of domain users. I want a script  to check whether those accounts are enabled or disabled  user accounts in the active directory.
Also is there any commands in Windows to check the status of an user account is enabled or disabled in domain

Thanks
0
Comment
Question by:jmohan0302
  • 2
3 Comments
 
LVL 59

Accepted Solution

by:
Darius Ghassem earned 167 total points
ID: 37807649
You can use this script that will give you all disabled accounts which you can compare too.

http://gallery.technet.microsoft.com/scriptcenter/02cc08c2-1cf3-4eb1-a8d0-e838d74f7783
0
 
LVL 17

Assisted Solution

by:Anuroopsundd
Anuroopsundd earned 333 total points
ID: 37807661
command - net user /domain username


Set objUser = GetObject _
("LDAP://CN=Impersonation User,CN=Users,DC=subdomain,DC=domain,DC=com")

If objUser.IsAccountLocked = FALSE Then
WScript.Echo "The account is enabled."
Else
WScript.Echo "The account is disabled."
End If
0
 
LVL 17

Assisted Solution

by:Anuroopsundd
Anuroopsundd earned 333 total points
ID: 37807674
so if your username is test123 on domain.. you can run the below command from any domain machine to query

net user /domain test123
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
An article on effective troubleshooting
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now