Created
August 25, 2019 04:36
-
-
Save Sumeet-Gandhi/98fdfbdb25e87425aa60908057083bed to your computer and use it in GitHub Desktop.
exchange online connect
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$UserCredential = Get-Credential | |
Import-Module MSOnline | |
Connect-MsolService –Credential $UserCredential | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection | |
Import-PSSession $Session -DisableNameChecking -AllowClobber | |
Set-OwaMailboxPolicy -Identity Default -AdditionalStorageProvidersAvailable $false | |
Remove-PSSession $Session | |
$userid=read-host 'Enter username' | |
$password=Read-Host -AsSecureString 'Enter password' | |
$cred=New-Object System.Management.Automation.PSCredential $userid,$password | |
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $cred -Authentication Basic -AllowRedirection | |
Import-PSSession $Session -AllowClobber | |
Set-OwaMailboxPolicy -AdditionalStorageProvidersAvailable $false -Identity "Hide OWA IM" | |
Set-OwaMailboxPolicy -AdditionalStorageProvidersAvailable $false -Identity "Owa AP group creation disabled policy" | |
Remove-PSSession $Session |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment