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

Grant-PimHybridWorkerAccess

PIM for Active Directory: grant the hybrid worker's identity its cloud access

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

Purpose

Grants the hybrid worker's managed identity (Azure VM or Azure Arc server) exactly what it needs outside Active Directory: a database user in the PIM store, read-only Microsoft Graph roles and read access to the PIM source store.

When to run it

Once per worker, after the infrastructure step and before Install-PimHybridWorker.ps1 -Phase Configure (the install fetches the code with the identity). -PrincipalId for the Azure VM's identity, -ArcMachineResourceId for an Azure Arc server. Runs in Windows PowerShell 5.1 or PowerShell 7 (on a PowerShell 7 transport failure the SQL step re-runs once in a Windows PowerShell 5.1 child; the token travels on its standard input).

Who may run it

KindRoleScopeWhy
entraRolePrivileged Role Administratorthe tenantgrants Microsoft Graph application roles to the worker identity
azureRbacUser Access Administratorthe source-store containerassigns Storage Blob Data Reader (Owner or Role Based Access Control Administrator also work)
otherMicrosoft Entra admin of the PIM SQL serverthe PIM databasecreates the worker's contained database user and adds it to db_datareader + db_datawriter

What it changes

WhereActionWhatPermission / roleScopeWhyUndo
Microsoft Graphgrantapplication permission (app role assignment) of the worker identityGroup.Read.All, User.Read.All, PrivilegedAssignmentSchedule.Read.AzureADGroup (+ Mail.Send with -GrantMailSend)the tenantthe worker reads the PIM groups and who is active in them; read onlyremove the app role assignments in the identity's enterprise application
Azure RBACgrantthe worker identityStorage Blob Data Readerthe source-store container (-SourceContainerId)self-update with the identity -- no SAS, no PATremove the role assignment
PIM databasegrantcontained user -SqlUserName created from the identity's application iddb_datareader, db_datawriter (never db_ddladmin)the PIM database (-SqlDatabase)the worker reads its work and writes its state and auditDROP USER [<name>]

What it only reads

  • the subscription's tenant
  • the identity's service principal and its current app role assignments
  • the current role assignments on the container and the current database principals (read-before-write)

Parameters

ParameterRequiredDefaultWhat it does
-SubscriptionIdyesThe subscription (tenant check; the Arc machine's subscription).
-TenantIdyesThe tenant; Graph calls follow it and the script refuses another.
-PrincipalIdnoAzure VM worker: the VM's managed identity object id (the infrastructure step returns it).
-ArcMachineResourceIdnoAzure Arc worker: the Arc machine's resource id; its identity is read from Azure.
-ArcApiVersionno2024-07-10Microsoft.HybridCompute api-version.
-SqlServernoThe PIM SQL server FQDN (<server>.database.windows.net). Omitted: no SQL step.
-SqlDatabasenoPimPlatformThe PIM database.
-SqlUserNamenoPIMHYBRIDWRKThe contained user's name; one per worker.
-SourceContainerIdnoThe source-store container's resource id. Omitted: no storage grant.
-GrantMailSendnofalseAlso grant Mail.Send (new AD admin accounts get their initial password by mail).

Preview with -WhatIf

Prints each Graph role, the storage role and the SQL user / role memberships it would grant; grants nothing.

Undo

Remove the Graph app role assignments, the Storage Blob Data Reader assignment and DROP USER the contained user.

Network

It connects to: management.azure.com, graph.microsoft.com, login.microsoftonline.com (REST, browser sign-in or an Invardia support session); the PIM SQL server on 1433; 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