BV
Bala Santosh Velchicherla Cloud & Applications Engineer
PowerShell 7 & Graph SDK

Automation Workbench & Scripts

Production-grade PowerShell automation tools for enterprise Microsoft 365, Entra ID, and Intune tenant management.

Enforce Entra ID Authenticator Geolocation Telemetry

Microsoft Graph SDK

Enforces tenant-wide geographic location display and application naming inside Microsoft Authenticator to neutralize notification bombing and MFA fatigue attacks.

Set-EntraAuthenticatorLocationPolicy.ps1 Production Tested
Connect-MgGraph -Scopes "Policy.ReadWrite.AuthenticationMethod"

$params = @{
    "@odata.type" = "#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration"
    featureSettings = @{
        displayLocationInformationRequiredState = @{
            state         = "enabled"
            includeTarget = @{ targetId = "all_users" }
        }
        displayAppInformationRequiredState = @{
            state         = "enabled"
            includeTarget = @{ targetId = "all_users" }
        }
    }
}

Update-MgPolicyAuthenticationMethodPolicyAuthenticationMethodConfiguration `
    -AuthenticationMethodConfigurationId "MicrosoftAuthenticator" `
    -BodyParameter $params

Write-Host "[SUCCESS] Tenant baseline enforced: MFA Geographic Telemetry Active" -ForegroundColor Green

Assign Autopilot Device Preparation Service Principal

Intune API

Grants the Microsoft Intune Autopilot first-party service principal ownership of target device groups to enable zero-hash provisioning during Autopilot v2 device onboarding.

Set-AutopilotServicePrincipalOwner.ps1 PowerShell 7
Connect-MgGraph -Scopes "Group.ReadWrite.All", "Application.Read.All"

$GroupName = "Sec-Intune-AutopilotDP-Laptops"
$Group = Get-MgGroup -Filter "displayName eq '$GroupName'"

$AppId = "f1346770-5b25-470b-88bd-d5744ab7952c"
$ServicePrincipal = Get-MgServicePrincipal -Filter "appId eq '$AppId'"

New-MgGroupOwnerByRef -GroupId $Group.Id -DirectoryObjectId$ServicePrincipal.Id

Write-Host "[SUCCESS] Intune SP assigned as owner of $GroupName" -ForegroundColor Green