Here’s how you can fetch all Office 365 group details
An O365 Administrator has the right and the duty of managing all the users in the portal. By running this script, a Global Admin can set parameters and at once fetch any data they need from all the groups present in O365.
The script will connect to Azure AD (Active Directory) first and extract details of each group present in the directory.
The admin can change the parameters as per need and decide on what the output will be. The output will be exported in a .CSV file and will be stored in C Drive. You can also change the storage location path and the file name too.
How to Run the “Fetch Office 365 Group Details” script :
Open PowerShell as an Administrator
Write command Connect-AzureAD. Press Enter
Post this step, a login window will pop up in which you need to enter the credentials of the organization for whom you need to pull out the data or report
Once you successfully log in or connect to AzureAD for your respective user or Organization you can get the information about the Account in which you are logged in, environment, Tenant ID etc…
After that, you need to copy and paste the script into PowerShell and press enter.
NOTE: This is when you can choose the location path for the .CSV file. Mentioned below in ScreenShot.
Once the script runs successfully, the .CSV file storage path will automatically show up in PowerShell. Once you hit enter, your chosen file name will be exported to the chosen storage path accordingly.
In this case, we have set C: Drive for file storage and set DATAforBLOG as a file name.
Script Hub -Explore a library of free Powershell Scripts
To find more such useful PowerShell Scripts, head over to Script Hub in our Resources Section.
We keep uploading new blogs quite frequently on our website- keep an eye out for those.
Lastly, if you need help with more such IT Solutions, feel free to reach out to us. We’ll be happy to resolve your queries.