Open Powershell as administrator
You will see the prompt - C:\WINDOWS\system32
Type CD C:\
You should see C:\
Type Install-module azuread
The system will install the necessary modules, agree to the prompts as below
Copy the script into the root of your C:\ drive.
This script Export365Members.ps1 selects users from the 'Signature Users' group and exports the information as per this example users_file.csv
Potential issues:
WARNING: Unable to download from URI 'https://go.microsoft.com/fwlink/?LinkID=627338&clcid=0x409' to ''.
Solution: Set Powershell to TLS 1.2 by running the commend below:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
Unable to execute unsigned script
Solution: Remove the execution policy for all the users of the local computer by running the command below:
Set-ExecutionPolicy -ExecutionPolicy Undefined -Scope LocalMachine