M365FoundationsCISReport

Syntax

Get-AdminRoleUserLicense [-SkipGraphConnection] [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
-SkipGraphConnection A switch parameter that, when set, skips the connection to Microsoft Graph if already established. This is useful for batch processing or when used within scripts where multiple calls are made and the connection is managed externally. false false False

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None. You cannot pipe objects to Get-AdminRoleUserLicense.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • PSCustomObject Returns a custom object for each user with administrative roles that includes the following properties: RoleName, UserName, UserPrincipalName, UserId, HybridUser, and Licenses.

Note

Creation Date: 2024-04-15 Purpose/Change: Initial function development to support Microsoft 365 administrative role auditing.

Examples

EXAMPLE 1
Get-AdminRoleUserLicense
This example retrieves all administrative role users along with their licenses by connecting to Microsoft Graph using the default scopes.
EXAMPLE 2
Get-AdminRoleUserLicense -SkipGraphConnection
This example retrieves all administrative role users along with their licenses without attempting to connect to Microsoft Graph, assuming that the connection is already established.

Top of page

Links

Parameters

Name Alias Description Required? Pipeline Input Default Value
-Confirm cf false false
-DoNotConnect None false false
-DoNotDisconnect None false false
-DomainName None true false
-ELevel None true false
-IncludeIG1 None true false
-IncludeIG2 None true false
-IncludeIG3 None true false
-IncludeRecommendation None true false
-NoModuleCheck None false false
-ProfileLevel None true false
-SkipRecommendation None true false
-TenantAdminUrl None true false
-WhatIf wi false false

Syntax

Sync-CISExcelAndCsvData [-ExcelPath] <String> [-WorksheetName] <String> [-CsvPath] <String> [-SkipUpdate] [<CommonParameters>]

Parameters

Name Alias Description Required? Pipeline Input Default Value
-ExcelPath The path to the Excel file that contains the original data. This parameter is mandatory. true false
-WorksheetName The name of the worksheet within the Excel file that contains the data to be synchronized. This parameter is mandatory. true false
-CsvPath The path to the CSV file containing data to be merged with the Excel data. This parameter is mandatory. true false
-SkipUpdate If specified, the function will return the merged data object without updating the Excel worksheet. This is useful for previewing the merged data. false false False

Inputs

The input type is the type of the objects that you can pipe to the cmdlet.

  • None. You cannot pipe objects to Sync-CISExcelAndCsvData.

Outputs

The output type is the type of the objects that the cmdlet emits.

  • Object[] If the SkipUpdate switch is used, the function returns an array of custom objects representing the merged data.

Note

- Ensure that the 'ImportExcel' module is installed and up to date. - It is recommended to backup the Excel file before running this script to prevent accidental data loss. - This function is part of the CIS Excel and CSV Data Management Toolkit.

Examples

EXAMPLE 1
Sync-CISExcelAndCsvData -ExcelPath "path\to\excel.xlsx" -WorksheetName "DataSheet" -CsvPath "path\to\data.csv"
Merges data from 'data.csv' into 'excel.xlsx' on the 'DataSheet' worksheet and updates the worksheet with the merged data.
EXAMPLE 2
$mergedData = Sync-CISExcelAndCsvData -ExcelPath "path\to\excel.xlsx" -WorksheetName "DataSheet" -CsvPath "path\to\data.csv" -SkipUpdate
Retrieves the merged data object for preview without updating the Excel worksheet.

Top of page

Links