Link to home
Start Free TrialLog in
Avatar of mahmoud_2008
mahmoud_2008Flag for Jordan

asked on

Old computer accounts in windows 2008 active directory

I need a script to find and disable computer accounts which are 90 days of no activity in active directory
Avatar of helpfinder
helpfinder
Flag of Slovakia image

For finding such a computers use this command:
dsquery computer –inactive 12 > c:\admin\computer90day.txt

and for disable this one should be working
    dsquery computer –inactive 12 | dsmod computer –disabled yes
Avatar of mahmoud_2008

ASKER

Thanks, I checked the first command and it works fine.
for the second command, is it possible to run it against a single OU?
if yes what is the command for that
does not work just select all computers in your desired OU (ctrl+a) and right click where Disable account should be possible?
in this case can I move these computers (90 days inactive) to an OU named: disabled_computers, then I can do the above procedure
ASKER CERTIFIED SOLUTION
Avatar of helpfinder
helpfinder
Flag of Slovakia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks a lot for your help