hde*_*dev 4 powershell azure microsoft-office-365
我想通过powershell连接Office 365,参考教程一个很简单的任务。但显然不适合我。
我想我错过了一个简单但重要的琐事。
一些信息:
我尝试了以下
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.
Run Code Online (Sandbox Code Playgroud)
和
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.
Run Code Online (Sandbox Code Playgroud)
我使用了不同的连接 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
Run Code Online (Sandbox Code Playgroud)
非常感谢帮助!
小智 8
PowerShell 似乎不支持 O365 的双因素身份验证。
http://community.office365.com/en-us/f/148/t/222763.aspx
“如果管理员帐户启用了多重身份验证,当他使用此管理员帐户连接到 PowerShell 时,PowerShell 将无法工作。确保您创建一个具有强密码的服务帐户来运行 PowerShell 脚本,并且不要为多重身份启用该帐户验证。”
| 归档时间: |
|
| 查看次数: |
6740 次 |
| 最近记录: |