azure - 使用 Set-AzureADApplicationProxyApplication 设置 ConnectorGroupId 的问题
问题描述
我的代码如下:
$aadapConnectorGroups=Get-AzureADApplicationProxyConnectorGroup -Top 100000
foreach ($item in $aadapConnectorGroups)
{
If ($item.ConnectorGroupType -eq "applicationProxy" -And $item.Name -eq $ConnectorGroupIdName)
{
New-AzureADApplicationProxyApplication `
-DisplayName $ApplicationName `
-ExternalUrl $ExternalUrl `
-InternalUrl $InternalUrl `
-IsHttpOnlyCookieEnabled $isHttpOnlyCookieEnabled `
-ApplicationServerTimeout $applicationServerTimeout `
-IsPersistentCookieEnabled $isPersistentCookieEnabled `
-ConnectorGroupId $item.ObjectID
}
}
当我尝试设置ConnectorGroupId
with时出现以下错误Set-AzureADApplicationProxyApplication
。
Error occurred while executing SetApplicationProxyApplication Code:
Request_ResourceNotFound Message: Resource
'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx' does not exist or one of its queried
reference-property objects are not present.
我在创建新的 Azure AD 应用程序代理应用程序时遇到同样的错误New-AzureADApplicationProxyApplication
。
当我尝试默认的ConnectorGroupId时,它工作得很好。所以我想问题出在我最近创建的ConnectorGroup上。但是,在门户上,我看到我的新连接器组已创建并且运行良好。
使用Get-AzureADApplicationProxyConnectorGroup
命令,我也可以看到我的新连接器组。
我可以从门户将它分配给 AzureADApplicationProxyApplication 。所以从逻辑上讲,它也应该在 cli 中工作。
你知道为什么我有这个错误吗?
编辑:我也尝试了以下命令:
Set-AzureADApplicationProxyApplication -ObjectId $item2.ObjectID
-ConnectorGroupId $item.ObjectID -Verbose
虽然它返回了成功消息,但它并没有更改应用程序的 ConnectorGroupId。我已经从门户网站和 cli 进行了验证。
解决方案
Error occurred while executing SetApplicationProxyApplication Code:
Request_ResourceNotFound Message: Resource
'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx' does not exist or one of its queried
reference-property objects are not present.
此错误意味着-ObjectId
不存在,而不是-ConnectorGroupId
.
当您使用 来创建新的 Azure AD 应用程序代理应用程序时New-AzureADApplicationProxyApplication
,您不需要指定-ObjectId
,所以我不确定您为什么会收到此错误。
您需要指定正确的对象 ID:
New-AzureADApplicationProxyApplication -DisplayName "Finance Tracker10" -ExternalUrl $externalUrl -InternalUrl $internalUrl -ConnectorGroupId $connectorGroupId
$app = Get-AzureADApplication -Filter "DisplayName eq 'Finance Tracker10'"
Set-AzureADApplicationProxyApplication -ObjectId $app.ObjectId -ConnectorGroupId $newConnectorGroupId -ExternalUrl $newExternalUrl -InternalUrl $newInternalUrl1
推荐阅读
- c# - 当没有字段名时反序列化一个json字符串。在c#中
- javascript - 如果轮播少于 5 个项目,则隐藏导航按钮,但如果轮播超过 5 个项目,则显示导航按钮 - Owl Carousel 2
- c# - 在 C# 中使用 Visa.Interop.ResourceManager 时出现异常错误
- python-3.x - 如何在 tkinter 中添加图像?
- html - 如何使标志在圆圈内居中?
- imagemagick - 从命令行将 YUY2 (YUYV) 转换为 png
- c++ - RWStructuredBuffer 计数器不递减 (DX12)
- algorithm - 计算两个排列中的对 (a,b),使得两个排列中的 index(a) < index(b)
- c++ - 在复制构造函数定义中调用成员构造函数
- javascript - 计算器退格按钮