script granting pim admin role in Azure AD with MFA
Hi,
I'm trying to script some maintenance tasks in Exchange, and to make the changes I need to grant myself the exchange admin role in PIM and authenticate using MFA.
I've followed this but I still get an error relating to MFA:
Open-AzureADMSPrivilegedRoleAssignmentRequest : Error occurred while executing
OpenAzureADMSPrivilegedRoleAssignmentRequest
Code: RoleAssignmentRequestPolicyValidationFailed
Message: The following policy rules failed: ["MfaRule"]
I'm not sure if the clientid I've used is right, where do I get this from? does that relate to an specific application?
Thanks