Finally some new capabilites for us in regards to displaying, changing and turning off MFA-configurations for users. My past post regarding MFA-status can be read here which utilized Get-Msoluser. Now, Microsoft has released a new set of commands in the MSGraph api for Azure Multi-factor authentication which I’ll briefly go through in this post. Note that this is only in beta right now and more features will be added later.
First, let’s see what we can do as stated here:
“The new APIs we’ve released in this wave give you the ability to:
- Read, add, update, and remove a user’s authentication phones.
- Reset a user’s password.
- Turn on and off SMS sign-in.”
Sweet, let’s try it out. We’ll start by navigating to Microsoft Graph and consent to the required permissions. For this example, be sure to use an account who is Global Administrator or Authentication Administrator.
Enter this information (change UPN to a test-user in your tenant):
Now select “Modify permissions” and be sure to consent to the permission UserAuthenticationMethod.ReadWrite.All
Note that I’ve specified GET (fetch information) and when I press Run Query now, the result:
No value, which was expected in my case since my test-user does not have any phone number registered as authentication method for MFA. So let’s now try to POST the information instead and give the user a registered telephone number.
Change GET to POST
In the request Body, enter the following entries with your chosen values:
Press Run Query again.. Success!
If you would like to verify the setting, change POST to GET again to fetch the same users Authentication Methods and now you’ll see the phone number:
The information can also be verified in AzureAD of course under Authentication Methods:
As Microsoft has stated here, more methods will be added in the future for these API-calls which will be much appreciated by many of us out there.