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

SecurityInsight scripts

Grant-SIIdentity

Grant a managed identity everything SecurityInsight reads with

Purpose

Grants a managed identity (a VM's, an Azure Arc server's, or a user-assigned one) -- or, with -AppId, an app registration that signs in with a certificate -- everything SecurityInsight needs: Key Vault Secrets User on the SI vault, Reader at the collection scopes, Monitoring Metrics Publisher on the DCR resource group, Log Analytics Reader on the workspaces, the storage data roles, AcrPull, and the read-only Microsoft Graph / Defender application permissions. Prints present / missing; changes nothing without -Apply.

When to run it

When an identity is added, moved or found missing a permission (Get Started's permission check names this command).

Who may run it

KindRoleScopeWhy
azureRbacOwner or User Access Administratoreach scope it grants onto add the role assignments
entraRolePrivileged Role Administrator (or Global Administrator)the tenantto grant application permissions (appRoleAssignments)
otherMicrosoft Graph AppRoleAssignment.ReadWrite.All (when an app runs it instead of a person)the tenantto grant the identity its application permissions

What it changes

WhereActionWhatPermission / roleScopeWhyUndo
Azure RBACgrantthe managed identityKey Vault Secrets Userthe SecurityInsight Key Vaultread its configuration and the licenceremove the role assignment
Azure RBACgrantthe managed identityReaderthe collection scope(s) (tenant root group or subscriptions)enumerate Azure resources (Resource Graph)remove the role assignment
Azure RBACgrantthe managed identityMonitoring Metrics Publisherthe DCR resource groupsend rows through the SI data collection rulesremove the role assignment
Azure RBACgrantthe managed identityLog Analytics Readerthe SI workspace (and the Defender / Sentinel workspace)Risk Analysis and correlation query the tablesremove the role assignment
Azure RBACgrantthe managed identityStorage Blob Data Contributor, Storage Queue Data Contributor, Storage Table Data Contributorthe SI storage accountSI's own run stateremove the role assignments
Azure RBACgrantthe managed identityAcrPullthe SI registrypull the engine imageremove the role assignment
Entra application permissionsgrantthe managed identity's service principalMicrosoft Graph User.Read.All, Group.Read.All, Directory.Read.All, Device.Read.All, Application.Read.All, AuditLog.Read.All, Policy.Read.All, RoleManagement.Read.All, RoleManagement.Read.Directory, RoleManagementPolicy.Read.Directory, RoleEligibilitySchedule.Read.Directory, RoleAssignmentSchedule.Read.Directory, PrivilegedAccess.Read.AzureADGroup, IdentityRiskyUser.Read.All, IdentityRiskEvent.Read.All, IdentityRiskyServicePrincipal.Read.All, ThreatHunting.Read.All, UserAuthenticationMethod.Read.All, DeviceManagementManagedDevices.Read.All, DeviceManagementConfiguration.Read.All, AccessReview.Read.All, SecurityAlert.Read.All, SecurityEvents.Read.All; Microsoft Threat Protection AdvancedHunting.Read.All; WindowsDefenderATP Machine.Read.All, Vulnerability.Read.All, SecurityRecommendation.Read.All, Score.Read.Allthe tenantread-only collectionremove the appRoleAssignments
Azure RBAC + Entra (only with -Tagging)grantthe asset-tagging identityTag Contributor; Machine.ReadWrite.All; CustomSecAttributeAssignment.ReadWrite.All (write grants, opt-in)the tagging scopes / the tenantasset tagging writes tags only when switched onremove the role assignments and appRoleAssignments
Azure RBACgrantthe SecurityInsight identityMonitoring Contributorthe data collection rule resource group (only with -AllowSchemaCreate)the first run creates its own data collection rulesremove the role assignment (Azure portal -> the resource group -> Access control)
Azure RBACgrantthe SecurityInsight identityLog Analytics Contributorthe Log Analytics workspace (only with -AllowSchemaCreate)the first run creates its own tablesremove the role assignment (Azure portal -> the workspace -> Access control)

What it only reads

  • existing role assignments
  • existing appRoleAssignments

Parameters

ParameterRequiredDefaultWhat it does
-PrincipalIdyes
-IdentityNameyes
-IdentityResourceGroupyes
-VmNameyes
-VmResourceGroupyes
-ArcMachineNameyes
-ArcResourceGroupyes
-AppIdyesan app registration (certificate sign-in): its application (client) id; its service principal is found by that id
-ConfigPathno
-SubscriptionIdnothe subscription to work in; given, it wins over the config (the guided install passes its own answer)
-ReaderScopesno
-KeyVaultNameno
-AllowSchemaCreateno
-Taggingno#236: the asset-tagging plan (writes) instead of the read-only collection plan -- for asset tagging's own identity
-WebAppno#446: the Pro web app's own identity (uami-si-management): read-only Microsoft Graph for names, the people picker and the enterprise application's role holders. Needs no config file; give -SubscriptionId with -IdentityName.
-TaggingScopesno
-ReportOnlynoWith -Tagging: only what the job needs to RUN and report (its licence -- give -KeyVaultName --, the rules' reads, its activity rows, its run log) -- never the writes. What setup now grants every install; fix request 85bd728f.
-WorkspaceResourceIdnoA container install has no config file on the machine running this: give its values instead (each wins over the config).
-StorageAccountNameno
-StorageResourceGroupno
-DcrResourceGroupno
-AcrRegistryIdnoWith -Tagging: the install's container registry (resource id) -- the job pulls its image as its own identity (AcrPull)
-OnlyAppPermissionsnoOnly the application permissions of the plan (Microsoft Graph, Defender): no Azure role is read or granted, and no install configuration is needed -- for a change that was approved as exactly that.
-OnlynoOnly these application permissions of the plan, by name (e.g. SecurityAlert.Read.All). Implies -OnlyAppPermissions. A name that is not in the plan stops the run: nothing outside the plan is ever granted.
-Applyno

Preview with -WhatIf

The plan: every grant listed as present / missing; nothing is granted (same as running without -Apply).

Undo

Remove the listed role assignments and appRoleAssignments (the plan prints each with its scope).

Network

It connects to: *.blob.core.windows.net, *.queue.core.windows.net, *.table.core.windows.net, *.vault.azure.net, 169.254.169.254, api.loganalytics, api.loganalytics.io, api.msrc.microsoft.com, api.security.microsoft.com, api.securitycenter.microsoft.com, api.securityplatform.microsoft.com, database.windows.net, entra.microsoft.com, graph.microsoft.com, invardia.com, licenses.nuget.org, login.microsoftonline.com, management.azure.com, monitor.azure.com, nvd.nist.gov, outlook.office.com, outlook.office365.com, portal.invardia.com, storage.azure.com, vault.azure.net, www.powershellgallery.com

Download and run

Run these lines in PowerShell: the first downloads the script into the current folder, the second runs it.

Invoke-WebRequest https://invardia.com/support/si/Grant-SIIdentity.ps1 -OutFile Grant-SIIdentity.ps1
.\Grant-SIIdentity.ps1 -PrincipalId <PrincipalId> -IdentityName <IdentityName> -IdentityResourceGroup <IdentityResourceGroup> -VmName <VmName> -VmResourceGroup <VmResourceGroup> -ArcMachineName <ArcMachineName> -ArcResourceGroup <ArcResourceGroup> -AppId <AppId>

To check the download first, compare its SHA-256 with the published one:

SHA-256 1ebe1979307757bb4a89d5f492dd67240ad84f8336a5439b4ea8d2e8b3ee3d49

Checksums: SHA256SUMS.txt · Version 3.0.79

Before you run it, compare the file's SHA-256 with its line in SHA256SUMS.txt.

Every parameter: Get-Help .\Grant-SIIdentity.ps1 -Full · Source: Grant-SIIdentity.ps1

Every script, identity and permission for your security review: SecurityInsight

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