gpt4 book ai didi

office365 - 使用 SharePoint Online Powershell 替代 appregnew.aspx

转载 作者:行者123 更新时间:2023-12-05 06:44:47 25 4
gpt4 key购买 nike

根据 Microsoft SharePoint Online 文档,对于提供商托管的应用程序,注册应用程序的方法是访问 https://.sharepoint.com/_layouts/15/appregnew.aspx 并生成应用程序信息,如 ClientID、ClientSecret 等.

我的要求是找到一种 SharePoint Online PowerShell 方法来执行相同的操作。

我在 http://technet.microsoft.com/en-us/library/fp161364%28v=office.15%29.aspx 提到了 SharePoint Online 的 CmdLets 集但无法找到正确的 CmdLet(不确定是否可用)。

如有任何帮助,我们将不胜感激。

最佳答案

所以我们已经使用 get-msolservicePrincipal 查看注册并使用 remove-msolserviceprincipal 删除它,所以 new-msolserviceprincipal 肯定会添加一个新的,对吗?但它没有用。那么我们也知道使用下面的三行创建一个新的证书续订辅助证书

New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Sign -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Verify -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Password -Usage Verify -Value $newClientSecret

好吧,如果我们把它们放在执行 new-msolserviceprincipal 之后呢?有用!

AppRegNew.aspx 替代方案

$servicePrincipalName = @("$clientID/$appDomain")

Write-Output "Adding New app registration"
New-MsolServicePrincipal -ServicePrincipalNames $servicePrincipalName -AppPrincipalId $clientID -DisplayName $appName -Type Symmetric -Usage Verify -StartDate "02/23/2016" -EndDate "02/22/2017" -Addresses (New-MsolServicePrincipalAddresses -Address $appUrl)
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Sign -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Symmetric -Usage Verify -Value $newClientSecret
New-MsolServicePrincipalCredential -AppPrincipalId $clientId -Type Password -Usage Verify -Value $newClientSecret

关于office365 - 使用 SharePoint Online Powershell 替代 appregnew.aspx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27372852/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com