我想我错过了一个简单而重要的琐事.
一些信息:
>许可证是Office 365 Buisness Essential
> Azure AD正在运行
>我可以将powershell远程处理(WinRM)与其他服务器一起使用
>我使用管理员帐户
>我使用我的域并尝试了onmicrosoft.com域
>配置双因素身份验证(附加安全验证)
我尝试了以下内容
PS C:\>Import-Module MSOnline PS C:\>$msolcred = get-credential PS C:\>connect-msolservice -credential $msolcred connect-msolservice : The user name or password is incorrect. Verify your user name,and then type your password again.
和
PS C:\> $O365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -Credential $msolcred -Authentication Basic -AllowRedirection New-PSSession : [ps.outlook.com] Connecting to remote server ps.outlook.com Failed with the following error message : Access is denied. For more information,see the about_Remote_Troubleshooting Help topic.
我使用了不同的连接uri
PS C:\> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $msolcred2 -Authentication Basic -AllowRedirection New-PSSession : [outlook.office365.com] Connecting to remote server outlook.office365.com Failed with the following error message : [ClientAccessServer=VI1PR05CA0019,BackEndServer=,RequestId=5d73dec9-b3ee-4e71-9ddd-bdaac8f79998,TimeStamp=3/7/2015 8:17:50 AM] [FailureCategory=LiveID-InvalidCreds] Access Denied For more information,see the
非常感谢帮助!