Quantcast
Channel: Software Communities : Popular Discussions - ActiveRoles
Viewing all articles
Browse latest Browse all 1277

Deprovision Script - Perform mailbox change - fails

$
0
0

I am trying to call the Exchange cmdlets in a script that will remove any mailbox rules a user has setup when their account is deprovisioned.

 

I have the script below and I don't get any errors but the script isn't working, can anyone point me in the right direction?

 

function onPostDeprovision($Request)

 

. 'D:\Program Files\Microsoft\Exchange Server\V14\Bin\RemoteExchange.ps1' Connect-ExchangeServer Auto

 

 

if ($Request.Class -ne "user") { return }

 

Get-InboxRule -Mailbox "$Request" | Remove-InboxRule


Viewing all articles
Browse latest Browse all 1277

Trending Articles