I came through a requirement to set birthday information for all users who don’t have that value in the User Profile. Before doing that, I need a list of users with no birthday value set in the user profile.
Microsoft 365 CLI tool is coming in handy to retrieve that information. But the REST API or Microsoft GRAPH API used by the command, that doesn’t provide the birthday Information in a User collection. To get BirthDay, we must send the request to the server along with the user to fetch that. I have used below two commands in my script,
Get all Lists from AAD
m365 aad user list
Get BirthDay information for the provided user
m365 aad user get –properties birthDay –userName <User Name>
Below is the Sample script I used, the same for your reference,
Hope, this report helps in the large user base and we can use the same kind of script for other users properties.
June 12, 2021 at 10:45 PM
Where are you setting the new birthday values for those null entries in the code. Can you pls elaborate?
June 13, 2021 at 10:11 PM
We can set the birthday information for the user using Microsoft Graph API, check out my another blog – http://www.ktskumar.com/2021/06/update-user-birthday-using-graph-api/