我正在运行以下命令:
Add-AzureADGroupMember -ObjectId <Guid1> -RefObjectId <Guid2>
我遇到以下错误:
Add-AzureADGroupMember : Error occurred while executing AddGroupMember
Code: Request_BadRequest
Message: The URI 'https://graph.windows.net//<tenantId>/directoryObjects/<Guid2>' is not valid since it is not based on 'https://graph.windows.net/<tenantId>/'.
HttpStatusCode: BadRequest
HttpStatusDescription: Bad Request
HttpResponseStatus: Completed
请注意,第一个URL在租户ID之前有一个额外的正斜杠。
我相信这是一个错误,但不确定。
我从本地计算机运行了相同的PowerShell,并且按预期方式工作了-这可能与Azure Portal Shell中运行的AzureAD模块的版本有关。