Solved

List off all users who are disabled in the last month in Active directory 2008

Posted on 2013-10-30
3
2,426 Views
Last Modified: 2013-11-14
List off all users who are disabled in the last month in Active directory 2008

HI Guys,
IS any way I can run a command or script in PS to pull all the users who were disabled in the last month?

Also I need to get a list off all users who is created in the last month and there account is Active

Thanks
Rabih
0
Comment
Question by:Rabihhaj
3 Comments
 
LVL 5

Accepted Solution

by:
Recept earned 500 total points
ID: 39613089
The Native AD Powershell way;

Disabled in the last 30 days
Get-ADUser -LDAPFilter {(useraccountcontrol:1.2.840.113556.1.4.803:=2)} -Properties whenChanged | Where-Object {$_.whenChanged -gt (Get-Date).AddDays(-30)} | Select-Object Name, whenChanged

Created in the last 30 days
Get-ADUser -Filter * -Properties whenCreated | Where-Object {$_.whenCreated -gt (get-date).AddDays(-30)} | Select-Object Name, whenCreated


The Quest AD Cmdlets way;

Disabled in the last 30 days
Get-QADUser -Disabled | Where-Object {$_.whenChanged -gt (get-date).AddDays(-30)} | Select-Object Name, whenChanged

Created in the last 30 days
Get-QADUser | Where-Object {$_.whenCreated -gt (get-date).AddDays(-30)} | Select-Object Name, whenCreated


Unfortunately there is no AD attributed for WhenDisabled so all we can do is check for disabled accounts which have been modified in the last 30 days.
0
 
LVL 10

Expert Comment

by:Gajendra Rathod
ID: 39613389
You case install Active Directory Query Tool and find out the user information easily.
0
 

Author Comment

by:Rabihhaj
ID: 39649396
Hi Gajendra,

I do have the tool installed is any instruction you can send me to do that

Thanks
RAbi h
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

My previous article  (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/A_4466-A-beginners-guide-to-installing-SCCM2007-on-Windows-2008-R2-Server.html)detailed one possible method to get SCCM 2007 installed an…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

867 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

18 Experts available now in Live!

Get 1:1 Help Now