az ad user update
command to update the user’s MFA settings.az ad user update --id <user-id> --force-change-password-next-login true
az ad policy password update
command to update the password policy settings.az ad policy password update --id <policy-id> --password-lifetime 90 --password-history-count 5
az ad pim update
command to enable PIM for a specific role.az ad pim update --id <role-id> --enabled true
<user-id>
, <policy-id>
, and <role-id>
placeholders should be replaced with the actual IDs or names of the users, policies, or roles you want to modify.
azure-identity
library to authenticate with Azure Active Directory.azure-mgmt-graphrbac
library to interact with the Azure AD Graph API.UserOperations
class to reset the password for a specific user.azure-identity
library to authenticate with Azure Active Directory.azure-mgmt-graphrbac
library to interact with the Azure AD Graph API.UserOperations
class to enable MFA for a specific user.azure-identity
library to authenticate with Azure Active Directory.azure-mgmt-graphrbac
library to interact with the Azure AD Graph API.UserOperations
class to create a new user.azure-identity
and azure-mgmt-graphrbac
) before running these scripts.