【发布时间】:2017-11-16 15:02:10
【问题描述】:
我已登录到我为测试而创建的 Azure AD。我正在尝试向用户添加扩展属性:
我首先在我的应用程序中添加了扩展类型: 命令:
New-AzureADApplicationExtensionProperty -ObjectID 513aba62-4610-44ef-8be2-5a5e99a5e6bd -DataType "string" -Name "organisationId"
结果:
extension_d939d34ab3f34f5dbb6e4e5c35e5787a_organisationId
应用的ObjectId:513aba62-4610-44ef-8be2-5a5e99a5e6bd
然后我检索了扩展属性的 id: 命令:
Get-AzureADApplicationExtensionProperty -ObjectId 513aba62-4610-44ef-8be2-5a5e99a5e6bd
现在我正在尝试将此扩展添加到我在活动目录中的第一个用户:
$User = Get-AzureADUser -Top 1
Set-AzureADUserExtension -ObjectId $User.ObjectId -ExtensionName extension_d939d34ab3f34f5dbb6e4e5c35e5787a_organisationId -ExtensionValue "12345"
错误:
Set-AzureADUserExtension : Error occurred while executing SetUser
Code: Request_BadRequest Message: The following extension properties
are not available for the given resource:
extension_d939d34ab3f34f5dbb6e4e5c35e5787a_organisationId. RequestId:
2cbeff0f-5b91-478a-8c64-586a4d23e4c5 DateTimeStamp: Wed, 14 Jun 2017
13:49:02 GMT HttpStatusCode: BadRequest HttpStatusDescription: Bad
Request HttpResponseStatus: Completed At line:2 char:1
+ Set-AzureADUserExtension -ObjectId $User.ObjectId -ExtensionName exte ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Set-AzureADUserExtension], ApiException
+ FullyQualifiedErrorId : Microsoft.Open.AzureAD16.Client.ApiException,Microsoft.Open.AzureAD.Graph.PowerShell.Custom.SetAzureADUserExtension
【问题讨论】:
-
你想要足够长的时间让它传播吗? 10-15 分钟?
-
我试了 2 小时后,还是一样的错误
标签: powershell azure active-directory