Why do it the hard way instead of the easy way,  imagine you’ve got several mailboxes which you would like to disable and you’ve got them listed in a CSV file. Why shouldn’t you use Powershell to do this.

Save the script below in the Exchange 2007 scripts directory:

dismb.ps1

Param(
  
[string] $CSVFile
  
)
  
Import-CSV $CSVFile | ForEach-Object -Process {disable-Mailbox $_.Name}

Execute it via Powershell by typing the following .\dismbps1 “c:\csvfile.csv”

The script will open the CSV you will give as a parameter when executing the command and will take read the column Name.

A warning will be displayed which asks you to confirm the changes you want. When acknowleding the alarm the mailboxes will be disabled.


Comments


Johan Veldhuis