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.