Link to home
Start Free TrialLog in
Avatar of ProjNet
ProjNetFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Deleting multiple AD User accounts from CSV file

Hello,

I need to delete AD users along with their Exchange accounts via the attached CSV file, I have the SANaccountname field available, I have Exchange 2007 with AD 2003

I would guess the best way to do this is via Powershell on the Exchange server, can you assist?
Userstobedeleted.csv
Avatar of Mahesh
Mahesh
Flag of India image

You can use code mentioned in below article as powershell script (ps1) in exchange 2007 shell

http://randomtechminutia.wordpress.com/2012/05/03/powershell-script-to-delete-exchange-mailboxes-in-mass/

It will disable mailbox and delete user as well from AD for the list of users

Mahesh
ASKER CERTIFIED SOLUTION
Avatar of Jamie McKillop
Jamie McKillop
Flag of Canada 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 ProjNet

ASKER

thanks guys,

Jjmck, this worked beautiful, only thing is the notification asking if I wanted to apply these changes kept appearing per account, it gives me an option to say yes to all (A), but it kept constantly coming back for each account, any ideas?
Add -confirm: $false to the end of the remove-mailbox command.

-JJ