IAM Core

IAM Core Admin PowerShell Module

On this page

The module Fortytwo.IAM.Core.Admin exists for the purposes of managing the IAM Core solution through PowerShell.

The module is listed as Fortytwo.IAM.Core.Admin in the Fortytwo section of PowerShell Gallery.

PowerShell 7 required

The module targets PowerShell 7.1 or later and does not run on Windows PowerShell 5.1. It depends on the EntraIDAccessToken module, which is installed alongside it.

Installation

PowerShell
Install-Module Fortytwo.IAM.Core.Admin -Scope CurrentUser

Connect

By default, the Connect-IAMCore cmdlet connects using interactive sign-in, which is useful for most situations.

PowerShell
Connect-IAMCore

If your account exists in more than one tenant, or you want to be explicit about which one you are administering, pass the tenant:

PowerShell
Connect-IAMCore -TenantId "00000000-0000-0000-0000-000000000000"

For unattended use — a scheduled job, a pipeline — create an access token profile yourself with the EntraIDAccessToken module and hand it to Connect-IAMCore:

PowerShell
Add-EntraIDClientSecretAccessTokenProfile `
    -Name "IAMCore" `
    -TenantId "00000000-0000-0000-0000-000000000000" `
    -ClientId "<your app registration>" `
    -ClientSecret ($Secret | ConvertTo-SecureString -AsPlainText -Force) `
    -Scope "https://api.fortytwo.io/.default"

Connect-IAMCore -AccessTokenProfile "IAMCore"

The EntraIDAccessToken module has a profile cmdlet per credential type — Add-EntraIDClientCertificateAccessTokenProfile for a certificate, Add-EntraIDAzureVMMSIAccessTokenProfile and Add-EntraIDFunctionAppMSIAccessTokenProfile for managed identities, Add-EntraIDGitHubFederatedCredentialAccessTokenProfile for GitHub Actions. Run Get-Command -Module EntraIDAccessToken for the full list.

The application or user behind the token needs the appropriate roles — see authorization. There is no tenant parameter on the individual cmdlets; which tenant you are working in comes from the token.

Cmdlets

Connectors

CmdletPurpose
Get-IAMCoreConnectorTemplateList the available connector templates.
New-IAMCoreConnectorCreate a connector from a template.
Get-IAMCoreConnectorList connectors, or get one by -Id.
Set-IAMCoreConnectorUpdate a connector's name or configuration.
Remove-IAMCoreConnectorDelete a connector.
Get-IAMCoreConnectorDataStatisticsObject counts in a connector's connector space, by -Id.

Connector data

CmdletPurpose
Find-IAMCoreConnectorDataObjectSearch a connector space. Takes -ConnectorId, -ConnectorObjectType and an optional -SearchValue.
Get-IAMCoreConnectorDataObjectSyncPreviewShow what synchronizing one object would do, without writing anything.
Start-IAMCoreConnectorDataObjectSyncSynchronize a single object.
Disconnect-IAMCoreConnectorDataObjectDisconnect one connector object from the core object it is joined to.

Sync rules

CmdletPurpose
Get-IAMCoreSyncRuleList sync rules, or get one by -Id.
New-IAMCoreSyncRuleCreate a sync rule.
Set-IAMCoreSyncRuleUpdate a sync rule. Only the parameters you supply change.
Copy-IAMCoreSyncRuleDuplicate a rule, optionally onto another connector.
Remove-IAMCoreSyncRuleDelete a sync rule. It must be disabled first.
Test-IAMCoreSyncRuleExpressionEvaluate an expression against a real connector object.

See sync rules for worked examples.

Core objects

CmdletPurpose
Get-IAMCoreIdentityList identities, or get one by -Id.
Get-IAMCoreRelationshipList relationships, or get one by -Id.
Get-IAMCoreOrgUnitList org units, or get one by -Id. Add -IncludeParents to walk up the tree.
Get-IAMCoreObjectThe same, with -ObjectType as CoreIdentity, CoreRelationship or CoreOrgUnit.
Find-IAMCoreIdentitySearch identities by -Text.
Find-IAMCoreOrgUnitSearch org units by -Text.
Find-IAMCoreRelationshipSearch relationships by -Text.
Get-IAMCoreIdentityRelationshipThe relationships held by one identity, by -Id.
Get-IAMCoreOrgUnitRelationshipThe relationships attached to one org unit, by -Id.
Show-IAMCoreOrgUnitStructureRender the org unit hierarchy as a tree.
Get-IAMCoreSchemaThe attribute schema of the core object types.

The three Get- cmdlets for core objects accept -IncludeConnectors when fetching a single object, which adds the connector objects contributing to it — the quickest way to see where a value came from.

When listing, the cmdlets fetch every page for you, so a plain Get-IAMCoreIdentity returns all identities however many there are. -PageSize controls how many are fetched per request and defaults to 2000.

Searching

Find-IAMCoreIdentity, Find-IAMCoreOrgUnit and Find-IAMCoreRelationship look up objects without needing an id:

PowerShell
Find-IAMCoreIdentity -Text "Jacobsen"
Find-IAMCoreIdentity -Text "18068180018"
Find-IAMCoreOrgUnit -Text "Utkanten Kommune"
Find-IAMCoreRelationship -Text "Sykepleier"

-Text must be between 3 and 100 characters, and at most 100 results come back, so this is a lookup rather than a way to enumerate. Which attributes are searched depends on the object type:

Object typeMatched exactlyMatched on a substring
Identitynin, entraObjectId, entraOnPremisesSamAccountNamedisplayName, email, entraUserPrincipalName
OrgUnitexternalIddisplayName, email
RelationshipemployeeIdtitle

Substring matching ignores case. There are no wildcards.

Walking between objects

PowerShell
# Every position held by one person
Get-IAMCoreIdentityRelationship -Id $Identity.id

# Everyone attached to one org unit
Get-IAMCoreOrgUnitRelationship -Id $OrgUnit.id

Both take a pipeline value, so a set of relationships can be resolved back to the org units behind them:

PowerShell
Get-IAMCoreRelationship |
    ForEach-Object { $_.orgUnit.value.objectId } |
    Sort-Object -Unique |
    ForEach-Object { Get-IAMCoreOrgUnitRelationship -Id $_ }

Sync jobs

CmdletPurpose
New-IAMCoreSyncJobQueue a job. -JobType is FullSyncTenant (default) or ConnectorImport with a -ConnectorId.
Get-IAMCoreSyncJobList jobs, or get one by -Id.
Wait-IAMCoreSyncJobBlock until a job finishes. -TimeoutMinutes defaults to 30, -Sleep to 5 seconds.

Jobs do not run concurrently where they would interfere, and queuing one that conflicts fails rather than waiting:

  • A full sync is refused while connector imports are pending or running.
  • A connector import is refused while a full sync is pending or running.
  • A second job of the same type, for the same connector, is refused while the first is unfinished.

So the reliable pattern is to wait for each job rather than queuing several at once. Completed jobs are kept for 30 days.

Common patterns

Run a full synchronization and wait for it:

PowerShell
New-IAMCoreSyncJob | Wait-IAMCoreSyncJob -TimeoutMinutes 10

Import from one connector, then synchronize:

PowerShell
New-IAMCoreSyncJob -JobType ConnectorImport -ConnectorId $Connector.id | Wait-IAMCoreSyncJob
New-IAMCoreSyncJob | Wait-IAMCoreSyncJob

Find a person and see which connectors contribute to them:

PowerShell
Get-IAMCoreIdentity |
    Where-Object { $_.displayName -eq "Ola Nordmann" } |
    Get-IAMCoreIdentity -IncludeConnectors

Inspect the organizational tree:

PowerShell
Get-IAMCoreOrgUnit | Show-IAMCoreOrgUnitStructure

More examples are on the PowerShell examples page.

Last updated 27 October 2026 Edit this page on GitHub
Esc