Solved

Need a script or Windows command

Posted on 2012-04-04
3
295 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

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

Determining the an SCCM package name from the Package ID
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
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…

688 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