Solved

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

Posted on 2013-12-04
3
446 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

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

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

The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
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). …
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.
Suggested Courses

623 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