Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
cc36081
chore: api drift detected 2026-11-10-0922
github-actions[bot] Nov 10, 2026
40f107b
feat: create and update users with New-InforcerUser and Set-InforcerUser
royklo Nov 10, 2026
f2e2b63
fix: zero a failed request's body in the shared credential cleanup
royklo Nov 10, 2026
dabda13
chore: refresh OpenAPI snapshot from production (2026-11-10)
github-actions[bot] Nov 10, 2026
ecf73c4
Merge remote-tracking branch 'origin/api-drift/2026-11-10-0922' into …
royklo Nov 10, 2026
ae52cec
feat: reset passwords, revoke sessions and list authentication methods
royklo Nov 11, 2026
93f2f26
feat: remove a user's sign-in methods with Set-InforcerUser
royklo Nov 12, 2026
40234f4
feat: reset a user's MFA with Set-InforcerUser -ResetMfa
royklo Nov 12, 2026
e7ec53c
chore: refresh OpenAPI snapshot from production (2026-11-12)
github-actions[bot] Nov 12, 2026
0bbfedb
feat: licences and Temporary Access Pass in Set-InforcerUser
royklo Nov 15, 2026
cf88c87
feat: hide a user's mailbox from the address lists with Set-InforcerUser
royklo Nov 16, 2026
714e2d6
feat: list a tenant's licences with free seats via Get-InforcerTenant…
royklo Nov 17, 2026
bd84942
feat: read and change a user's Exchange Online mailbox
royklo Nov 17, 2026
b37065d
feat: calendar sharing, mail apps and user type in the user cmdlets
royklo Nov 18, 2026
674ddc7
feat: add a user to groups and remove them from groups with Set-Infor…
royklo Nov 18, 2026
69628db
feat: turn on a mailbox's online archive with Set-InforcerUser -Enabl…
royklo Nov 18, 2026
efc58af
chore: refresh OpenAPI snapshot from production (2026-11-19)
github-actions[bot] Nov 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ A call Graph refuses leaves those IDs as they are, with a warning that names the

## Personal data

Some output contains personal data (names, UPNs, email addresses, IP addresses, sign-in details): user details (`Get-InforcerUser -UserId`), audit events, report outputs, and the files written by `Export-InforcerTenantDocumentation`, `Compare-InforcerEnvironments`, `Invoke-InforcerAssessment`, `Invoke-InforcerReport` and `Save-InforcerReportOutput`. The module caches no user or audit data. It writes files only where you ask: to `-OutputPath`, or for `Invoke-InforcerReport` and `Save-InforcerReportOutput` to the current directory when `-OutputPath` is omitted (`-NoSave` writes nothing). Handle those files as personal data: keep them access-controlled and delete them when no longer needed.
Some output contains personal data (names, UPNs, email addresses, IP addresses, sign-in details): user details (`Get-InforcerUser -UserId`, including the phone numbers and email addresses in `-IncludeAuthenticationMethods` and the mailbox details in `-IncludeMailbox`), audit events, report outputs, and the files written by `Export-InforcerTenantDocumentation`, `Compare-InforcerEnvironments`, `Invoke-InforcerAssessment`, `Invoke-InforcerReport` and `Save-InforcerReportOutput`. The module caches no user or audit data. It writes files only where you ask: to `-OutputPath`, or for `Invoke-InforcerReport` and `Save-InforcerReportOutput` to the current directory when `-OutputPath` is omitted (`-NoSave` writes nothing). Handle those files as personal data: keep them access-controlled and delete them when no longer needed.

## Cmdlets

