This repository contains PowerShell scripts and sample data for setting up Microsoft 365 hands-on lab environments.
├── Scripts/
│ ├── AI/ # AI and Azure Cognitive Search setup scripts
│ ├── ConditionalAccess/ # Conditional Access policy scripts
│ ├── Intune/ # Microsoft Intune configuration scripts
│ ├── Lab-Setup/ # General lab setup and configuration scripts
│ ├── UserManagement/ # User and object import/management scripts
│ └── Vendor/ # Third-party vendor scripts (Datto, Huntress, etc.)
├── SampleData/ # Sample CSV files for demos and testing
│ └── UserThumbnails/ # User profile pictures (23 images) corresponding to sample users
├── Reports/ # Generated reports and documentation
├── upload-users.ps1 # Legacy user upload script (see UserManagement folder for organized version)
└── README.md # This file
Import_m365bUsers.ps1
- Imports demo users into M365 tenants from CSVImport_m365bObjects.ps1
- Imports users, groups, and contacts into on-premises AD
AssignM365Licenses.ps1
- Automates license assignment for demo userscreate_teams_newtenant.ps1
- Sets up Teams for new tenant demoscreate_w365.ps1
- Configures Windows 365 Cloud PC environments
Baseline-ConditionalAccessPolicies.ps1
- Creates recommended baseline CA policiessetup-intune.ps1
- Imports baseline Intune configurations for compliance and device management
auth_init.ps1
- Initializes Azure authentication for AI servicesauth_update.ps1
- Updates Azure authentication credentialsloadenv.ps1
- Loads environment variables from Azure Developer CLIprepdocs.ps1
- Prepares documents for AI processing
- PowerShell 5.1 or PowerShell 7+
- Microsoft Graph PowerShell modules
- Azure AD PowerShell module (for legacy scripts)
- Appropriate admin permissions in target M365 tenants
-
For User Import:
# Edit the CSV file with your demo users # Run the import script .\Scripts\UserManagement\Import_m365bUsers.ps1
-
For Lab Setup:
# Connect to your M365 tenant first Connect-MgGraph -Scopes "Directory.ReadWrite.All" # Run desired setup scripts .\Scripts\Lab-Setup\AssignM365Licenses.ps1
The SampleData/
folder contains CSV files and supporting assets for demos:
m365bUsers.csv
- Sample users with various departments and rolesUserThumbnails/
- Profile pictures for sample users (23 images)- Images correspond to users in the CSV files (e.g., AlexW.jpg for Alex Wilber)
- Standard JPG format, suitable for M365 profile picture uploads
- Security: Never commit actual tenant IDs, API keys, or other sensitive information
- Testing: Always test scripts in a demo/dev tenant before production use
- Permissions: Ensure you have appropriate admin rights before running scripts
- Backup: Consider backing up existing configurations before making changes
When contributing new scripts:
- Follow PowerShell best practices
- Include parameter validation and error handling
- Add comprehensive comments and help documentation
- Test thoroughly in isolated environments
- Remove any sensitive information before committing
These scripts are provided as-is for educational and demonstration purposes.
Last updated: October 2025