Skip to content

Instantly share code, notes, and snippets.

View DanClowry's full-sized avatar
😐

Daniel Clowry DanClowry

😐
View GitHub Profile
@DanClowry
DanClowry / DuplicateIntuneManagerIds.ps1
Created May 15, 2024 12:29
Duplicate the IDs between two IntuneManager JSON exports
param(
[Parameter(Mandatory = $true,
Position = 0,
HelpMessage = "Path to exported files from the tenant.")]
[ValidateNotNullOrEmpty()]
[string]
$TenantExportPath,
[Parameter(Mandatory = $true,
Position = 1,
@DanClowry
DanClowry / DKIMRollout.ps1
Created December 8, 2021 00:54
Script to rollout DKIM to all O365 tenants with Azure DNS
# https://www.cyberdrain.com/connect-to-exchange-online-automated-when-mfa-is-enabled-using-the-secureapp-model/
$ApplicationId = 'xxxx-xxxx-xxx-xxxx-xxxx'
$ApplicationSecret = 'TheSecretTheSecrey' | Convertto-SecureString -AsPlainText -Force
$TenantID = 'YourTenantID'
$RefreshToken = 'RefreshToken'
$ExchangeRefreshToken = 'ExchangeRefreshToken'
$upn = 'UPN-Used-To-Generate-Tokens'
$credential = New-Object System.Management.Automation.PSCredential($ApplicationId, $ApplicationSecret)
$azureResourceGroup = "YourAzureResourceGroupName"
@DanClowry
DanClowry / !README
Last active June 23, 2023 21:55
Enable Unified Audit Log for Microsoft 365 Delegated Tenants
Original scripts sourced from https://gcits.com/knowledge-base/enabling-unified-audit-log-delegated-office-365-tenants-via-powershell/
How to use these scripts:
1. Modify the headers of each script to suit your environment (username, admin password, admin prefix, CSV paths, etc)
2. Run GetAuditStats.ps1 and sign into your account with delegated admin access when prompted - wait at least 12 hours after running this script before proceeding to step 3 to allow any new admin accounts to properly provision
3. Run EnableOrgCustomisation.ps1 and sign into your account with delegated admin access when prompted - wait at least 48 hours after running this script before proceeding to step 4 to ensure that tenants are properly hydrated
a. You may need to rerun this script 2 or 3 times to ensure that every tenant is hydrated. It seems like sometimes the hydration command errors out and doesn't properly hydrate a tenant on the first go ¯\_(ツ)_/¯.
4. Run EnableAuditing.ps1 and sign into your account with delegated