使用Connect-MSOLservice与服务主体连接 [英] Connecting With Service Principal Using Connect-MSOLservice

查看:360
本文介绍了使用Connect-MSOLservice与服务主体连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用在AzureAD中创建的服务主体通过PowerShell脚本进行连接.我成功创建了SP,创建了密钥,还创建了一个自签名证书并将其与帐户关联.我知道如何使用Connect-AzureAD,但是Connect-MSOLservice似乎不允许我输入所需的值.

I am trying to use a service principal I have created in AzureAD to connect via a PowerShell script. I created the SP successfully, created the key, and also created a self signed cert and associated it with the account. I know how to use Connect-AzureAD but Connect-MSOLservice doesn't seem to allow me to enter the values needed.

我已经尝试过使用标准连接字符串,就像您使用Connect-AzureAD一样,但是似乎并没有采用相同的输入.

I have tried using the standard connection string as you would with Connect-AzureAD but it doesn't seem to take the same input.

Connect-MsolService -TenantId "xxxx" -ApplicationId "xxxx" -CertificateThumbprint "xxxx"

我希望有人可以向我展示或指出如何使用与服务主体相关的密钥或证书来使用Connect-MSOLservice命令.

I'm hoping someone can show me or point me in the direction of how to use the Connect-MSOLservice command using either the key or cert associated with the Service Principal.

推荐答案

无法使用服务主体通过"Connect-MSOLservice"来连接AAD

原因:

实际上,MSOL Powershell是 Office 365 Powershell .它是为管理O365在线服务而设计的.因此,只能通过Office 365用户登录.

Actually, MSOL Powershell is Office 365 Powershell. It's designed for managing O365 online services. Therefore, it could only be logged in via Office 365 users.

因此,您不能对来宾用户和服务主体使用Connect-MsolService,因为它们不是O365用户.

Hence, you cannot use Connect-MsolService with Guest users and service principals because they're not O365 users.

这篇关于使用Connect-MSOLservice与服务主体连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