Hi, I have to export a list of all AzureAD users where the EmployeeID attribute is not empty, I would also like to confirm if they are also a member of 2 groups. I have the EmployeeID query, just wondering how I can include if they are a members of 2 groups in the same spreadsheet. I can export both groups and get the information in Excel but would prefer to run a powershell script if it’s not a lot of work.
I cannot test at the moment but that should be an easy task. Simply Query both groups, save the output of each query in a variable and use a Where-Object for your Get-AzureADUser query to determine if - first: the AzureADUser has an EmployeeId AND - second: is found in both groups.
BTW: When you post code, sample data, console output or error messages please format it as code using the preformatted text button ( </> ). Simply place your cursor on an empty line, click the button and paste your code.