You need to use Connect-AzAccount from Az modules instead of Connect-AzureAD from the AzureAD module.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi Support
I would like to get a list of AzureDirectory roles that assigned to a specific user by powershell .. i tried many commands but keep getting the error :
Get-AzRoleAssignment -SignInName "xxxxx@永爱不变 .com"
Get-AzRoleAssignment : Object reference not set to an instance of an object.
At line:1 char:1
I ran connect-azureAD before running the command above.
my nex question is how can i compare or copy the azuredirectory assigned role from one user to another user? the roles are administrative azure roles.
we have 5 admins and when a new admin account is being created so its useful to copy the same roles from one admin to another admin as each admin has many roles.
Best regards
Sam
You need to use Connect-AzAccount from Az modules instead of Connect-AzureAD from the AzureAD module.