To run PS commands in O365, a few additional steps must be taken to log into your O365 environment. Without this process, Powershell will not be able to run specific cmdlets needed for JOIN to function properly.
- Run PowerShell as admin(elevated)
- $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri “https://ps.outlook.com/powershell/” -Credential $cred -Authentication Basic -AllowRedirection
- enter username/pass for auth
- Import-PSSession $session
- run PS commands per usual