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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: