Solved

Need a script or Windows command

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

Flexible connectivity for any environment

The KE6900 series can extend and deploy computers with high definition displays across multiple stations in a variety of applications that suit any environment. Expand computer use to stations across multiple rooms with dynamic access.

Question has a verified solution.

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

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

820 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