Skip to content
InvardiaInvardia
Why InvardiaProductsFeaturesPricingCommunity
Docs
All documentation
Product documentationPIM ManagerSecurityInsight
SettingsPIM Manager settingsSecurityInsight settingsEntra Policy Suite settings
ScriptsPIM Manager scriptsSecurityInsight scriptsEntra Policy Suite scriptsInvardia scripts
Error codesPIM Manager error codesSecurityInsight error codes
API and MCPPIM Manager APIPIM Manager MCP toolsSecurityInsight APISecurityInsight MCP tools
SecurityPIM Manager security packSecurityInsight security packEntra Policy Suite security pack
Network and designPIM Manager network guidesPIM Manager command wizardNetwork egressDesign your installationCalculate your cost
SupportSetup scriptsRemote support access
Search the docs
SupportAboutContactBook a demoCustomer portalDesign your installationFree Pro trial

PIM Manager scripts

Set-PimHybridWorkerEgress

PIM for Active Directory: NAT gateway egress for the hybrid worker VM (no public IP)

Part of the PIM Manager release - not a standalone download; it runs via the product's own install command or the updater.

Purpose

Puts the hybrid worker VM's outbound traffic behind a NAT gateway and makes sure the VM itself has no public IP address.

When to run it

Run for you by New-PimHybridWorkerInfra.ps1 (-Egress NatGateway). Run it yourself to migrate a worker built with a public IP on its VM, or to verify the egress. Azure VM worker only.

Who may run it

KindRoleScopeWhy
azureRbacNetwork Contributorthe worker's resource groupcreates the NAT gateway and its public IP, detaches a public IP from the VM's NIC, updates the subnet

What it changes

WhereActionWhatPermission / roleScopeWhyUndo
the worker's resource groupcreateNAT gateway natgw-<vm> (Standard) and, when no address can be reused, the Standard static public IP pip-<vm> as its outbound addressoutbound only; nothing can connect indetach it from the subnet, then delete the NAT gateway and its public IP
the VM's network interfaceupdatea public IP on it is DETACHED (the address is kept and becomes the NAT gateway's)the worker is Tier 0: never a public IP of its ownnone intended
the worker subnetupdatenatGateway = the NAT gateway; defaultOutboundAccess = falseoutbound through the NAT gateway onlyremove the NAT gateway from the subnet

What it only reads

  • the subscription's tenant
  • the subnet, the VM and its NICs, the NAT gateway and public IP (read-before-write), and at the end a verification that no public IP is left on the VM

Parameters

ParameterRequiredDefaultWhat it does
-SubscriptionIdyesThe worker's subscription.
-TenantIdyesThe tenant; the script refuses a subscription in another one.
-ResourceGroupnorg-pimhybridwrkThe worker's resource group.
-Locationnothe VNet's regionRegion for the NAT gateway and its IP.
-VmNamenoPIMHYBRIDWRKThe worker VM.
-VnetNamenovnet-pimhybridwrkThe worker VNet.
-SubnetNamenosnet-workerThe worker subnet.
-NatGatewayNamenonatgw-<vm>The NAT gateway name.
-PublicIpNamenopip-<vm>The NAT gateway's public IP name (when none is reused).

Preview with -WhatIf

Prints the NAT gateway, the detach and the subnet change it would make; changes nothing (and, before the subnet exists, says so instead of failing).

Undo

Remove the NAT gateway from the subnet, delete the NAT gateway and its public IP. A detached public IP is not re-attached to the VM (by design).

Network

It connects to: management.azure.com (ARM REST) and login.microsoftonline.com -- browser sign-in or an Invardia support session; no Azure CLI, no PowerShell module

How it runs

Part of the PIM Manager release - not a standalone download; it runs via the product's own install command or the updater.

Release 3.0.70

Every script, identity and permission for your security review: PIM Manager

InvardiaInvardia

See the risk. Control the access.

Products

PIM ManagerSecurityInsightEntra Policy SuiteAll featuresPricingFree 60-day Pro trialBook a demoWhy Invardia

Docs

DocumentationSearch the docsPIM Manager settingsSecurityInsight settingsPIM network guidesCommand wizardNetwork egressPIM Manager design configuratorSecurityInsight design configuratorDesign your installationCalculate your cost

Company

AboutContactCustomer portalSupportHow support worksHow updates reach youSupport in numbersSetup scriptsRemote support accessContact: info@invardia.com

Legal

Terms of saleLicence termsData processingPrivacyCookiesCompany information
© 2026 Invardia – a brand of 2LINKIT, founded and owned by Morten Knudsen · Strandvejen 21A, 6000 Kolding, Denmark · VAT DK39208032 · Contact: info@invardia.com