Archive for April, 2013

Office 365 –Powershell command for email fowarding.

Connect to online power shell.

$O365Cred = Get-Credential

$O365Session = New-PSSession –ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential

$O365Cred -Authentication Basic -AllowRedirection Import-PSSession $O365Session -AllowClobber

Connect-MsolService –Credential $O365Cred

Set forwarding:

Set-Mailbox -Identity jitendra.k@abc.com -DeliverToMailboxAndForward $true -ForwardingSMTPAddress kjitendra462@gmail.com

Disable forwarding:

Set-Mailbox  ‘Jitendra Kumar’ –ForwardingSmtpAddress kjitendra462@gmail.com –DeliverToMailboxAndForward $false

Advertisements