Tuesday, 16 February 2016

Enabling and disabling Outlook Anywhere Per User

Using Exchange Powershell the following below can enable and disable outlookanwywhere.

To enable outlook anywhere for a single user:
Get-Mailbox –Identity "username" | Set-CASMailbox -MAPIBlockOutlookRpcHttp:$False

To disable outlook anywhere for a single user:
Get-Mailbox –Identity "username" | Set-CASMailbox -MAPIBlockOutlookRpcHttp:$True

To enable it for all users:
Get-Mailbox –ResultSize Unlimited | Set-CASMailbox -MAPIBlockOutlookRpcHttp:$False

To disable it for all users:
Get-Mailbox –ResultSize Unlimited | Set-CASMailbox -MAPIBlockOutlookRpcHttp:$True


To enable it for multiple users only:

Create text file:
Username1
Username2
etc

  • Now save this text file to any locationu. Name it users.txt. For example C:users.txt
  Next run the script below:

$Mailboxes = Get-Content C:users.txt
Foreach ($Mailbox in $Mailboxes)
{
Set-CASMailbox -Identity $Mailbox -MAPIBlockOutlookRpcHttp:$false -Verbose
}


To disable it for multiple users only:

Create text file:
Username1
Username2
etc

  • Now save this text file to any locationu. Name it users.txt. For example C:users.txt
  Next run the script below:

$Mailboxes = Get-Content C:users.txt
Foreach ($Mailbox in $Mailboxes)
{
Set-CASMailbox -Identity $Mailbox -MAPIBlockOutlookRpcHttp:$true -Verbose
}


No comments:

Post a Comment