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 https://ps.outlook.com/powershell/ -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 example.com

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

Adjust a username on Office 365

PS C:\> Set-MsolUserPrincipalName -UserPrincipalName mary.osgood@contoso.onmicrosoft.com -NewUserPrincipalName mary.smith@contoso.com

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 https://contoso.sharepoint.com -UseWebLogin (Maybe Not?)

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

> Connect-SPOService -Url https://contoso-admin.sharepoint.com

C:\> $web = Get-SPOSite -Identity https://contoso.sharepoint.com