Last active
January 5, 2023 21:54
-
-
Save pankajsurti/b2d1a2d319afe20233ab7905321247d2 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
#Execute Read-Host once and comment out | |
#Read-Host "Enter password" -AsSecureString | ConvertFrom-SecureString | Out-File "C:\Temp\passwordNEW.txt" | |
$TenantName="CRM106438" # Change to your tenant name | |
$Username = $("admin@{0}.onmicrosoft.com" -f $TenantName) | |
$Password = cat "C:\Temp\passwordNEW.txt" | ConvertTo-SecureString | |
$Creds = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $Username, $Password | |
Connect-MicrosoftTeams -Credential $Creds | |
Connect-ExchangeOnline -Credential $Creds | |
Connect-SPOservice -url $("https://{0}-admin.sharepoint.com" -f $TenantName) -Credential $Creds | |
Connect-Msolservice -Credential $Creds | |
Connect-AzureAD -Credential $Creds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment