script granting pim admin role in Azure AD with MFA

Darryl 256 Reputation points
2021-05-27T14:34:44.023+00:00

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

Windows for business Windows Server User experience PowerShell
Microsoft Security Microsoft Entra Other
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.