Solved

get status of user(enable or disable) in AD with command

Posted on 2013-12-04
3
429 Views
Last Modified: 2014-01-14
I received a request for around 30-40 users to provide information for them if their accounts are disabled or not in AD.
It's very time consuming to go to each account in AD, open account tab, scroll down to see if the checkbox is applied and to take a screenshot.
Is there any other way,with command to get this information for list of users. I am having the list of users in txt file.
And the most important I cannot copy/paste info - I need to provide a screenshot , so it will be useful if the command retrieve info probably like
user - enabled
user2- disabled
user3 -disabled

AD domain is Windows 2003R2
0
Comment
Question by:dedri
[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
3 Comments
 
LVL 19

Assisted Solution

by:jss1199
jss1199 earned 167 total points
ID: 39695591
dedri - Personally, I am fond of Powershell so I would suggest you use the below script, modified to your specifications.

Get-Content -Path C:\AccountsListing.txt |
ForEach-Object {
    Get-ADUser -LDAPFilter "(samaccountname=$_)" |
    Select-Object -Property samaccountname,enabled
}

Open in new window


Since you are a 2003 domain, you'll need to ensure you are setup in a similar fashion as this to enable powershell cmdlets against your 2003 domain.

jss
0
 
LVL 37

Assisted Solution

by:Mahesh
Mahesh earned 166 total points
ID: 39695608
What you can do, just open AD users and computers snap ins and right click domain name and click on find
In find box select Common queries and select checkbox against "Disabled users"
so that it will give you the list of disabled users
Just export the list.
All users except above are enabled users

Or you can download "Bulk AD Users" tool from Wise soft (Freeware) and search user there from list, it will give you the status of all users, just export them and filter with "Disabled or Enabled
http://wisesoft.co.uk/software/bulkadusers/default.aspx

Mahesh
0
 
LVL 3

Accepted Solution

by:
Detlef001 earned 167 total points
ID: 39699007
You can get but by specific areas like in you can get it by user who by date the enable and disable status.

Have a look at this link for the same.

http://gallery.technet.microsoft.com/scriptcenter/Script-to-disable-or-re-4e7bda2f

http://gallery.technet.microsoft.com/scriptcenter/PowerShell-to-Disable-c55a8862

http://blogs.technet.com/b/heyscriptingguy/archive/2010/11/22/use-powershell-to-enable-or-disable-a-local-user-account.aspx

Hope it helps you to achieve your task.

Thanks.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

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.
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

749 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