Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Gereral testing enhancements. #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Gereral testing enhancements. #119
Changes from all commits
b18780d
359d289
ab0ef53
1d46257
0f3587a
f5f6d39
84c16ac
39ba3c3
5ff2396
b564458
736997f
c578045
90c5b95
381b8eb
9a299d4
a90df5b
e9bac2f
7e98f77
a874836
917833b
6b135c2
b6423c8
4dd65a0
bad103f
0601996
6b94ee7
e60c985
be68c1d
defcf56
1e75fbd
a141380
011f91c
82df166
ca17343
4e0b20f
e81395b
6dc52f5
968e589
8b91a8c
5c85267
e043668
e6cdae3
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
M365FoundationsCISReport Module
License
This PowerShell module is based on CIS benchmarks and is distributed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. This means:
For full license details, please visit Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Register for and download CIS Benchmarks
Export-M365SecurityAuditTable
Synopsis
Exports M365 security audit results to a CSV file or outputs a specific test result as an object.
Syntax
Parameters
Inputs
Outputs
Examples
EXAMPLE 1
# Output object for a single test number from audit results
EXAMPLE 2
# Export all results from audit results to the specified path
EXAMPLE 3
# Output object for a single test number from CSV
EXAMPLE 4
# Export all results from CSV to the specified path
EXAMPLE 5
# Export all results from audit results to the specified path along with the original tests
EXAMPLE 6
# Export all results from CSV to the specified path along with the original tests
Links
Get-AdminRoleUserLicense
Synopsis
Retrieves user licenses and roles for administrative accounts from Microsoft 365 via the Graph API.
Syntax
Parameters
Inputs
Outputs
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
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.
Links
Get-MFAStatus
Synopsis
Retrieves the MFA (Multi-Factor Authentication) status for Azure Active Directory users.
Syntax
Parameters
Outputs
Note
The function requires the MSOL module to be installed and connected to your tenant. Ensure that you have the necessary permissions to read user and MFA status information.
Examples
EXAMPLE 1
Get-MFAStatus
Retrieves the MFA status for all Azure Active Directory users.
EXAMPLE 2
Retrieves the MFA status for the specified user with the UPN "example@domain.com".
Links
Invoke-M365SecurityAudit
Synopsis
Invokes a security audit for Microsoft 365 environments.
Syntax
Parameters
Inputs
Outputs
Note
Examples
EXAMPLE 1
Invoke-M365SecurityAudit
Performs a security audit using default parameters.
Output:
Status : Fail
ELevel : E3
ProfileLevel: L1
Connection : Microsoft Graph
Rec : 1.1.1
Result : False
Details : Non-compliant accounts:
Username | Roles | HybridStatus | Missing Licence
user1@domain.com| Global Administrator | Cloud-Only | AAD_PREMIUM
user2@domain.com| Global Administrator | Hybrid | AAD_PREMIUM, AAD_PREMIUM_P2
FailureReason: Non-Compliant Accounts: 2
EXAMPLE 2
Performs a security audit for the E5 level and L1 profile in the specified Microsoft 365 environment.
Output:
Status : Fail
ELevel : E5
ProfileLevel: L1
Connection : Microsoft Graph
Rec : 1.1.1
Result : False
Details : Non-compliant accounts:
Username | Roles | HybridStatus | Missing Licence
user1@domain.com| Global Administrator | Cloud-Only | AAD_PREMIUM
user2@domain.com| Global Administrator | Hybrid | AAD_PREMIUM, AAD_PREMIUM_P2
FailureReason: Non-Compliant Accounts: 2
EXAMPLE 3
Performs an audit including all tests where IG1 is true.
Output:
Status : Fail
ELevel : E3
ProfileLevel: L1
Connection : Microsoft Graph
Rec : 1.1.1
Result : False
Details : Non-compliant accounts:
Username | Roles | HybridStatus | Missing Licence
user1@domain.com| Global Administrator | Cloud-Only | AAD_PREMIUM
user2@domain.com| Global Administrator | Hybrid | AAD_PREMIUM, AAD_PREMIUM_P2
FailureReason: Non-Compliant Accounts: 2
EXAMPLE 4
Performs an audit while excluding specific recommendations 1.1.3 and 2.1.1.
Output:
Status : Fail
ELevel : E3
ProfileLevel: L1
Connection : Microsoft Graph
Rec : 1.1.1
Result : False
Details : Non-compliant accounts:
Username | Roles | HybridStatus | Missing Licence
user1@domain.com| Global Administrator | Cloud-Only | AAD_PREMIUM
user2@domain.com| Global Administrator | Hybrid | AAD_PREMIUM, AAD_PREMIUM_P2
FailureReason: Non-Compliant Accounts: 2
EXAMPLE 5
PS> $auditResults | Export-Csv -Path "auditResults.csv" -NoTypeInformation
Captures the audit results into a variable and exports them to a CSV file.
Output:
CISAuditResult[]
auditResults.csv
EXAMPLE 6
Displays what would happen if the cmdlet is run without actually performing the audit.
Output:
What if: Performing the operation "Invoke-M365SecurityAudit" on target "Microsoft 365 environment".
Links
Remove-RowsWithEmptyCSVStatus
Synopsis
Removes rows from an Excel worksheet where the 'CSV_Status' column is empty and saves the result to a new file.
Syntax
Parameters
Note
This function requires the ImportExcel module to be installed.
Examples
EXAMPLE 1
This command imports data from the "Sheet1" worksheet in the "Report.xlsx" file, removes rows where the 'CSV_Status' column is empty, and saves the filtered data to a new file named "Report-Filtered.xlsx" in the same
directory.
Sync-CISExcelAndCsvData
Synopsis
Synchronizes and updates data in an Excel worksheet with new information from a CSV file, including audit dates.
Syntax
Parameters
Inputs
Outputs
Note
Examples
EXAMPLE 1
Updates the 'AuditData' worksheet in 'excel.xlsx' with data from 'data.csv', adding new information and the date of the update.
Links
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.