manifests/collectors/Identity/Users.psd1

#
# GENERATED by scripts/ConvertTo-ScoutCollectorDefinition.ps1 from Modules/Public/InventoryModules/Identity/Users.ps1 (AB#5660).
# Field expressions are copied verbatim from the original collector and evaluate in an
# equivalent scope -- see docs/design/decisions/declarative-collectors.md.
# Review before trusting; regenerate rather than hand-patch if the source collector changes.
#
@{
    ResourceTypes = @(
        'entra/users'
    )

    ResourceTypeMatching = 'Grouped'

    AdditionalFilter = $null

    FilterPreamble = ''

    RowLoopVariable = '1'

    Preamble = @'
$ResUCount = 1
            $data = $1.properties
 
            $licenseCount = 0
            if ($null -ne $data.assignedLicenses) {
                $licenseCount = @($data.assignedLicenses).Count
            }
'@


    AdditionalRowLoops = @()

    TagLoop = $null

    Fields = @(
        @{
            Name = 'ID'
            Expression = '$1.id'
        }
        @{
            Name = 'Tenant ID'
            Expression = '$1.tenantId'
        }
        @{
            Name = 'Display Name'
            Expression = '$data.displayName'
        }
        @{
            Name = 'User Principal Name'
            Expression = '$data.userPrincipalName'
        }
        @{
            Name = 'User Type'
            Expression = '$data.userType'
        }
        @{
            Name = 'Account Enabled'
            Expression = '$data.accountEnabled'
        }
        @{
            Name = 'Created DateTime'
            Expression = '$data.createdDateTime'
        }
        @{
            Name = 'Last Password Change'
            Expression = '$data.lastPasswordChangeDateTime'
        }
        @{
            Name = 'Assigned License Count'
            Expression = '$licenseCount'
        }
        @{
            Name = 'On-Premises Sync'
            Expression = 'if ($data.onPremisesSyncEnabled) { ''Yes'' } else { ''No'' }'
        }
        @{
            Name = 'Department'
            Expression = '$data.department'
        }
        @{
            Name = 'Job Title'
            Expression = '$data.jobTitle'
        }
        @{
            Name = 'Mail'
            Expression = '$data.mail'
        }
        @{
            Name = 'Resource U'
            Expression = '$ResUCount'
        }
    )

    Export = @{
        WorksheetName = 'Entra Users'
        TableNamePrefix = 'EntraUsersTable_'
        Columns = @(
            'Display Name'
            'User Principal Name'
            'User Type'
            'Account Enabled'
            'Created DateTime'
            'Last Password Change'
            'Assigned License Count'
            'On-Premises Sync'
            'Department'
            'Job Title'
            'Mail'
            'Resource U'
        )
        TagColumns = @()
        TagColumnsBefore = $null
        NumberFormat = '0'
        ConditionalText = @(
            'New-ConditionalText False -Range F:F'
            'New-ConditionalText 0 -Range I:I'
        )
    }

    SourceCollector = 'Modules/Public/InventoryModules/Identity/Users.ps1'
}