Created
July 27, 2015 17:26
-
-
Save kenaniah/45f2046a7a597484198e to your computer and use it in GitHub Desktop.
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
# Connect to Microsoft Online as admin | |
$cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "[email protected]",(Get-Content admin.pass | ConvertTo-SecureString) | |
Connect-MsolService -Credential $cred | |
# Connect to Office365 as admin | |
$session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $cred -Authentication Basic -AllowRedirection | |
Set-ExecutionPolicy unrestricted | |
Import-PSSession $session |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment