A collection of scripts and files that I use as part of my role as a Copilot Solution Engineer.
Many scripts in this toolbox use environment variables for configuration. These variables can be set using a .env file in the root directory of the repository.
-
Copy the
.env-examplefile to create your own.envfile:Copy-Item .env-example .env
-
Edit the
.envfile and replace the placeholder values with your actual configuration:# Multiple Scripts TENANT_ID=your-tenant-id-guid # Compliance scripts UPN=admin@yourtenant.onmicrosoft.com # Blob storage scripts STORAGE_ACCOUNT_NAME=yourstorageaccount RESOURCE_GROUP_NAME=your-resource-group CONTAINER_NAME=yourcontainer # And so on... -
The
Menu.ps1script will automatically load these variables when executed.
The .env-example file includes configuration for:
- Multiple Scripts:
TENANT_ID - Compliance Scripts:
UPN - Blob Storage Scripts:
STORAGE_ACCOUNT_NAME,RESOURCE_GROUP_NAME,CONTAINER_NAME - Database Scripts:
SQL_SERVER_NAME,SQL_RESOURCE_GROUP_NAME - Fabric Scripts:
FABRIC_RESOURCE_GROUP_NAME,FABRIC_NAME - Power Platform Scripts:
POWER_PLAT_CLIENT_ID,POWER_PLAT_CLIENT_SECRET,POWER_PLAT_TENANT_DOMAIN,POWER_PLAT_ORG_URL - Azure VM Scripts:
AZURE_SUBSCRIPTION_ID,AZURE_VM_RESOURCE_GROUP_NAME - SharePoint Online Scripts:
SHAREPOINT_ONLINE_CLIENT_ID,SHAREPOINT_ONLINE_CERTIFICATE_PATH,SHAREPOINT_ONLINE_CERTIFICATE_PASSWORD,SHAREPOINT_ONLINE_SITE_ID,SHAREPOINT_ONLINE_DRIVE_ID,SHAREPOINT_ONLINE_FOLDER_PATH,SHAREPOINT_ONLINE_ADMIN_URL,SHAREPOINT_ONLINE_SITE,SHAREPOINT_ONLINE_TENANT_DOMAIN,SHAREPOINT_ONLINE_LIBRARY - Salesforce Scripts:
SF_AUTH_METHOD,SF_MY_DOMAIN,SF_API_BATCH_SIZE,SF_OUTPUT_DIR,SF_CLIENT_ID,SF_CLIENT_SECRET,SF_USERNAME,SF_PASSWORD,SF_SECURITY_TOKEN
Note: The
.envfile is included in.gitignoreto prevent accidentally committing sensitive credentials to version control.
Provides a reusable Import-DotEnv function that loads environment variables from a .env file into the current PowerShell process. Used by other scripts in the toolbox to load configuration without hard-coding credentials.
# Dot-source the function and load variables from .env in the current directory
. .\Import-DotEnv.ps1
Import-DotEnv
# Load from a specific path
Import-DotEnv -Path "C:\MyProject\.env"Central configuration file that sets up environment variables and common configuration used by multiple scripts. Includes functionality to load settings from a .env file.
# Load the configuration file
. .\Menu.ps1
# Environment variables will be loaded from .env file if present
# Variables include: UPN, TENANT_ID, STORAGE_ACCOUNT_NAME, etc.Python script invoked by the pre-commit hook to strip all cell outputs and execution counts from staged Jupyter notebooks before they are committed. Prevents binary output data and tokens from being stored in version control.
One-time setup script that copies the pre-commit hook from the repo root into .git/hooks/. Run this after cloning the repository to activate automatic notebook output stripping on commit.
# Run once after cloning
.\install-hooks.ps1Git pre-commit hook (shell script) kept in version control so it can be shared across clones. Calls clear_notebook_outputs.py against all staged .ipynb files and re-stages the cleaned files automatically. Install it with install-hooks.ps1.
Retrieves all Azure App Registrations and displays their names and App IDs.
# Run the script directly - it handles authentication and retrieval
.\Azure\Get-AzureAppRegistrations.ps1Queries Azure Resource Graph to inventory agent-related resources across one or more subscriptions, including Bot Services, Azure AI/Cognitive Services accounts, Health Bots, and Machine Learning workspaces. Supports filtering by resource type and optional CSV export.
# Query all supported agent resources in the current Azure context
Get-AzureAgentInventory
# Export only Azure AI/Cognitive Services resources to CSV
Get-AzureAgentInventory -ResourceType CognitiveServices `
-OutputPath "C:\temp\azure-agent-inventory.csv"Retrieves information about files stored in Azure Blob Storage containers.
# Set your Azure storage parameters
$storageAccountName = "yourstorageaccount"
$containerName = "yourcontainer"
# Run the script
.\Azure\Get-AzureBlobFiles.ps1Retrieves cost reports for Azure resource groups for a specified date range using Azure Cost Management API. Allows selection of resource groups and provides detailed cost breakdown by resource type.
# Get cost reports for the last 7 days with resource group selection prompt
Get-AzureCostReportsByResourceGroups
# Get cost reports for a specific date range
Get-AzureCostReportsByResourceGroups -StartDate "2025-12-01" -EndDate "2025-12-17"
# Specify subscription and output directory
Get-AzureCostReportsByResourceGroups -SubscriptionId "your-subscription-id" `
-OutputDirectory "C:\temp\CostReports"Retrieves members of an Entra ID (Azure AD) group by name or email. Displays users, groups, and service principals with categorized output.
# Get members of a group by display name
.\Azure\Get-EntraGroupMembers.ps1 -GroupNameOrEmail "Marketing Team"
# Get members of a group by email
.\Azure\Get-EntraGroupMembers.ps1 -GroupNameOrEmail "marketing@contoso.com"Configures network access rules for Azure Blob Storage accounts. Enables or disables public access and manages IP firewall rules.
# Enable network restrictions and add current IP
Set-AzureBlobStorageAccess -ResourceGroupName "myResourceGroup" `
-StorageAccountName "mystorageaccount" `
-Enable
# Disable network restrictions
Set-AzureBlobStorageAccess -ResourceGroupName "myResourceGroup" `
-StorageAccountName "mystorageaccount"Configures Azure Key Vault public network access and firewall rules. Supports disabling public access entirely, allowing all networks, or restricting access to selected IP ranges including the caller's current public IP.
# Restrict Key Vault access to selected networks and add your current public IP
Set-AzureKeyVaultNetworkAccess -ResourceGroupName "myResourceGroup" `
-KeyVaultName "myKeyVault" `
-Enable `
-AddCurrentIP
# Disable all public network access
Set-AzureKeyVaultNetworkAccess -ResourceGroupName "myResourceGroup" `
-KeyVaultName "myKeyVault" `
-DisableConfigures Azure SQL Server access settings and firewall rules.
# Configure SQL Server access
Set-AzureSQLServerAccess -ServerName "yoursqlserver" `
-ResourceGroupName "your-resource-group"Manages the state (start/stop) of Microsoft Fabric capacities in Azure.
# Set your Fabric capacity parameters
$subscriptionId = "your-subscription-id"
$resourceGroupName = "your-resource-group"
$capacityName = "your-fabric-capacity"
$state = "Active" # or "Paused"
# Run the script
.\Azure\Set-FabricCapacityState.ps1
Set-FabricCapacityState -ResourceGroupName $resourceGroupName `
-FabricName $fabricName `
-State "Active"Starts Azure Virtual Machines across resource groups.
# Run the script
.\Azure\Start-AzureVMs.ps1
Start-AzureVMs -ResourceGroupName "<your resource group>" `
-SubscriptionId "<your subscription id>"
Stops Azure Virtual Machines across resource groups.
# Stop VMs in a resource group
Stop-AzureVMs -ResourceGroupName "<your resource group>" `
-SubscriptionId "<your subscription id>"Requests Just-In-Time (JIT) VM access for all VMs defined in a resource group's JIT network access policy. Automatically detects the caller's current public IP as the allowed source address. Requires the Az.Security module.
# Request JIT access for all VMs in a resource group (auto-detects public IP)
Request-AzVMJitAccess -ResourceGroupName "rg-sharepoint-farm"
# Specify subscription, duration, and source IP explicitly
Request-AzVMJitAccess -ResourceGroupName "rg-sharepoint-farm" `
-SubscriptionId "your-subscription-id" `
-DurationHours 2 `
-SourceAddressPrefix "203.0.113.10"A Swagger 2.0/OpenAPI definition file for the Azure Maps Render API. This file describes the API endpoints for generating static map images with customizable pins, paths, and styling. Can be used to create a custom Power Platform connector to the Azure Maps API.
Import this file into Power Platform to create a custom connector, or use a Swagger UI viewer to visualize and interact with the API.
A Jupyter Notebook demonstrating how to authenticate with Azure and call the Azure Maps Render API to generate static map images. Works in conjunction with the azure-maps-render-api.swagger.yaml definition file.
Open the notebook in VS Code and run cells sequentially. Ensure your .env file contains the required Azure Maps credentials.
Retrieves all retention policies and their associated rules from Microsoft 365 Compliance Center.
# Set your parameters
$upn = "admin@yourdomain.com"
# Run the script
.\Compliance\Get-AllRetentionPoliciesAndRules.ps1Searches the unified audit log and retrieves results for specified date ranges.
# Set your parameters
$startDate = "2025-06-01"
$endDate = "2025-06-24"
# Run the script
.\Compliance\Get-AuditLogResults.ps1Creates a compliance content search in Microsoft 365, waits for it to complete, then exports the results. Supports searching specific mailboxes or all mailboxes using a KQL query. Monitors both the search and export operations until completion.
# Search a specific mailbox for emails with "confidential" in the subject
New-ContentSearch -SearchName "Investigation001" `
-Query "subject:confidential" `
-Mailbox "user@contoso.com"
# Search all mailboxes for Q4 2025 content
New-ContentSearch -SearchName "Q4Search" `
-Query "date>=2025-10-01" `
-Mailbox "All" `
-UserPrincipalName "admin@contoso.com"Retrieves audit log entries for Copilot bot creation events.
# Set your parameters
$upn = "admin@yourdomain.com"
$startDate = "2025-06-01"
$endDate = "2025-06-24"
# Run the script
.\Copilot\Get-CopilotCreationAuditLogItems.ps1Retrieves audit log entries for Copilot interaction events.
# Run the script with parameters
.\Copilot\Get-CopilotInteractionAuditLogItems.ps1 -StartDate '2025-06-01' `
-EndDate '2025-06-30' `
-UserPrincipalName 'admin@yourdomain.com' `
-OutputFile 'c:\temp\copilotinteractionauditlog.csv' `
-AppendA Jupyter Notebook for interacting with a Copilot retrieval API.
Open the notebook in a compatible environment like VS Code to see the documented steps for API interaction.
A Swagger/OpenAPI definition file for a Copilot retrieval API. This file describes the API endpoints, parameters, and responses & can be used to create a custom Power Platform connector to this API.
Use a Swagger UI viewer to visualize and interact with the API defined in this file.
A Jupyter Notebook for retrieving Microsoft 365 Copilot usage reports via Microsoft Graph API using application permissions. Demonstrates authentication with client credentials and accessing Reports.Read.All API endpoints.
Open the notebook in VS Code or Jupyter. Ensure your .env file contains:
CopilotReportAPIPythonClient_IdCopilotReportAPIPythonClient_SecretCopilotAPIPythonClient_Tenant
Grant Reports.Read.All application permission in your Entra App Registration.
A Jupyter Notebook for retrieving Microsoft Teams meeting insights and transcripts using Microsoft Graph API with delegated user permissions. Demonstrates how to access meeting transcripts and AI-generated insights.
Open the notebook in VS Code or Jupyter. Configure your Entra App Registration with delegated permissions:
User.ReadCalendars.ReadOnlineMeetings.ReadOnlineMeetingTranscript.Read.AllOnlineMeetingAiInsight.Read.All
Enable public client flow in your App Registration authentication settings.
A Jupyter Notebook for listing Copilot packages available in the tenant catalog via the Microsoft Graph beta API (/copilot/admin/catalog/packages). Supports optional OData $filter parameters to filter by supported host, element type, or last modified date. Displays results as both raw JSON and a formatted summary table.
Open the notebook in VS Code. Ensure your .env file contains:
CopilotAPIPythonClient_IdCopilotAPIPythonClient_Tenant
Grant CopilotPackages.ReadWrite.All delegated permission (with admin consent) in your Entra App Registration. Enable public client flow in your App Registration authentication settings.
Retrieves audit log entries for Copilot sharing events and activities.
# Set your parameters
$upn = "admin@yourdomain.com"
$startDate = "2025-06-01"
$endDate = "2025-06-24"
# Run the script
.\Copilot\Get-CopilotSharingAuditLogItems.ps1 -StartDate $startDate `
-EndDate $endDate `
-UserPrincipalName $upn `
-OutputFile 'c:\temp\copilotsharingauditlog.csv'Retrieves detailed information about an Entra ID user.
# Set the user UPN
$upn = "user@yourdomain.com"
# Run the script
.\Entra\Get-EntraUserInfo.ps1Gets license information for Entra ID users.
# Set the user UPN
$upn = "user@yourdomain.com"
# Run the script
.\Entra\Get-EntraUserLicenseInfo.ps1Creates a self-signed certificate for Entra (Azure AD) app registration authentication. Generates both PFX (with private key) and CER (public key) files with configurable validity period. Optionally installs the certificate to CurrentUser or LocalMachine certificate store.
# Create certificate with default settings (exports to C:\temp)
.\Entra\New-EntraAppCertificate.ps1
# Create certificate for specific app and install to CurrentUser store
.\Entra\New-EntraAppCertificate.ps1 -SubjectName "CN=SharePoint Scripts" -InstallToStore
# Create certificate with custom validity and install to LocalMachine (requires admin)
.\Entra\New-EntraAppCertificate.ps1 -SubjectName "CN=MyApp" `
-ValidityYears 3 `
-InstallToStore `
-StoreLocation LocalMachine
# Specify custom export location and certificate name
.\Entra\New-EntraAppCertificate.ps1 -SubjectName "CN=MyApp" `
-ExportPath "C:\Certificates" `
-CertificateName "MyAppCert"Updates the User Principal Name (UPN) for Azure AD users.
# Set the old and new UPN values
Update-AADUserUPN -originalUpn "user@olddomain.com" `
-newUpn "user@newdomain.com" `
-applyChanges `
-logFolder 'c:\temp\upnupdatelog.csv'Analyzes system performance metrics and provides detailed performance insights.
# Run the script to analyze system performance
.\Misc\Get-SystemPerformanceAnalysis.ps1Inventories all PowerShell modules installed via PowerShellGet/PSGallery, checks for available updates, and optionally applies them. Displays a formatted report showing installed vs. latest versions and a summary of update status. Untrusted repository prompts are automatically suppressed since the user is making an explicit approval decision within the script itself.
When run interactively, each outdated module presents a streamlined prompt:
- Y — update this module, continue prompting for remaining modules
- A — update this module and all remaining modules without further prompting
- N — skip this module
- Q — quit the update loop
# Show inventory and prompt before updating each outdated module (Y/A/N/Q per module)
.\Misc\Update-InstalledModules.ps1
# Display inventory report only — no changes made
.\Misc\Update-InstalledModules.ps1 -InventoryOnly
# Automatically update all outdated modules without prompting
.\Misc\Update-InstalledModules.ps1 -UpdateAll
# Update all modules in the AllUsers scope, excluding specific modules
.\Misc\Update-InstalledModules.ps1 -UpdateAll -Scope AllUsers -ExcludeModules @('Az', 'AzureAD')
# Dry-run to see what would be updated without applying changes
.\Misc\Update-InstalledModules.ps1 -UpdateAll -WhatIfImports .rdp files from a source folder into an existing Remote Desktop Connection Manager (RDCMan) .rdg file, creating or updating server entries under a dedicated group. Reads usernames and domain information from each .rdp file and writes them into the RDCMan logonCredentials element. Configured via .env variables: RDCMAN_SOURCE_PATH, RDCMAN_DESTINATION_PATH, RDCMAN_RDG_FILENAME, RDCMAN_GROUP_NAME.
# Import .rdp files using .env defaults
.\Misc\Update-RDCManFile.ps1
# Preview changes without writing to the .rdg file
.\Misc\Update-RDCManFile.ps1 -WhatIf
# Specify paths explicitly
.\Misc\Update-RDCManFile.ps1 -SourcePath "C:\RDPFiles" `
-DestinationPath "C:\Users\you\Documents" `
-RdgFileName "mylab.rdg" `
-GroupName "Lab Servers"A Jupyter Notebook that reads a CSV file and generates an individual Word document for each row. Column names become section headings, and the configured title column is used to name each output file.
Open the notebook in VS Code, update CSV_FILE_PATH, OUTPUT_DIR, and TITLE_COLUMN, then run all cells to generate the Word documents.
A streamlined version of the CSV-to-Word workflow for quickly converting structured CSV data into one Word document per record.
Open the notebook in VS Code, update the input CSV and output folder paths, and run the cells in order.
A Jupyter Notebook for extracting calendar event details from PST files for meeting analysis. Includes a Windows-friendly pywin32 approach and guidance for using readpst when needed.
Open the notebook in VS Code, update the PST file path and export settings, then run the cells sequentially to extract and analyze calendar events.
Retrieves online meeting recordings for a specific user within a date range using Microsoft Graph.
# Set your parameters
$clientId = "your-app-registration-id"
$tenantId = "your-tenant-id"
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where-Object {$_.Subject -like "*YourCertName*"}
$meetingOrganizerUserId = "user@yourdomain.com"
# Run the script
.\MsGraph\Get-OnlineMeetingRecordings.ps1Generates comprehensive Microsoft 365 usage and activity reports using Microsoft Graph.
# Set your reporting parameters
$tenantId = "your-tenant-id"
$clientId = "your-app-registration-id"
# Run the script
.\MsGraph\M365Reporting.ps1Adds an application user to Power Platform environment(s) using the Power Platform CLI. Supports adding to a single environment or all environments in a tenant with a specified security role. Requires Power Platform CLI (pac) to be installed.
# Add app user to a specific environment
.\Power-Platform\Add-AppUserViaCLI.ps1 -AppId "12345678-1234-1234-1234-123456789012" `
-OrgUrl "https://org.crm.dynamics.com"
# Add app user to ALL environments in the tenant
.\Power-Platform\Add-AppUserViaCLI.ps1 -AppId "12345678-1234-1234-1234-123456789012" `
-AllEnvironments
# Use custom role and skip authentication
.\Power-Platform\Add-AppUserViaCLI.ps1 -AppId "12345678-1234-1234-1234-123456789012" `
-OrgUrl "https://org.crm.dynamics.com" `
-Role "Basic User" `
-SkipAuthConverts conversation transcript data from Power Platform to human-readable format, reconstructing chronological conversations between users and bots.
# Convert transcript data to readable format
.\Power-Platform\ConvertFrom-AgentTranscript.ps1 -InputFile "C:\temp\conversationtranscripts.txt" `
-OutputFile "C:\temp\readable_transcripts.txt"Runs a diagnostic workflow for Copilot Studio custom agent and Microsoft Defender for Cloud Apps integration issues. Checks the app registration, service principal state, admin consent, conditional access impact, and recent sign-in activity, then writes the results to a diagnostic log file.
# Run the diagnostic for a specific tenant and app registration
.\Power-Platform\Diagnose-CopilotStudioMDCA.ps1 -AppRegistrationId "12345678-1234-1234-1234-123456789012" `
-TenantId "your-tenant-id" `
-OutputPath "C:\temp\DiagnosticOutput.txt"Retrieves Copilot Studio message consumption for Power Platform environments over a reporting period using the Licensing API. Useful for reviewing billed and non-billed credits by environment and feature.
# Load the script and review the collected consumption data
. .\Power-Platform\Get-AgentMessageConsumptionReport.ps1
# Export the results if needed
$consumption | Export-Csv -Path "C:\temp\agent-message-consumption.csv" -NoTypeInformationRetrieves information about all data policy connectors in the Power Platform tenant.
# Run the script directly - it handles authentication and data retrieval
Get-AllDataPolicyConnectorInfo | Export-Csv -Path "C:\temp\PowerPlatformDataPolicyConnectors.csv" -NoTypeInformation -ForceRetrieves all billing policies for a Power Platform tenant via the Power Platform Licensing REST API. Handles pagination automatically.
# Get all billing policies
Get-BillingPlansViaAPI -ClientId "your-client-id" `
-ClientSecret "your-secret" `
-TenantDomain "contoso.onmicrosoft.com"
# Limit results per page
Get-BillingPlansViaAPI -ClientId "your-client-id" `
-ClientSecret "your-secret" `
-TenantDomain "contoso.onmicrosoft.com" `
-Top 10Gets bot components information using Power Platform APIs.
# Set your environment parameters
$clientId="<your client id>"
$clientSecret="<your client secret>"
$orgUrl="<your org>.crm.dynamics.com"
$tenantDomain="<your tenant domain>.onmicrosoft.com"
# Run the script
Get-BotComponentsViaAPI -ClientId $clientId `
-ClientSecret $clientSecret `
-OrgUrl $orgUrl `
-TenantDomain $tenantDomain `
-FieldList $fieldListRetrieves conversation transcripts from Power Platform bots via API within a specified date range.
# Set your environment parameters
$clientId = "<your client id>"
$clientSecret = "<your client secret>"
$orgUrl = "<your org>.crm.dynamics.com"
$tenantDomain = "<your tenant domain>.onmicrosoft.com"
$endDate = (Get-Date).ToString("yyyy-MM-dd")
$startDate = (Get-Date).AddDays(-30).ToString("yyyy-MM-dd")
# Run the script
Get-ConversationTranscriptsViaAPI -ClientId $clientId `
-ClientSecret $clientSecret `
-OrgUrl $orgUrl `
-TenantDomain $tenantDomain `
-StartDate $startDate `
-EndDate $endDate `
-FieldList "content,createdon,conversationtranscriptid,_bot_conversationtranscriptid_value,metadata" `
| Export-Csv -Path "C:\temp\conversation-transcripts.csv" -NoTypeInformationRetrieves Copilot agents information via Power Platform APIs.
# Run the script
Get-CopilotAgentsViaAPI -ClientId "<your client id>" `
-ClientSecret "<your client secret>" `
-OrgUrl "<your org>.crm.dynamics.com" `
-TenantDomain "<your domain>.onmicrosoft.com" `
-FieldList "botid,componentidunique,applicationmanifestinformation,name,configuration,createdon,publishedon,_ownerid_value,_createdby_value,solutionid,modifiedon,_owninguser_value,schemaname,_modifiedby_value,_publishedby_value,authenticationmode,synchronizationstatus,ismanaged" `
| Out-File "c:\temp\bots.txt"Retrieves a comprehensive list of all Copilot agents and their components from all Power Platform environments.
# Run the script to get all copilots and components
.\Power-Platform\Get-CopilotsAndComponentsFromAllEnvironments.ps1 | Export-Csv -Path "C:\temp\AllCopilotsAndComponents.csv" -NoTypeInformationRetrieves all Power Apps and their connections within the tenant.
# Run the script to get all Power Apps and their connections
.\Power-Platform\Get-PowerAppsAndConnections.ps1 | Export-Csv -Path "C:\temp\PowerAppsAndConnections.csv" -NoTypeInformationRetrieves detailed information about all Power Platform environments.
# Run the script to get environment information
.\Power-Platform\Get-PowerPlatformEnvironmentInfo.ps1 | Export-Csv -Path "C:\temp\PowerPlatformEnvironments.csv" -NoTypeInformationGenerates usage reports for Power Platform services.
# Run the script to generate usage reports
.\Power-Platform\Get-PowerPlatformUsageReports.ps1 -ReportType "ActiveUsers" -OutputDirectory "C:\temp\UsageReports"Retrieves tenant-level settings for Power Platform via API.
# Set your environment parameters
$clientId = "<your client id>"
$clientSecret = "<your client secret>"
$tenantDomain = "<your tenant domain>.onmicrosoft.com"
# Run the script
.\Power-Platform\Get-PowerPlatTenantSettingsViaAPI.ps1 -ClientId $clientId -ClientSecret $clientSecret -TenantDomain $tenantDomainRetrieves users from a Power Platform environment via API.
# Set your environment parameters
$clientId = "<your client id>"
$clientSecret = "<your client secret>"
$orgUrl = "<your org>.crm.dynamics.com"
$tenantDomain = "<your tenant domain>.onmicrosoft.com"
# Run the script
.\Power-Platform\Get-UsersViaAPI.ps1 -ClientId $clientId -ClientSecret $clientSecret -OrgUrl $orgUrl -TenantDomain $tenantDomainChanges the owner of a Power App in a Power Platform environment. Automatically installs required Power Apps administration modules if not present.
.\Power-Platform\Set-NewPowerAppOwner.ps1 -AppName "cd304785-1a9b-44c3-91a8-c4174b59d835" `
-EnvironmentName "de6b35af-dd3f-e14d-80ff-7a702c009100" `
-AppOwner "7eda74de-bd8b-ef11-ac21-000d3a5a9ee8"Creates an inventory of SharePoint on-premises farm components and configuration.
# Set your SharePoint farm parameters
Inventory-SPFarm `
-LogFilePrefix "Test_" `
-DestinationFolder "d:\temp" `
-InventoryFarmSolutions `
-InventoryFarmFeatures `
-InventoryWebTemplates `
-InventoryTimerJobs `
-InventoryWebApplications `
-InventorySiteCollections `
-InventorySiteCollectionAdmins `
-InventorySiteCollectionFeatures `
-InventoryWebPermissions `
-InventoryWebs `
-InventorySiteContentTypes `
-InventoryWebFeatures `
-InventoryLists `
-InventoryWebWorkflowAssociations `
-InventoryListContentTypes `
-InventoryListWorkflowAssociations `
-InventoryContentTypeWorkflowAssociations `
-InventoryContentDatabases `
-InventoryListFields `
-InventoryListViews `
-InventoryWebParts
A Jupyter Notebook lab for configuring Snowflake OAuth with Azure/Entra ID. It automates most of the setup work, including app registration creation or reuse, app role assignment, token generation, Snowflake SQL generation, and optional direct execution when admin credentials are provided.
Open the notebook in VS Code and run the cells sequentially. Sign in first with az login, and optionally populate .env with SNOWFLAKE_ACCOUNT, SNOWFLAKE_ADMIN_USER, and SNOWFLAKE_ADMIN_PASSWORD if you want the generated SQL to be applied directly in Snowflake.
SQL query that converts a table schema to JSON format, useful for documentation and schema analysis. Can be used in agent instructions to tell the agent how the tables are structured.
Adds users as owners to a SharePoint site using certificate-based authentication.
# Set your parameters
$siteUrl = "https://contoso.sharepoint.com/sites/yoursite"
$ownerEmails = @("user1@contoso.com", "user2@contoso.com")
$clientId = "your-app-registration-id"
$tenant = "contoso.onmicrosoft.com"
$certificatePath = "C:\path\to\certificate.pfx"
# Run the function
Add-OwnersToSharePointSite -SiteUrl $siteUrl `
-OwnerEmails $ownerEmails `
-ClientId $clientId `
-Tenant $tenant `
-CertificatePath $certificatePathConverts SharePoint Site ID, Web ID, and List ID GUIDs into the base64-encoded Drive ID format used by the Microsoft Graph API. Useful for constructing Graph API calls that reference SharePoint document libraries.
# Convert GUIDs to a Graph API Drive ID
ConvertTo-SharePointDriveId `
-siteId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
-webId "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy" `
-listId "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz"Returns the Microsoft Graph Drive ID for one or all document libraries in a SharePoint site. Useful when you need the drive identifier for Graph API calls or automation.
# Get all document library Drive IDs for a SharePoint site
.\SharePoint-Online\Get-SharePointDriveId.ps1 -SharePointUrl "https://contoso.sharepoint.com/sites/MySite"
# Get the Drive ID for a specific library
.\SharePoint-Online\Get-SharePointDriveId.ps1 -SharePointUrl "https://contoso.sharepoint.com/sites/MySite" `
-LibraryName "Documents"Inventories SharePoint Embedded containers across the tenant, including storage, owners, status, and owning application metadata. Supports optional CSV export for reporting.
# Review all SharePoint Embedded containers in the tenant
Get-SPOEmbeddedInventory -SPOAdminUrl "https://contoso-admin.sharepoint.com"
# Export the inventory to CSV
Get-SPOEmbeddedInventory -SPOAdminUrl "https://contoso-admin.sharepoint.com" `
-OutputPath "C:\temp\spe-inventory.csv"Generates reports on Copilot agent usage and activities in SharePoint Online.
$spoAdminUrl="https://<your tenant>-admin.sharepoint.com"
.\SharePoint-Online\Get-CopilotAgentReport.ps1
Retrieves Microsoft Graph delta query results for tracking changes in SharePoint Online.
# Run the script to get delta query results
.\SharePoint-Online\Get-GraphDeltaQueryResults.ps1Retrieves audit log entries for SharePoint agent creation events.
# Set your parameters
$upn = "admin@yourdomain.com"
$startDate = "2025-06-01"
$endDate = "2025-06-24"
# Run the script
.\SharePoint-Online\Get-SharePointAgentCreationAuditLogItems.ps1Retrieves audit log entries for SharePoint agent interaction events.
# Set your parameters
$upn = "admin@yourdomain.com"
$startDate = "2025-06-01"
$endDate = "2025-06-24"
# Run the script
.\SharePoint-Online\Get-SharePointAgentInteractionAuditLogItems.ps1Gets metadata properties of a file in a SharePoint document library using PnP PowerShell.
# Get file properties
.\SharePoint-Online\Get-SharePointFileProperties.ps1 -SiteUrl "https://contoso.sharepoint.com/sites/team" `
-LibraryUrl "/sites/team/Shared Documents" `
-FileName "Document.docx"Creates a complete demo environment with hub sites, regional sites, and project sites with proper associations.
# Run the script to create demo project hub structure
.\SharePoint-Online\New-DemoProjectHubSites.ps1Creates demo project plan documents with random team assignments and tasks.
# Requires ImportExcel and PSWriteWord modules
# Run the script to generate project plan documents
.\SharePoint-Online\New-DemoProjectPlanDocs.ps1Creates SharePoint Online Hub Sites using PnP.PowerShell, with optional parent hub site association.
# Create hub sites
$siteUrls = @("https://contoso.sharepoint.com/sites/Hub1", "https://contoso.sharepoint.com/sites/Hub2")
$parentHubSiteId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
# Run the script
.\SharePoint-Online\New-HubSites.ps1 -SiteUrls $siteUrls -ParentHubSiteId $parentHubSiteIdCreates new OneDrive sites for users in SharePoint Online.
# Set your parameters
$usernames = @("user1@domain.com", "user2@domain.com", "user3@domain.com")
$batchSize = 200
$tenantName = "yourtenant"
# Run the script function
New-OneDriveSites -usernames $usernames -batchsize $batchSize -tenantname $tenantNameConfigures SharePoint Online organizational asset libraries for Office templates and images.
# Update the tenant variable with your tenant name
$tenant = "contoso"
# Run the script to configure organizational asset libraries
.\SharePoint-Online\Set-SPOOrgAssetLibrary.ps1Uploads documents to specified SharePoint sites and libraries using an input array.
# Define documents to upload
$documents = @(
@{
FilePath = "C:\temp\ProjectA Plan.docx"
SiteUrl = "https://contoso.sharepoint.com/sites/ProjectA"
Library = "Shared Documents"
},
@{
FilePath = "C:\temp\ProjectB Plan.docx"
SiteUrl = "https://contoso.sharepoint.com/sites/ProjectB"
Library = "Shared Documents"
}
)
# Run the script
.\SharePoint-Online\Upload-Documents.ps1Retrieves all Teams meeting policies and their configuration settings.
# Run the script to get all Teams meeting policies
.\Teams\Get-AllTeamsMeetingPolicies.ps1Retrieves all Microsoft Teams using Microsoft Graph API.
# Set your Graph API parameters
$clientId = "your-app-registration-id"
$tenantId = "your-tenant-id"
$cert = Get-ChildItem -Path "Cert:\CurrentUser\My" | Where-Object {$_.Subject -like "*YourCertName*"}
# Run the script
.\Teams\Get-AllTeamsViaGraph.ps1Retrieves messages from specified Teams channels.
# Run the script
.\Teams\Get-ChannelMessages.ps1Gets Teams and their membership information.
# Run the script
.\Teams\Get-TeamsAndMembers.ps1Retrieves all Teams that a specific user is a member of.
# Set the user parameters
$userId = "user@yourdomain.com"
$tenantId = "your-tenant-id"
# Run the script
.\Teams\Get-UserTeams.ps1Creates new channels in a specified Microsoft Team.
# Set your parameters
$teamId = "<your team id>"
$channelNames = @("General Discussion", "Project Updates", "Resources")
# Run the script
.\Teams\New-Channels.ps1 -TeamId $teamId -ChannelNames $channelNamesCreates new Microsoft Teams with specified names and optional owners/members.
# Set your parameters
$teamNames = @("Project Alpha", "Project Beta", "Project Gamma")
$owner = "admin@yourdomain.com"
$members = @("user1@yourdomain.com", "user2@yourdomain.com")
# Run the script
.\Teams\New-Teams.ps1 -TeamNames $teamNames -Owner $owner -Members $membersConfigures moderation settings for Teams channels.
# Set your channel parameters
$clientId="<your client id>"
$teamId = "<your team id>"
$channelId = "<your-channel-id>"
$tenantDomain = "yourdomain.onmicrosoft.com"
$moderationSettings = @{
"moderationSettings"= @{
"userNewMessageRestriction"= "moderators"
"replyRestriction" = "authorAndModerators"
"allowNewMessageFromBots" = "false"
"allowNewMessageFromConnectors"= "false"
}
}
# Run the script
.\Teams\Set-ChannelModerationSettings.ps1Blocks a Teams app, making it unavailable to all users by modifying the app permission policy.
# Block a Teams app using its App ID
.\Teams\Set-TeamsAppAvailability.ps1 -AppId "12345678-1234-1234-1234-123456789012"
# Block app with a custom policy name
.\Teams\Set-TeamsAppAvailability.ps1 -AppId "12345678-1234-1234-1234-123456789012" `
-PolicyName "CustomPolicy"Enables Microsoft Viva services for a tenant, including Viva Topics, Connections, Learning, and Insights, and configures the SharePoint home site used for Viva Connections.
# Enable Viva services for the tenant
.\Viva\Enable-VivaFeatures.ps1 -AdminUrl "https://contoso-admin.sharepoint.com" `
-HomeSiteUrl "https://contoso.sharepoint.com/sites/Home" `
-UserScope "All"A Jupyter Notebook that dynamically generates realistic synthetic Salesforce Account, Opportunity, and Case records for testing, development, and demo purposes, then inserts them directly into Salesforce via the REST API. Records are relationally linked — Opportunities and Cases reference valid Account IDs returned from the Account inserts. Supports both Username/Password and OAuth 2.0 Client Credentials authentication. Data can also be exported locally as CSV, JSON, or a multi-sheet Excel workbook without inserting into Salesforce.
Open the notebook in VS Code. Ensure your .env file contains the Salesforce credentials for your chosen auth method:
Option A — Username/Password:
SF_AUTH_METHOD=passwordSF_USERNAME,SF_PASSWORD,SF_SECURITY_TOKENSF_DOMAIN—loginfor production,testfor sandbox
Option B — Client Credentials (recommended):
SF_AUTH_METHOD=client_credentialsSF_CLIENT_ID,SF_CLIENT_SECRETSF_MY_DOMAIN— your org's My Domain hostname (Setup → My Domain)
Run cells sequentially. Section 8 inserts records into Salesforce; Section 9 exports data locally without inserting.