如何使用PowerShell自动在Azure AD中注册Office 365应用程序?

时间:2017-03-14 08:41:38

标签: powershell azure automation office365

为了便于部署,我想自动化应用注册流程Office 365 Azure AD。 Manuel过程在日历或活动目录或Graph上应用证书和授予某些权限是复杂且耗时的。

我希望简化整个注册和部署过程,以便流程顺利进行。

manual process link click here

1 个答案:

答案 0 :(得分:0)

我将以下命令发送到新的Microsoft在线ServicePrincipal

C:\PS>$cer = New-Object System.Security.Cryptography.X509Certificates.X509Certificate
              $cer.Import("C:\temp\myapp.cer")
              $binCert = $cer.GetRawCertData()
              $credValue = [System.Convert]::ToBase64String($binCert);
              New-MsolServicePrincipal -ServicePrincipalNames @("MyApp/myApp.com") 
                                       -DisplayName "My Application" 
                                       -Type asymmetric -Value $credValue

创建了新的服务主体对象。

您需要连接到MsolService

$Credential = Get-Credential
Connect-MsolService -Credential $Credential