Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,27 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## 0.2.0 (2026-04-04)
## 0.3.0 (2026-04-05)

### Added

- Support for Windows PowerShell 5.1

### Fixed

- List of required Graph scopes was missing scopes.
- Casing inside link to CHANGELOG.md in manifest.

## 0.2.0 (2026-04-04)

### Added

- Better error handling due to missing permissions or unknown objects
- Requirement for module 'Microsoft.Graph.Authentication'

### Fixed

- List of required Graph scopes was missing scopes.

## 0.1.0 (2026-04-03)

### Added
Expand Down
32 changes: 16 additions & 16 deletions EntraReporter/EntraReporter.psd1
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
@{

# Script module or binary module file associated with this manifest.
RootModule = 'EntraReporter.psm1'
RootModule = 'EntraReporter.psm1'

# Version number of this module.
ModuleVersion = '0.2.0'
ModuleVersion = '0.3.0'

# Supported PSEditions
# CompatiblePSEditions = @()
CompatiblePSEditions = @('Core', 'Desktop')

# ID used to uniquely identify this module
GUID = '0d751943-6d57-43b3-8b3e-61998116ce59'
GUID = '0d751943-6d57-43b3-8b3e-61998116ce59'

# Author of this module
Author = 'Kåre Overgård'
Author = 'Kåre Overgård'

# Company or vendor of this module
CompanyName = '& Overgård'
CompanyName = '& Overgård'

# Copyright statement for this module
Copyright = '(c) Kåre Overgård. All rights reserved.'
Copyright = '(c) Kåre Overgård. All rights reserved.'

# Description of the functionality provided by this module
Description = 'PowerShell module for generating reports about Entra ID.'
Description = 'PowerShell module for generating reports about Entra ID.'

# Minimum version of the PowerShell engine required by this module
# PowerShellVersion = ''
PowerShellVersion = '5.1'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''
Expand All @@ -43,7 +43,7 @@
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @(
RequiredModules = @(
'Microsoft.Graph.Authentication'
)

Expand All @@ -57,27 +57,27 @@
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @(
FormatsToProcess = @(
'EntraReporter.RoleAssignment.Format.ps1xml'
)

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
FunctionsToExport = @(
FunctionsToExport = @(
'Get-EntraIdLevel',
'Get-EntraIdRoleAssignment'
)

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
CmdletsToExport = @()

# Variables to export from this module
# VariablesToExport = '*'

# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export.
AliasesToExport = @()
AliasesToExport = @()

# DSC resources to export from this module
# DscResourcesToExport = @()
Expand All @@ -89,7 +89,7 @@
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
PrivateData = @{

PSData = @{

Expand All @@ -106,7 +106,7 @@
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = 'https://github.com/kovergard/EntraReporter/blob/main/changelog.md'
ReleaseNotes = 'https://github.com/kovergard/EntraReporter/blob/main/CHANGELOG.md'

# Prerelease string of this module
# Prerelease = ''
Expand Down
14 changes: 7 additions & 7 deletions EntraReporter/functions/Get-EntraIdRoleAssignment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function Get-EntraIdRoleAssignment {
PrincipalId = $Schedule.principal.id
PrincipalDisplayName = $Schedule.principal.displayName
AssignmentType = 'Group'
Scope = $administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId } | Select-Object -ExpandProperty displayName
Scope = ($administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId }).displayName
PrincipalState = $GroupState
PrincipalStartTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.startDateTime } else { $null }
PrincipalEndTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.expiration.endDateTime } else { $null }
Expand Down Expand Up @@ -235,7 +235,7 @@ function Get-EntraIdRoleAssignment {
PrincipalId = $Schedule.principal.id
PrincipalDisplayName = $Schedule.principal.displayName
AssignmentType = 'User'
Scope = $administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId } | Select-Object -ExpandProperty displayName
Scope = ($administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId }).displayName
PrincipalState = $State
PrincipalStartTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.startDateTime } else { $null }
PrincipalEndTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.expiration.endDateTime } else { $null }
Expand All @@ -256,7 +256,7 @@ function Get-EntraIdRoleAssignment {
PrincipalId = $Schedule.principal.id
PrincipalDisplayName = $Schedule.principal.displayName
AssignmentType = 'Service principal'
Scope = $administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId } | Select-Object -ExpandProperty displayName
Scope = ($administrativeUnits | Where-Object { $_.directoryScopeId -eq $Schedule.directoryScopeId }).displayName
PrincipalState = $State
PrincipalStartTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.startDateTime } else { $null }
PrincipalEndTime = if ($Schedule.scheduleInfo.expiration.endDateTime) { $Schedule.scheduleInfo.expiration.endDateTime } else { $null }
Expand Down Expand Up @@ -308,9 +308,9 @@ function Get-EntraIdRoleAssignment {

# Fetch all role schedules, assigned and eligible.
Write-Progress -Activity $activityName -Status 'Fetching assigned role schedules' -PercentComplete 20
$roleAssignmentSchedules = Invoke-MgGraphRequest -Method GET -Uri "v1.0/roleManagement/directory/roleAssignmentSchedules?`$filter=assignmentType eq 'Assigned'&`$expand=principal,roleDefinition" -Verbose:$false | Select-Object -ExpandProperty value
$roleAssignmentSchedules = (Invoke-MgGraphRequest -Method GET -Uri "v1.0/roleManagement/directory/roleAssignmentSchedules?`$filter=assignmentType eq 'Assigned'&`$expand=principal,roleDefinition" -Verbose:$false)['value']
Write-Progress -Activity $activityName -Status 'Fetching eligible role schedules' -PercentComplete 40
$roleEligibilitySchedules = Invoke-MgGraphRequest -Method GET -Uri "v1.0/roleManagement/directory/roleEligibilitySchedules?`$expand=principal,roleDefinition" -Verbose:$false | Select-Object -ExpandProperty value
$roleEligibilitySchedules = (Invoke-MgGraphRequest -Method GET -Uri "v1.0/roleManagement/directory/roleEligibilitySchedules?`$expand=principal,roleDefinition" -Verbose:$false)['value']

# If Rolename has been specified, filter out any assigments not in the specified role(s).
if ($RoleName) {
Expand All @@ -324,8 +324,8 @@ function Get-EntraIdRoleAssignment {

# Extract unique group IDs from all role schedules for prefetching group schedule information in bulk to reduce number of API calls later on.
$groupIds = @()
$groupIds += $roleAssignmentSchedules | Select-Object -ExpandProperty principal | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.group' } | Select-Object -ExpandProperty Id
$groupIds += $roleEligibilitySchedules | Select-Object -ExpandProperty principal | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.group' } | Select-Object -ExpandProperty Id
$groupIds += ($roleAssignmentSchedules.principal | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.group' }).Id
$groupIds += ($roleEligibilitySchedules.principal | Where-Object { $_.'@odata.type' -eq '#microsoft.graph.group' }).Id
$groupIds = $groupIds | Select-Object -Unique

# Prefetch group schedules for all groups used groups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Get-AdministrativeUnit {
$results = @()

# Get all administrative units from directory to avoid making multiple calls
$allAdministrativeUnits = Invoke-MgGraphRequest -Method GET -Uri 'v1.0/directory/administrativeUnits' -Verbose:$false | Select-Object -ExpandProperty value
$allAdministrativeUnits = (Invoke-MgGraphRequest -Method GET -Uri 'v1.0/directory/administrativeUnits' -Verbose:$false)['value']
foreach ($adminUnit in $allAdministrativeUnits) {
$results += [pscustomobject] @{
directoryScopeId = "/administrativeUnits/$($adminUnit.id)"
Expand Down