does anyone have a safe peice of software that will query active directory and generate a report on computers that have been inactive for over a period of time.
does anyone have a safe peice of software that will query active directory and generate a report on computers that have been inactive for over a period of time.
You can use dsquery to get a list eg. to find all computers unused for 8 weeks
To delete the computersCode:dsquery computer -inactive 8 -limit 0
Code:dsquery computer -inactive 8 -limit 0 | dsrm
Last edited by somabc; 26th April 2010 at 10:00 AM.
Trapper (26th April 2010)
You can use WSUS for this![]()
thanks somabc,
Could you give some detail about the number after inactive and limit? I assume in your example 8 means it will show any computers inactive for over 8 weeks, and no limit ont he number of results?
Dsquery computer has details - inactive is no of weeks and limit is no of objects in AD to show with 0 being unlimited
HMCTech (26th April 2010)
In case anyone is interested in solving issues of this kind using a third party solution, my personal advice is Softerra Adaxes. The software contains a vast list of AD reports, and the one particular that solves the issue is called "Inactive Computers". It allows to view computers inactive during a period of time. Thank you.
I use oldcmp and run this batch file
oldcmp -report -age 120 -format csv
You can change the format and age, I then just go through Active Directory and disable and move the accounts to another OU. You can get it to disable and delete the accounts I think but I wanted a little more control. Did 1800 machines the other week. You can download oldcmp if you just Google it.
I use a small VB Script to pick out old machines and user details. Shout if you want a copy
Me too & can't think of anything better (it's from joeware.net amongst some other very good free utils)I use oldcmp
I Have successfully used Quest AD Cmdlets for this task.
You will need to install and run the Quest Powershell console, these commands do not seem to run in the standard shell even with the cmdlets installed. A bit like exchange 2010 seems to need its own shell.
Quest AD Cmdlets are free to download from PowerShell Commands (CMDLETs) for Active Directory by Quest Software
Outputs to shell consoleCode:get-qadcomputer -IncludeAllProperties | Where-Object { $_.lastlogon -lt (get-date).AddDays(-90) }
Outputs to csvCode:get-qadcomputer -IncludeAllProperties | Where-Object { $_.lastlogon -lt (get-date).AddDays(-90) } | select-object Name, ParentContainer, Description, pwdLastSet | export-csv c:\outdated.csv
Moves to alternate OUCode:get-qadcomputer -IncludeAllProperties | Where-Object { $_.lastlogon -lt (get-date).AddDays(-90) } | Move-QADObject -to my.corp/obsolete
tack this to the end to disable the accounts
Check Locate obsolete computer records in AD « Dmitry’s PowerBlog: PowerShell and beyond for more.Code:| disable-QADComputer
And QAD cmdlets reference - PowerGUI Wiki
BoX
TheScarfedOne (24th February 2011)
I love the warranty on the utilities he offers... warranty and license
There are currently 1 users browsing this thread. (0 members and 1 guests)