Office 365

This article is about PowerShell and the tasks I use it for.

Connect to Office 365 for Exchange management

$Cred = Get-Credential

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $Cred -Authentication Basic -AllowRedirection

Import-PSSession $Session

Remove-PSSession $Session

Adjust Azure AD

PS C:\> install-module msonline

PS C:\> connect-msolservice

PS C:\> Update-ADFSCertificate –CertificateType token-signing

PS C:\> update-msolfederateddomain -domainname

PS C:\> Get-MsolFederationProperty -DomainName | FL Source, TokenSigningCertificate

Adjust a username on Office 365

PS C:\> Set-MsolUserPrincipalName -UserPrincipalName -NewUserPrincipalName

Install a module for Sharepoint Online and use it to unlock a file?? (Not resolved)

PS C:\> Install-Module SharePointPnPPowerShellOnline

PS C:\> Connect-PnPOnline -Url -UseWebLogin (Maybe Not?)

> Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking

> Connect-SPOService -Url

C:\> $web = Get-SPOSite -Identity