Link to home
Start Free TrialLog in
Avatar of Angeal
Angeal

asked on

Powershell: Move all disabled AD accounts to "Ex Employees" OU

Can someone please help. I need to find all disabled user accounts and move them to a specified OU called "Ex Employees" using Powershell.

It would be great if the domain name and OU had a variable so I can use this in multiple environments easily.

THanks!

A.
Avatar of Joseph Daly
Joseph Daly
Flag of United States of America image

This is very simple using the quest cmdlets.

Get-qaduser -disabled | move-qadobject -NewParentContainer {distinguished name of EX employees ou}
Avatar of Angeal
Angeal

ASKER

Xxdcmast,

I would prefer to use the builtin AD cmdlets, if possible.

Thanks!

A.
ASKER CERTIFIED SOLUTION
Avatar of SubSun
SubSun
Flag of India 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
Avatar of Angeal

ASKER

Hi Subsun,

Works like a charm! Thanks for your help!.

A.
You're Welcome!!