Microsoft Scripting Hub

Automate Everything
with MS Scripts

Your interactive guide to PowerShell, Office Scripts, Azure CLI, and SharePoint automation. Learn, explore, and run scripts — all in one place.

PowerShell Azure CLI Office Scripts Graph API SharePoint PnP Exchange Online Teams Admin Entra ID Intune Defender PowerShell Azure CLI Office Scripts Graph API SharePoint PnP Exchange Online Teams Admin Entra ID Intune Defender
0
Script Templates
0
MS Services Covered
0
Cmdlet Categories
0
Community Users
Script Playground
Select a script category and hit Run to see the output simulation. Explore real-world PowerShell patterns.

      
PS C:\> Select a script and click Run...
Script Collection
Production-ready scripts for everyday Microsoft 365 administration tasks.

Bulk User Creation

Import users from CSV, assign licenses, configure MFA, and send welcome emails — all in one script.

PowerShellEntra IDBulk

Shared Mailbox Rules

Automate inbox rules for shared mailboxes, including auto-categorize, forwarding, and folder routing.

ExchangeMailbox

Azure Resource Cleanup

Scan for unused Azure resources, generate cost reports, and safely remove orphaned assets.

Azure CLICost Mgmt

Site Provisioning

Deploy SharePoint sites with custom templates, navigation, columns, and permission inheritance.

SharePointPnP

License Audit Report

Generate detailed M365 license usage reports across all users, including unassigned and expired licenses.

PowerShellReporting

Excel Office Scripts

Automate repetitive Excel tasks — format tables, pivot data, merge workbooks with TypeScript-based Office Scripts.

Office ScriptsExcel

Teams Governance

Enforce naming policies, manage guest access, archive stale teams, and audit channel permissions.

TeamsGovernance

Graph API Reports

Pull sign-in logs, usage analytics, and security alerts using Microsoft Graph with automated scheduling.

Graph APISecurity
Scripting Tools at a Glance
Choose the right tool for your automation needs.
Feature PowerShell Azure CLI Office Scripts Graph API
M365 User Management
Excel Automation
Azure Resources
SharePoint Sites
Power Automate Integration
Cross-Platform
No-Code Friendly
Batch/Bulk Operations
PowerShell Cheatsheet
Essential cmdlets for Microsoft 365 administration.
Connect-MgGraph
Authenticate to Microsoft Graph
Get-MgUser -All
List all Entra ID users
New-MgUser
Create a new user account
Get-Mailbox -ResultSize Unlimited
Get all Exchange mailboxes
Set-MgUserLicense
Assign or remove user licenses
Get-SPOSite -Limit All
Retrieve all SharePoint sites
Get-Team
List all Microsoft Teams
Export-Csv -Path
Export results to CSV report
Invoke-MgGraphRequest
Make raw Graph API calls
Get-MgAuditLogSignIn
Pull sign-in audit logs
Connect-ExchangeOnline
Connect to Exchange Online PS
Get-MgGroup -All
List all security & M365 groups
Frequently Asked
Common questions about Microsoft scripting and automation.
What's the difference between PowerShell and Azure CLI?+
PowerShell is a comprehensive task automation framework with a full scripting language (.ps1), object-oriented pipeline, and deep integration with the .NET ecosystem. Azure CLI is a cross-platform command-line tool specifically designed for managing Azure resources, using a simpler command syntax (az resource group create). Use PowerShell for complex automation with conditionals and loops; use Azure CLI for quick Azure tasks.
How do Office Scripts differ from VBA macros?+
Office Scripts use TypeScript and run in Excel on the web, Windows, and Mac. They're cloud-native, easily shareable, and integrate with Power Automate. VBA macros are desktop-only, run locally, and use Visual Basic. Office Scripts are the modern replacement — safer, more portable, and designed for collaboration.
Which PowerShell modules do I need for M365?+
The key modules are: Microsoft.Graph (unified Graph access), ExchangeOnlineManagement (mailboxes & transport rules), Microsoft.Online.SharePoint.PowerShell (SharePoint admin), MicrosoftTeams (Teams management), and Az (Azure resources). Install them via Install-Module from the PowerShell Gallery.
Can I schedule scripts to run automatically?+
Yes. Use Windows Task Scheduler for on-premises scripts, Azure Automation runbooks for cloud-hosted PowerShell, or Power Automate flows combined with Office Scripts for Excel automation. Azure Functions also support timer triggers for lightweight scheduled tasks.
Is Microsoft Graph replacing individual service modules?+
Yes, Microsoft is consolidating access through the Microsoft Graph API and the Microsoft.Graph PowerShell SDK. While individual modules (like AzureAD and MSOnline) are being deprecated, Exchange Online and SharePoint modules will continue in parallel for now. The recommended approach is to use Graph wherever possible.