Updated 2 months ago

Top 50 PowerShell Scripts for Microsoft 365 Admins

by Kathy Cooper

6 min read

No Comments

If you have already landed on o365 reports.com, you would know that it has contributed plenty of scripts for various requirements of Microsoft 365 admins. This blog will list the 50+ Microsoft 365 PowerShell scripts that are useful to manage and secure M365 environment efficiently.

We have categorized the scripts as given below.

  1. Office 365 license management
  2. Office 365 user management
  3. Guest and external user management
  4. Group and group membership management
  5. Exchange mailbox management
  6. Exchange Online email auditing
  7. Microsoft Teams & SharePoint Online management
  8. General Office 365 scripts

Note: Most scripts listed here are scheduler friendly. You can schedule them in Windows Task scheduler to run the script as a scheduled task.

Office 365 License Management:

Office 365 licenses are required to access Office 365 services. So, it’s necessary to identify licensed users, license usage, and license expiry date to manage the license efficiently and regain unused license to reduce license cost.

Office 365 User Management:

People in the organization require a user account to access Office 365 services. To identify user activities, inactive users, password status, etc., admins can use the PowerShell scripts given below.

  • Users’ last logon time report– Lists all users and their last login time to identify inactive users.
  • MFA status report– Helps to identify Office 365 users’ MFA status and export the report to CSV file.
  • Real last logon time report– Exports M365 users’ last activity time to identify inactive users accurately in the organization.
  • Password report– Lists all users and their last password change time, password expiry date, etc.
  • Admin report– Exports detailed report on Office 365 admins and their roles.
  • Manager report– Gets Office 365 users and their manager details and helps to identify users without a manager.
  • User logon history– Helps to track Office 365 users’ login activities and identify suspicious behavior.
  • User activity report– Tracks specific user or admin’s activity to identify malicious activities.

Guest and External Users Management:

Guests and external users can access the organization’s resources based on the settings and permission grants. So, admins need to track guests and external users & their activities to protect sensitive data.

Office 365 Group and Group Membership Management:

Different kinds of groups are available in Office 365 for various purposes. Admin can create respective groups based on their need and project nature. Admins can download the PowerShell scripts below to get all groups and their membership details.

Exchange Mailbox Management:

This category contains PowerShell scripts related to Exchange Online mailboxes and their configurations, such as delegation permission, archive status, email forwarding configs, hold status, etc.

Email Audit Reports:

These PowerShell scripts help admins track email activities, such as email traffic, spam & malware emails, email deletions, emails sent by delegates, etc.

SharePoint Online & Microsoft Teams Management:

Microsoft Teams statistics and usage reports can be generated using the below scripts. Also, a few SharePoint Online audit scripts to track anonymous links and file deletions are available in this category.

General Microsoft 365 PowerShell Scripts:

General and Office 365 service connectivity scripts are available in this category.

Get Microsoft 365 Reports in a Few Mouse Clicks:

PowerShell got you confused? tired of manually executing PowerShell scripts? Look no further, try AdminDroid Microsoft 365 reporting tool and see how it helps you in managing your Microsoft 365 environment.

AdminDroid provides 1900+ pre-built reports and 30 smart visually appealing dashboards to know about your Office 365 environment at a glance. This tool provides reports on Office 365 reporting, auditing, analytics, usage statistics, security & compliance, etc.

Each report provides AI-powered graphical analysis to gain insights and better understand the data in a visually appealing manner.

Microsoft 365 Reporting Tool AdminDroid

Mailbox with email forwarding

Additionally, AdminDroid offers 120+ reports and dashboards completely for free. It includes reports on Users, Licenses, Groups, Group Members, Devices, Login Activities, Password Changes, License Changes, and more. The free edition doesn’t have any restrictions in reporting functionalities such as customization, scheduling, and exporting. Download Free Office 365 reporting tool by AdminDroid and see how it helps for you.

I hope this blog will be helpful in generating Microsoft 365 reports.

Share article