DanielChronlund / DCToolbox

Tools for Microsoft cloud fans
309 stars 52 forks source link

Enable-DCAzureADPIMRole is running two times and throwing error #23

Closed ollimenzel closed 1 year ago

ollimenzel commented 2 years ago

I'm running the latest version of your PS-Commands. When I run e.g., Enable-DCAzureADPIMRole -RolesToActivate 'Power Platform Administrator' -Reason 'Admin Tasks' I am getting ask two times for the duration. The second time I get an error saying the the Permission of course is already active: Open-AzureADMSPrivilegedRoleAssignmentRequest: Error occurred while executing OpenAzureADMSPrivilegedRoleAssignmentRequest Code: RoleAssignmentExists Message: The Role assignment already exists. Is this a bug? Or do I need to do something differently? It would be great btw. to have something like a -duration parameter in the future to assign PIM just for a certain amount of time.