Solved

Need a script or Windows command

Posted on 2012-04-04
3
291 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

Why are Office 365 signatures so complicated?

Trying to setup transport rules for Office 365 email signatures and can’t quite figure it out? Having to test the signature over and over? Make things simple by using Exclaimer Cloud - Signatures for Office 365.

Question has a verified solution.

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

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

911 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

21 Experts available now in Live!

Get 1:1 Help Now