PowerShell Script to Bulk Disable Exchange Mailboxes.

To ease some of my some of my daily activities , I have created this PowerShell script to bulk disable Exchange Mailboxes.

The script can be executed from a non Exchange PowerShell Console, it will import the Exchange PowerShell cmdlets.

The script imports a csv and runs the disable cmdlets against those mailboxes.

#Create Exchange PowerShell PSSession

$s=New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://lazycas01/powershell -Authentication Kerberos

#Import Exchange PowerShell Session

Import-PSSession -Session $s -AllowClobber

#Import CSV

Import-Csv "D:\Softlib\Scripts\Bulk-Disable-Users\DisableMBX.csv" |ForEach-Object{Get-Mailbox -identity $_.Email | Disable-Mailbox -confirm:$false}

Write-Host "Mailbox has been disabled Successfully" -ForegroundColor Green

 Download Link Here

[media-downloader media_id=”970″ texts=”Download File”]

#ThatLazyAdmin