This is a sample script that exports license status information of Microsoft 365 users.
Перейти к файлу
Ryutaro Koma 0a3f5488a9
Merge pull request #4 from microsoft/users/GitHubPolicyService/d410b62a-b804-40b1-b655-378349514c11
Adding Microsoft SECURITY.MD
2022-09-01 10:14:42 +09:00
ja-jp v2.0 2021-11-04 22:35:05 +09:00
.gitignore Initial commit 2018-05-21 01:48:46 -07:00
Export-Microsoft365LicenseStatus.ps1 v2.0 2021-11-04 22:35:05 +09:00
Export-Office365LicenseStatus.ps1 v1.0 2018-05-25 19:15:57 +09:00
LICENSE Initial commit 2018-05-21 01:48:49 -07:00
README.md v2.0 2021-11-04 22:35:05 +09:00
README_v1.md Update README_v1.md 2021-11-04 22:43:23 +09:00
SECURITY.md Microsoft mandatory file 2022-08-30 09:37:13 +00:00

README.md

Export-Microsoft365LicenseStatus

日本語版 README はこちら

You can export license status information of Microsoft 365 users.

If you are looking for Export-Office365LicenseStatus (MSOL version), please see here

Download option

Download Export-Microsoft365LicenseStatus from Releases page.

Prerequisites

  • This script supports only PowerShell 7.

  • You have to install the Microsoft Graph PowerShell SDK on your computer. Please refer to this page for more information.

  • You need to have at least 'User.Read.All' and 'Organization.Read.All' permissions to use this script. If you want to use the delegated permissions to connect to Microsoft Graph, run the following command before running this script. You can also use the application permissions if you want.

    Connect-MgGraph -Scopes "Organization.Read.All","User.ReadWrite.All"
    

Usage

  1. Download Export-Microsoft365LicenseStatus and save on your computer.

  2. Start PowerShell and go to the folder where you saved the file.

  3. If you want to export all users' information, run the following command.

    .\Export-Microsoft365LicenseStatus.ps1 -All
    
  4. If you want to export all users' information to a CSV file, run the following command.

    .\Export-Microsoft365LicenseStatus.ps1 -All | Export-Csv c:\Temp\LicenseReport.csv
    
  5. If you want to export the specific user's information, run the following command.

    .\Export-Microsoft365LicenseStatus.ps1 -UserPrincipalName user01@contoso.onmicrosoft.com
    
  6. If you want to export the specific user's information to a CSV file, run the following command.

    .\Export-Microsoft365LicenseStatus.ps1 -UserPrincipalName user01@contoso.onmicrosoft.com | Export-Csv c:\Temp\LicenseReport.csv
    

Feedback

If you have any feedback, please post on the Issues list.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.