I have found the solution, In deed it`s happening because I have no premium license.
unable to assign a admin roles to admin unit
Hi guys, I`m trying to assign a Helpdesk Administrator to admin unite. Here is the code I used.
$administrativeUnitId = "314fa520-1456-4205-bb5e-667f0b80646d"
$adeleVanceId = "7fd45bd8-8f5a-4347-83d5-8c5b1967c74d"
$userAdministratorRoleId = "729827e3-9c14-49f7-bb1b-9608f156bbb8"
$params = @{
roleId = $userAdministratorRoleId
roleMemberInfo = @{
id = $adeleVanceId
}
}
New-MgDirectoryAdministrativeUnitScopedRoleMember -AdministrativeUnitId $administrativeUnitId -BodyParameter $params
Here is the error I got:
New-MgDirectoryAdministrativeUnitScopedRoleMember_Create:
Line |
11 | New-MgDirectoryAdministrativeUnitScopedRoleMember -Administrative …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Resource '729827e3-9c14-49f7-bb1b-9608f156bbb8' does not exist or one of its queried reference-property objects are not present.
Status: 404 (NotFound)
ErrorCode: Request_ResourceNotFound
Date: 2024-03-06T16:08:00
Headers:
Cache-Control : no-cache
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 8a132167-536a-4679-bf3c-ea150471b4aa
client-request-id : b5cfa6ed-aba1-46e2-964f-cad971d41c1f
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"Italy North","Slice":"E","Ring":"5","ScaleUnit":"002","RoleInstance":"MI3PEPF000001BD"}}
x-ms-resource-unit : 1
Date : Wed, 06 Mar 2024 16:07:59 GMT
PS B:\PowerShell>
I`m walking in circles for the past 2 hours. I suspect that it has something to do with the license I'm using.
May I ask you for help?
2 answers
Sort by: Most helpful
-
-
Shweta Mathur 28,201 Reputation points Microsoft Employee
2024-03-07T06:04:50.8566667+00:00 Thanks for reaching out.
I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to "Accept" the answer.