Hi all,
We have just upgraded to Exchange 2013 and currently cant set mailbox permissions via the Exchange Admin Center, we currently have to do it via Exchange Shell.
Thats all fine but i would like to automate it so my team can run a script and get prompted to enter the target mailbox and the user's id.
Im new to ExchangeShell/PowerShell so be gentle with your feedback, but this is what I have come up with:
$RemoteEx2013Session = New-PSSession -ConfigurationName Microsoft.Exchange ` -ConnectionUri ` -Authentication #-Credential (Get-credential)
Import-PSSession $RemoteEx2013Session -AllowClobber
$mailboxname = Read-Host "Please enter name of mailbox"
$UserID = Read-Host "Please enter name of user"
$output = set-mailbox $mailboxname -GrantSendOnBehalfTo $UserID
When I run it I get "Insufficient access rights to perform the operation", I get what that means but if I manually type the command it works i.e set-mailbox john.smith -GrantSendOnBehalfTo Jane.Smith
Questions are: Is this possible to semi-automate this via powershell, and am i totally of track with the above commands?
Thanks in advanced