Overview
As part of the Atria Azure AD Service Sync Policies, you can assign custom configuration scripts that will be run each time the service is provisioned. This is useful to ensure your customer's tenants are always configured with your preferred best practice settings. The key benefit is that Atria will connect up with the right security context for your customer tenants leveraging the Secure Application Model.
This guide will be updated as we create new script examples. If there are examples you need assistance with please contact us at
support@automate101.com
Applying a script to a Sync Policy
To apply a custom script to a Sync Policy:
- Navigate to Services > Microsoft Online > Sync Policies
- Edit or create a new Sync Policy
- When editing a Sync Policy there is a section called Tenant Configuration Script as shown below
- Specify a custom script to be run i.e. C:\msol\customscript.ps1 (Note: script path should be a local path in the provisioning server or a UNC path accessible in intranet)
- Save your Policy - the script will be run every time the Azure AD service is provisioned or reprovisioned to a customer.
Example Scripts
Enforce MFA with security defaults – or enable/disable security defaults
- Tenant level (https://compliance.microsoft.com/auditlogsearch?viewid=Test%20Tab)

Script Example
- # Get the current Unified Audit Log status
- $AdminAuditLogConfig = Invoke-Command -Session $Session -ScriptBlock {
- return Get-AdminAuditLogConfig
- }
- $UnifiedAuditLogIngestionEnabled = $AdminAuditLogConfig.UnifiedAuditLogIngestionEnabled
- If(!$UnifiedAuditLogIngestionEnabled) {
- # Prerequisite
- Invoke-Command -Session $Session -ScriptBlock {
- Enable-OrganizationCustomization -Confirm:$false -ErrorAction SilentlyContinue
- }
- # Enable Unified Audit Log
- Invoke-Command -Session $Session -ScriptBlock {
- Set-AdminAuditLogConfig -UnifiedAuditLogIngestionEnabled $true | Out-Null
- }
- }