Expand All @@ -178,13 +178,15 @@ Some output contains personal data (names, UPNs, email addresses, IP addresses,
| **Connect-Inforcer** | Establishes a secure connection to the inforcer REST API with an API client (`-ClientId`/`-ClientSecret`, v1) or a legacy API key (`-ApiKey`, beta). Supports `-FetchGraphData` to also connect Microsoft Graph. |
| **Disconnect-Inforcer** | Disconnects and clears the session (including Graph if connected). |
| **Test-InforcerConnection** | Tests the API connection; returns `$true` or `$false`. |
| **Get-InforcerTenant** | Retrieves tenant information (optional filter by TenantId). |
| **Get-InforcerTenant** | Retrieves tenant information (optional filter by TenantId); `-IncludeSubscriptions` adds the tenant's licences with free seats (API client login only). |
| **Get-InforcerBaseline** | Retrieves baseline groups and members. |
| **Get-InforcerTenantPolicies** | Retrieves policies for a specified tenant. |
| **Get-InforcerAlignmentDetails** | Retrieves alignment scores (table or raw format). |
| **Get-InforcerAuditEvent** | Retrieves audit events (optional EventType, date range; -EventType has tab completion). |
| **Get-InforcerSupportedEventType** | Returns the canonical list of audit event types accepted by `Get-InforcerAuditEvent -EventType`. Drives the tab completer; cached after first call. |
| **Get-InforcerUser** | Retrieves users from a tenant (list/search or detail by UserId). |
| **Get-InforcerUser** | Retrieves users from a tenant (list/search or detail by UserId); `-IncludeAuthenticationMethods` adds their sign-in methods and `-IncludeMailbox` their Exchange Online mailbox (API client login only). |
| **New-InforcerUser** | Creates a Microsoft Entra user in a tenant (API client login only). |
| **Set-InforcerUser** | Updates a user's profile, manager or sign-in, changes licences and group memberships, changes their mailbox (shared mailbox, online archive, automatic replies, forwarding, permissions, calendar sharing, mail groups, email addresses, inbox rules, mail apps, address lists), resets their password, removes sign-in methods or resets MFA, issues a Temporary Access Pass, or signs them out everywhere; only the fields you pass change (API client login only). |
| **Get-InforcerGroup** | Retrieves Entra ID groups from a tenant (list/search or detail by GroupId). |
| **Get-InforcerRole** | Retrieves Entra ID directory role definitions from a tenant. |
| **Get-InforcerSecureScore** | Retrieves the current and 90-day historic Microsoft Secure Score for a tenant, including per-category scores and actionable control profiles. |
Expand Down
10 changes: 6 additions & 4 deletions Tests/Consistency.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ Describe 'Consistency contract' {
$path = Get-InforcerCommunityManifestPath
Import-Module $path -Force
$script:exported = (Get-Module -Name 'InforcerCommunity').ExportedCommands.Keys
$script:expectedCount = 21
$script:expectedCount = 23
$script:expectedNames = @(
'Connect-Inforcer', 'Disconnect-Inforcer', 'Test-InforcerConnection',
'Get-InforcerTenant', 'Get-InforcerBaseline', 'Get-InforcerTenantPolicies',
'Get-InforcerAlignmentDetails', 'Get-InforcerAuditEvent', 'Get-InforcerSupportedEventType',
'Get-InforcerUser', 'Get-InforcerGroup', 'Get-InforcerRole', 'Get-InforcerSecureScore',
'Get-InforcerUser', 'New-InforcerUser', 'Set-InforcerUser', 'Get-InforcerGroup', 'Get-InforcerRole', 'Get-InforcerSecureScore',
'Export-InforcerTenantDocumentation', 'Compare-InforcerEnvironments',
'Get-InforcerAssessment', 'Invoke-InforcerAssessment',
'Get-InforcerReportType', 'Invoke-InforcerReport', 'Get-InforcerReportRun', 'Save-InforcerReportOutput'
Expand All @@ -44,13 +44,15 @@ Describe 'Consistency contract' {
'Connect-Inforcer' = @('ApiKey', 'ClientId', 'ClientSecret', 'Region', 'BaseUrl', 'FetchGraphData', 'PassThru')
'Disconnect-Inforcer' = @()
'Test-InforcerConnection' = @()
'Get-InforcerTenant' = @('Format', 'TenantId', 'OutputType')
'Get-InforcerTenant' = @('Format', 'TenantId', 'IncludeSubscriptions', 'OutputType')
'Get-InforcerBaseline' = @('Format', 'TenantId', 'OutputType')
'Get-InforcerTenantPolicies' = @('Format', 'TenantId', 'OutputType')
'Get-InforcerAlignmentDetails' = @('Format', 'TenantId', 'BaselineId', 'Tag', 'OutputType')
'Get-InforcerAuditEvent' = @('EventType', 'DateFrom', 'DateTo', 'User', 'PageSize', 'MaxResults', 'Format', 'OutputType')
'Get-InforcerSupportedEventType' = @()
'Get-InforcerUser' = @('Format', 'TenantId', 'Search', 'MaxResults', 'UserId', 'OutputType')
'Get-InforcerUser' = @('Format', 'TenantId', 'Search', 'MaxResults', 'UserId', 'IncludeAuthenticationMethods', 'IncludeMailbox', 'OutputType')
'New-InforcerUser' = @('TenantId', 'DisplayName', 'UserPrincipalName', 'Password', 'MailNickname', 'AccountEnabled', 'ManagerId', 'UserType', 'OutputType')
'Set-InforcerUser' = @('TenantId', 'UserId', 'AccountEnabled', 'DisplayName', 'ManagerId', 'UserType', 'Password', 'ForceChangePasswordNextSignIn', 'AddLicense', 'RemoveLicense', 'AddGroup', 'RemoveGroup', 'HiddenFromAddressLists', 'MailboxType', 'EnableArchive', 'AutoReply', 'ForwardTo', 'KeepForwardedCopy', 'RemoveForwarding', 'GrantMailboxPermission', 'RemoveMailboxPermission', 'GrantCalendarAccess', 'RemoveCalendarAccess', 'AddMailGroup', 'RemoveMailGroup', 'AddEmailAddress', 'PrimaryEmailAddress', 'RemoveEmailAddress', 'RemoveInboxRule', 'RemoveAllInboxRules', 'AllowMailApp', 'BlockMailApp', 'RemoveAuthenticationMethod', 'ResetMfa', 'TemporaryAccessPass', 'TemporaryAccessPassLifetime', 'TemporaryAccessPassUsableOnce', 'RevokeSessions')
'Get-InforcerGroup' = @('TenantId', 'Search', 'Filter', 'MaxResults', 'Group', 'OutputType')
'Get-InforcerRole' = @('TenantId', 'OutputType')
'Get-InforcerSecureScore' = @('TenantId', 'OutputType')
Expand Down
37 changes: 37 additions & 0 deletions Tests/V1.Tenants.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,43 @@ Describe 'Get-InforcerBaseline' {
}
}

Describe 'Get-InforcerTenant -IncludeSubscriptions' {
BeforeEach {
Reset-V1TenantsRoutes
$global:V1TenantsRoutes['/v1/tenants/00000000-0000-0000-0000-000000000001/subscriptions$'] = '{"subscriptions":[{"skuId":"00000000-0000-0000-0000-0000000000c1","sku":"SPE_E5","name":"Microsoft 365 E5","capabilityStatus":"enabled","appliesTo":"user","units":{"enabled":25,"consumed":20,"available":5,"suspended":0,"warning":0,"lockedOut":0}}]}'
$global:V1TenantsRoutes['/v1/tenants/00000000-0000-0000-0000-000000000002/subscriptions$'] = @{ Status = 409; Body = '{"title":"Conflict","status":409}' }
Mock -ModuleName InforcerCommunity Invoke-InforcerHttpRequest { Get-V1TenantsResponse $Request.Uri }
}

It 'v1: adds the subscriptions with skuId and seats, in both output types' {
Set-V1TenantsSession
$t = Get-InforcerTenant -TenantId $script:T1 -IncludeSubscriptions
$t.subscriptions.Count | Should -Be 1
$t.subscriptions[0].skuId | Should -Be '00000000-0000-0000-0000-0000000000c1'
$t.subscriptions[0].units.available | Should -Be 5
$json = Get-InforcerTenant -TenantId $script:T1 -IncludeSubscriptions -OutputType JsonObject | ConvertFrom-Json -Depth 100
$json[0].subscriptions[0].sku | Should -Be 'SPE_E5'
}

It 'v1: one request per tenant; a tenant whose subscriptions fail still comes back, with the error; the cached list is not changed' {
Set-V1TenantsSession
$out = @(Get-InforcerTenant -IncludeSubscriptions -ErrorAction SilentlyContinue -ErrorVariable e)
$out.Count | Should -Be 2
$out[0].subscriptions.Count | Should -Be 1
$out[1].PSObject.Properties['subscriptions'] | Should -BeNullOrEmpty
"$($e[-1])" | Should -BeLike '*409*'
Should -Invoke -ModuleName InforcerCommunity Invoke-InforcerHttpRequest -Times 2 -Exactly -ParameterFilter { $Request.Uri -match '/subscriptions$' }
& $script:M { @($script:InforcerTenantListCache.Tenants | Where-Object { $_.PSObject.Properties['subscriptions'] }).Count } | Should -Be 0
}

It 'beta: stops with RequiresApiClient and makes no request' {
Set-V1TenantsSession -Beta
Get-InforcerTenant -IncludeSubscriptions -ErrorAction SilentlyContinue -ErrorVariable e
$e[-1].FullyQualifiedErrorId | Should -BeLike 'RequiresApiClient*'
Should -Invoke -ModuleName InforcerCommunity Invoke-InforcerHttpRequest -Times 0 -Exactly
}
}

Describe 'Resolve-InforcerBaselineId' {
It 'v1: resolves a baseline name case-insensitively through the neutral /baselines endpoint' {
Set-V1TenantsSession
Expand Down
Loading