New-GSADomainControllerApp

1.1

This script builds the domain controller publishing described in Microsoft's guidance for Kerberos SSO with Private Access. It creates a Global Secure Access enterprise application, binds it to a private network connector group, and adds application segments for each domain controller.

For each domain controller, the script publishes its FQDN and the IPv4 address rep
This script builds the domain controller publishing described in Microsoft's guidance for Kerberos SSO with Private Access. It creates a Global Secure Access enterprise application, binds it to a private network connector group, and adds application segments for each domain controller.

For each domain controller, the script publishes its FQDN and the IPv4 address reported by Active Directory. Each destination gets one TCP segment and one UDP segment carrying the ports Microsoft lists for domain controllers:

- TCP: 88, 135, 389, 445, 464, 636, 3268, 3269, 49152-65535
- UDP: 88, 123, 135, 389, 445, 464, 49152-65535

GSA does not support IPv6, so IPv6 addresses are never published.

The application is an infrastructure service, so the script hides it from users (My Apps and the Microsoft 365 app launcher) and requires assignment. The script does not assign any users or groups. Review the application in the Entra admin center and assign synchronized users or groups when approved.

By default, the application is bound to the default connector group, even if the group has no active connectors. The script finds the default group by its isDefault property, so it is found even if it was renamed. If the default group has no active connectors, the script warns that the application must be reassigned to the connector group for the domain controllers' AD site when that group is ready. If the default group has active connectors, the summary notes that best practice is to use the default group only for staging. Use -ConnectorGroupName to bind the application to another group instead.

Use -EnableDeviceAccess to turn on 'Enable Device Access with Global Secure Access' for the application. Device Access lets Microsoft Entra joined and hybrid joined Windows devices reach the domain controllers before a user signs in. After the script runs, add the application to a Device Access profile and assign the profile to devices. Device Access is in preview.

Microsoft recommends publishing only the domain controllers in the Active Directory site where the Private Access connectors are installed. By default, you supply those domain controllers with -DomainController. Use -AllDomainControllers to publish every domain controller in the forest instead.

If an application with the same name exists, the script stops unless -UpdateExisting is specified. With -UpdateExisting, the script adds missing segments, reports segments that differ or are not part of this run, and never deletes anything. It never moves the application to another connector group, and it keeps an administrator's changes to the hidden and assignment required settings unless -ResetAppSettings is specified. Rerun with -UpdateExisting to finish an application after a partial failure.

Show more

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Script -Name New-GSADomainControllerApp

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

Copyright (C) 2026 Richard M. Hicks Consulting, Inc. All Rights Reserved.

Package Details

Author(s)

  • Richard Hicks

Tags

Entra PrivateAccess GlobalSecureAccess GSA ZTNA ZeroTrust Kerberos SSO ActiveDirectory DomainController DeviceAccess MicrosoftGraph

Functions

Invoke-GraphRequestWithRetry Get-GraphCollection Get-GraphErrorMessage Resolve-ConnectorGroup ConvertTo-PortRange Get-PortKey ConvertTo-DcRecord Test-IPv4Address

Dependencies

Release Notes

1.1 - Binds new applications to the default connector group unless -ConnectorGroupName is specified. Binds connector groups with no active connectors, with a warning. Removes -SkipConnectorCheck. Adds -EnableDeviceAccess. Fixes an error that stopped the script while hiding new applications from users.
1.0 - Initial release.

FileList

Version History

Version Downloads Last updated
1.1 (current version) 13 12/2/2026