Я хочу соединиться с Office 365 через powershell, отсылая к учебным руководствам очень простую задачу. Но по-видимому не для меня.
Я думаю, что пропустил простые но важные мелочи.
Некоторая информация:
Я попробовал следующее
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
Справка действительно ценится!
Не похоже, что PowerShell для O365 поддерживает двухфакторную аутентификацию.
http://community.office365.com/en -us / f / 148 / t / 222763.aspx
«Если для учетной записи администратора была включена многофакторная аутентификация, PowerShell не будет работать, когда он подключается к PowerShell с этой учетной записью администратора. Убедитесь, что вы создали учетную запись службы с надежной пароль для запуска сценариев PowerShell и не включать эту учетную запись для многофакторной аутентификации »