1222 lines
65 KiB
HTML
1222 lines
65 KiB
HTML
<!DOCTYPE html>
|
|
<!--
|
|
<auto-generated>
|
|
<synopsis>
|
|
This code was generated by a tool. on: 08/04/2024 14:28:03
|
|
</synopsis>
|
|
<description>
|
|
If you'd like to regenerate the documentation, please open up powershell and run
|
|
|
|
> .\psDoc.ps1 -moduleName NameOfYourModule
|
|
|
|
If the documentation is incomplete, or eronious,
|
|
please edit the comments at the top of the module method within it's respecive .ps1 file.
|
|
</description>
|
|
</auto-generated>
|
|
-->
|
|
<html lang="en">
|
|
<head>
|
|
<title>M365FoundationsCISReport Documentation</title>
|
|
<meta charset="utf-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shCore.min.css" rel="stylesheet" charset="utf-8">
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/styles/shCoreDefault.min.css" rel="stylesheet" charset="utf-8">
|
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" charset="utf-8">
|
|
|
|
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
|
<!--[if lt IE 9]>
|
|
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
|
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
|
<![endif]-->
|
|
<style>
|
|
.syntaxhighlighter {
|
|
overflow-y: hidden !important;
|
|
overflow-x: auto !important;
|
|
}
|
|
pre {
|
|
min-height: 30px;
|
|
}
|
|
.navbar-nav {
|
|
height: 100%;
|
|
overflow-y: auto;
|
|
}
|
|
.form-group {
|
|
padding-top: 12px;
|
|
padding-left: 12px;
|
|
padding-right: 12px;
|
|
}
|
|
.sidebar-nav .navbar-header {
|
|
float: none;
|
|
}
|
|
.sidebar-nav .navbar li a {
|
|
padding-top: 4px;
|
|
padding-bottom: 4px;
|
|
}
|
|
@media (min-width: 768px) {
|
|
.sidebar-nav .navbar .navbar-collapse {
|
|
padding: 0;
|
|
max-height: none;
|
|
}
|
|
.sidebar-nav .navbar ul {
|
|
float: none;
|
|
}
|
|
.sidebar-nav .navbar ul:not {
|
|
display: block;
|
|
}
|
|
.sidebar-nav .navbar li {
|
|
float: none;
|
|
display: block;
|
|
}
|
|
}
|
|
</style>
|
|
|
|
</head>
|
|
<body>
|
|
<div class="container-fluid">
|
|
<div class="row-fluid">
|
|
<div><h1>M365FoundationsCISReport</h1></div>
|
|
</div>
|
|
<div class="row-fluid">
|
|
<div class="col-lg-3 col-md-4 col-sm-5 col-xs-12">
|
|
<div class="sidebar-nav">
|
|
<div class="navbar navbar-default" role="navigation">
|
|
<div class="navbar-header">
|
|
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".sidebar-navbar-collapse">
|
|
<span class="sr-only">Toggle</span>
|
|
<span class="icon-bar"></span>
|
|
<span class="icon-bar"></span>
|
|
</button>
|
|
<span class="visible-xs navbar-brand">click menu to open</span>
|
|
</div>
|
|
<div class="navbar-collapse collapse sidebar-navbar-collapse">
|
|
|
|
<div class="form-group">
|
|
<input class="form-control" id="searchinput" type="search" placeholder="Filter..." />
|
|
</div>
|
|
|
|
<ul class="nav navbar-nav list-group" id="searchList">
|
|
<li class="nav-menu list-group-item"><a href="#Export-M365SecurityAuditTable">Export-M365SecurityAuditTable</a></li>
|
|
<li class="nav-menu list-group-item"><a href="#Get-AdminRoleUserLicense">Get-AdminRoleUserLicense</a></li>
|
|
<li class="nav-menu list-group-item"><a href="#Get-MFAStatus">Get-MFAStatus</a></li>
|
|
<li class="nav-menu list-group-item"><a href="#Grant-M365SecurityAuditConsent">Grant-M365SecurityAuditConsent</a></li>
|
|
<li class="nav-menu list-group-item"><a href="#Invoke-M365SecurityAudit">Invoke-M365SecurityAudit</a></li>
|
|
<li class="nav-menu list-group-item"><a href="#New-M365SecurityAuditAuthObject">New-M365SecurityAuditAuthObject</a></li>
|
|
<li class="nav-menu list-group-item"><a href="#Remove-RowsWithEmptyCSVStatus">Remove-RowsWithEmptyCSVStatus</a></li>
|
|
<li class="nav-menu list-group-item"><a href="#Sync-CISExcelAndCsvData">Sync-CISExcelAndCsvData</a></li>
|
|
</ul>
|
|
</div><!--/.nav-collapse -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-lg-9 col-md-8 col-sm-7 col-xs-12">
|
|
<div id="Export-M365SecurityAuditTable" class="toggle_container">
|
|
<div class="page-header">
|
|
<h2> Export-M365SecurityAuditTable </h2>
|
|
<p>Exports Microsoft 365 security audit results to CSV or Excel files and supports outputting specific test results as objects.</p>
|
|
<p>The Export-M365SecurityAuditTable function exports Microsoft 365 security audit results from an array of CISAuditResult objects or a CSV file.<br>It can export all results to a specified path, output a specific test result as an object, and includes options for exporting results to Excel.<br>Additionally, it computes hashes for the exported files and includes them in the zip archive for verification purposes.</p>
|
|
</div>
|
|
<div>
|
|
<h3> Syntax </h3>
|
|
</div>
|
|
<div class="panel panel-default">
|
|
<div class='panel-body'>
|
|
<pre class="brush: ps">Export-M365SecurityAuditTable [-AuditResults] <CISAuditResult[]> [-OutputTestNumber] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
|
|
|
|
Export-M365SecurityAuditTable [-AuditResults] <CISAuditResult[]> [[-ExportNestedTables]] -ExportPath <String> [-ExportOriginalTests] [-ExportToExcel] [-Prefix <String>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
|
|
|
Export-M365SecurityAuditTable [-CsvPath] <String> [-OutputTestNumber] <String> [-WhatIf] [-Confirm] [<CommonParameters>]
|
|
|
|
Export-M365SecurityAuditTable [-CsvPath] <String> [[-ExportNestedTables]] -ExportPath <String> [-ExportOriginalTests] [-ExportToExcel] [-Prefix <String>] [-WhatIf] [-Confirm] [<CommonParameters>]</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h3> Parameters </h3>
|
|
<table class="table table-striped table-bordered table-condensed visible-on">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th class="visible-lg visible-md">Alias</th>
|
|
<th>Description</th>
|
|
<th class="visible-lg visible-md">Required?</th>
|
|
<th class="visible-lg">Pipeline Input</th>
|
|
<th class="visible-lg">Default Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><nobr>-AuditResults</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>An array of CISAuditResult objects containing the audit results. This parameter is mandatory when exporting from audit results.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-CsvPath</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The path to a CSV file containing the audit results. This parameter is mandatory when exporting from a CSV file.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-OutputTestNumber</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The test number to output as an object. Valid values are "1.1.1", "1.3.1", "6.1.2", "6.1.3", "7.3.4". This parameter is used to output a specific test result.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-ExportNestedTables</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Switch to export all test results. When specified, all test results are exported to the specified path.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-ExportPath</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The path where the CSV or Excel files will be exported. This parameter is mandatory when exporting all tests.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-ExportOriginalTests</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Switch to export the original audit results to a CSV file. When specified, the original test results are exported along with the processed results.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-ExportToExcel</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Switch to export the results to an Excel file. When specified, results are exported in Excel format.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-Prefix</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Add Prefix to filename after date when outputting to excel or csv.<br>Validate that the count of letters in the prefix is less than 5.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">Corp</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-WhatIf</nobr></td>
|
|
<td class="visible-lg visible-md">wi</td>
|
|
<td></td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-Confirm</nobr></td>
|
|
<td class="visible-lg visible-md">cf</td>
|
|
<td></td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
<h3> Inputs </h3>
|
|
<p>The input type is the type of the objects that you can pipe to the cmdlet.</p>
|
|
<ul><li>[CISAuditResult[]] - An array of CISAuditResult objects.
|
|
[string] - A path to a CSV file.</li></ul>
|
|
</div>
|
|
<div>
|
|
<h3> Outputs </h3>
|
|
<p>The output type is the type of the objects that the cmdlet emits.</p>
|
|
<ul><li>[PSCustomObject] - A custom object containing the path to the zip file and its hash.</li></ul>
|
|
</div>
|
|
<div>
|
|
<h3> Examples </h3>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-body'>
|
|
<strong>EXAMPLE 1</strong>
|
|
<pre class="brush: ps">Export-M365SecurityAuditTable -AuditResults $object -OutputTestNumber 6.1.2
|
|
# Outputs the result of test number 6.1.2 from the provided audit results as an object.</pre>
|
|
<div></div>
|
|
<strong>EXAMPLE 2</strong>
|
|
<pre class="brush: ps">Export-M365SecurityAuditTable -ExportNestedTables -AuditResults $object -ExportPath "C:\temp"
|
|
# Exports all audit results to the specified path in CSV format.</pre>
|
|
<div></div>
|
|
<strong>EXAMPLE 3</strong>
|
|
<pre class="brush: ps">Export-M365SecurityAuditTable -CsvPath "C:\temp\auditresultstoday1.csv" -OutputTestNumber 6.1.2
|
|
# Outputs the result of test number 6.1.2 from the CSV file as an object.</pre>
|
|
<div></div>
|
|
<strong>EXAMPLE 4</strong>
|
|
<pre class="brush: ps">Export-M365SecurityAuditTable -ExportNestedTables -CsvPath "C:\temp\auditresultstoday1.csv" -ExportPath "C:\temp"
|
|
# Exports all audit results from the CSV file to the specified path in CSV format.</pre>
|
|
<div></div>
|
|
<strong>EXAMPLE 5</strong>
|
|
<pre class="brush: ps">Export-M365SecurityAuditTable -ExportNestedTables -AuditResults $object -ExportPath "C:\temp" -ExportOriginalTests
|
|
# Exports all audit results along with the original test results to the specified path in CSV format.</pre>
|
|
<div></div>
|
|
<strong>EXAMPLE 6</strong>
|
|
<pre class="brush: ps">Export-M365SecurityAuditTable -ExportNestedTables -CsvPath "C:\temp\auditresultstoday1.csv" -ExportPath "C:\temp" -ExportOriginalTests
|
|
# Exports all audit results from the CSV file along with the original test results to the specified path in CSV format.</pre>
|
|
<div></div>
|
|
<strong>EXAMPLE 7</strong>
|
|
<pre class="brush: ps">Export-M365SecurityAuditTable -ExportNestedTables -AuditResults $object -ExportPath "C:\temp" -ExportToExcel
|
|
# Exports all audit results to the specified path in Excel format.</pre>
|
|
<div></div>
|
|
</div>
|
|
</div>
|
|
<p class='pull-right'><a onclick='document.body.scrollTop = document.documentElement.scrollTop = 0;' style='cursor: pointer;'>Top of page</a>
|
|
<div>
|
|
<h3> Links </h3>
|
|
<div>
|
|
<ul>
|
|
<li class=''><a href='https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Export-M365SecurityAuditTable' target='_blank'>https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Export-M365SecurityAuditTable</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="Get-AdminRoleUserLicense" class="toggle_container">
|
|
<div class="page-header">
|
|
<h2> Get-AdminRoleUserLicense </h2>
|
|
<p>Retrieves user licenses and roles for administrative accounts from Microsoft 365 via the Graph API.</p>
|
|
<p>The Get-AdminRoleUserLicense function connects to Microsoft Graph and retrieves all users who are assigned administrative roles along with their user details and licenses. This function is useful for auditing and compliance checks to ensure that administrators have appropriate licenses and role assignments.</p>
|
|
</div>
|
|
<div>
|
|
<h3> Syntax </h3>
|
|
</div>
|
|
<div class="panel panel-default">
|
|
<div class='panel-body'>
|
|
<pre class="brush: ps">Get-AdminRoleUserLicense [-SkipGraphConnection] [<CommonParameters>]</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h3> Parameters </h3>
|
|
<table class="table table-striped table-bordered table-condensed visible-on">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th class="visible-lg visible-md">Alias</th>
|
|
<th>Description</th>
|
|
<th class="visible-lg visible-md">Required?</th>
|
|
<th class="visible-lg">Pipeline Input</th>
|
|
<th class="visible-lg">Default Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><nobr>-SkipGraphConnection</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>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.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
<h3> Inputs </h3>
|
|
<p>The input type is the type of the objects that you can pipe to the cmdlet.</p>
|
|
<ul><li>None. You cannot pipe objects to Get-AdminRoleUserLicense.</li></ul>
|
|
</div>
|
|
<div>
|
|
<h3> Outputs </h3>
|
|
<p>The output type is the type of the objects that the cmdlet emits.</p>
|
|
<ul><li>PSCustomObject
|
|
Returns a custom object for each user with administrative roles that includes the following properties: RoleName, UserName, UserPrincipalName, UserId, HybridUser, and Licenses.</li></ul>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-heading'>
|
|
<h3 class='panel-title'> Note </h3>
|
|
</div>
|
|
<div class='panel-body'>Creation Date: 2024-04-15
|
|
Purpose/Change: Initial function development to support Microsoft 365 administrative role auditing.</div>
|
|
</div>
|
|
<div>
|
|
<h3> Examples </h3>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-body'>
|
|
<strong>EXAMPLE 1</strong>
|
|
<pre class="brush: ps">Get-AdminRoleUserLicense</pre>
|
|
<div>This example retrieves all administrative role users along with their licenses by connecting to Microsoft Graph using the default scopes.</div>
|
|
<strong>EXAMPLE 2</strong>
|
|
<pre class="brush: ps">Get-AdminRoleUserLicense -SkipGraphConnection</pre>
|
|
<div>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.</div>
|
|
</div>
|
|
</div>
|
|
<p class='pull-right'><a onclick='document.body.scrollTop = document.documentElement.scrollTop = 0;' style='cursor: pointer;'>Top of page</a>
|
|
<div>
|
|
<h3> Links </h3>
|
|
<div>
|
|
<ul>
|
|
<li class=''><a href='https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Get-AdminRoleUserLicense' target='_blank'>https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Get-AdminRoleUserLicense</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="Get-MFAStatus" class="toggle_container">
|
|
<div class="page-header">
|
|
<h2> Get-MFAStatus </h2>
|
|
<p>Retrieves the MFA (Multi-Factor Authentication) status for Azure Active Directory users.</p>
|
|
<p>The Get-MFAStatus function connects to Microsoft Online Service and retrieves the MFA status for all Azure Active Directory users, excluding guest accounts. Optionally, you can specify a single user by their User Principal Name (UPN) to get their MFA status.</p>
|
|
</div>
|
|
<div>
|
|
<h3> Syntax </h3>
|
|
</div>
|
|
<div class="panel panel-default">
|
|
<div class='panel-body'>
|
|
<pre class="brush: ps">Get-MFAStatus [[-UserId] <String>] [-SkipMSOLConnectionChecks] [<CommonParameters>]</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h3> Parameters </h3>
|
|
<table class="table table-striped table-bordered table-condensed visible-on">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th class="visible-lg visible-md">Alias</th>
|
|
<th>Description</th>
|
|
<th class="visible-lg visible-md">Required?</th>
|
|
<th class="visible-lg">Pipeline Input</th>
|
|
<th class="visible-lg">Default Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><nobr>-UserId</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The User Principal Name (UPN) of a specific user to retrieve MFA status for. If not provided, the function retrieves MFA status for all users.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-SkipMSOLConnectionChecks</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td></td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
<h3> Outputs </h3>
|
|
<p>The output type is the type of the objects that the cmdlet emits.</p>
|
|
<ul><li>System.Object
|
|
Returns a sorted list of custom objects containing the following properties:
|
|
- UserPrincipalName
|
|
- DisplayName
|
|
- MFAState
|
|
- MFADefaultMethod
|
|
- MFAPhoneNumber
|
|
- PrimarySMTP
|
|
- Aliases</li></ul>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-heading'>
|
|
<h3 class='panel-title'> Note </h3>
|
|
</div>
|
|
<div class='panel-body'>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.</div>
|
|
</div>
|
|
<div>
|
|
<h3> Examples </h3>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-body'>
|
|
<strong>EXAMPLE 1</strong>
|
|
<pre class="brush: ps">Get-MFAStatus
|
|
Retrieves the MFA status for all Azure Active Directory users.</pre>
|
|
<div></div>
|
|
<strong>EXAMPLE 2</strong>
|
|
<pre class="brush: ps">Get-MFAStatus -UserId "example@domain.com"
|
|
Retrieves the MFA status for the specified user with the UPN "example@domain.com".</pre>
|
|
<div></div>
|
|
</div>
|
|
</div>
|
|
<p class='pull-right'><a onclick='document.body.scrollTop = document.documentElement.scrollTop = 0;' style='cursor: pointer;'>Top of page</a>
|
|
<div>
|
|
<h3> Links </h3>
|
|
<div>
|
|
<ul>
|
|
<li class=''><a href='https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Get-MFAStatus' target='_blank'>https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Get-MFAStatus</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="Grant-M365SecurityAuditConsent" class="toggle_container">
|
|
<div class="page-header">
|
|
<h2> Grant-M365SecurityAuditConsent </h2>
|
|
<p>Grants Microsoft Graph permissions for an auditor.</p>
|
|
<p>This function grants the specified Microsoft Graph permissions to a user, allowing the user to perform audits. It connects to Microsoft Graph, checks if a service principal exists for the client application, creates it if it does not exist, and then grants the specified permissions. Finally, it assigns the app to the user.</p>
|
|
</div>
|
|
<div>
|
|
<h3> Syntax </h3>
|
|
</div>
|
|
<div class="panel panel-default">
|
|
<div class='panel-body'>
|
|
<pre class="brush: ps">Grant-M365SecurityAuditConsent [-UserPrincipalNameForConsent] <String> [-SkipGraphConnection] [-SkipModuleCheck] [-SuppressRevertOutput] [-DoNotDisconnect] [-WhatIf] [-Confirm] [<CommonParameters>]</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h3> Parameters </h3>
|
|
<table class="table table-striped table-bordered table-condensed visible-on">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th class="visible-lg visible-md">Alias</th>
|
|
<th>Description</th>
|
|
<th class="visible-lg visible-md">Required?</th>
|
|
<th class="visible-lg">Pipeline Input</th>
|
|
<th class="visible-lg">Default Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><nobr>-UserPrincipalNameForConsent</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The UPN or ID of the user to grant consent for.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">true (ByValue, ByPropertyName)</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-SkipGraphConnection</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, skips connecting to Microsoft Graph.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-SkipModuleCheck</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, skips the check for the Microsoft.Graph module.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-SuppressRevertOutput</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, suppresses the output of the revert commands.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-DoNotDisconnect</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, does not disconnect from Microsoft Graph after granting consent.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-WhatIf</nobr></td>
|
|
<td class="visible-lg visible-md">wi</td>
|
|
<td></td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-Confirm</nobr></td>
|
|
<td class="visible-lg visible-md">cf</td>
|
|
<td></td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
<h3> Outputs </h3>
|
|
<p>The output type is the type of the objects that the cmdlet emits.</p>
|
|
<ul><li>System.Void</li></ul>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-heading'>
|
|
<h3 class='panel-title'> Note </h3>
|
|
</div>
|
|
<div class='panel-body'>This function requires the Microsoft.Graph module version 2.4.0 or higher.</div>
|
|
</div>
|
|
<div>
|
|
<h3> Examples </h3>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-body'>
|
|
<strong>EXAMPLE 1</strong>
|
|
<pre class="brush: ps">Grant-M365SecurityAuditConsent -UserPrincipalNameForConsent user@example.com</pre>
|
|
<div>Grants Microsoft Graph permissions to user@example.com for the client application with the specified Application ID.</div>
|
|
<strong>EXAMPLE 2</strong>
|
|
<pre class="brush: ps">Grant-M365SecurityAuditConsent -UserPrincipalNameForConsent user@example.com -SkipGraphConnection</pre>
|
|
<div>Grants Microsoft Graph permissions to user@example.com, skipping the connection to Microsoft Graph.</div>
|
|
</div>
|
|
</div>
|
|
<p class='pull-right'><a onclick='document.body.scrollTop = document.documentElement.scrollTop = 0;' style='cursor: pointer;'>Top of page</a>
|
|
<div>
|
|
<h3> Links </h3>
|
|
<div>
|
|
<ul>
|
|
<li class=''><a href='https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Grant-M365SecurityAuditConsent' target='_blank'>https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Grant-M365SecurityAuditConsent</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="Invoke-M365SecurityAudit" class="toggle_container">
|
|
<div class="page-header">
|
|
<h2> Invoke-M365SecurityAudit </h2>
|
|
<p>Invokes a security audit for Microsoft 365 environments.</p>
|
|
<p>The Invoke-M365SecurityAudit cmdlet performs a comprehensive security audit based on the specified parameters.<br>It allows auditing of various configurations and settings within a Microsoft 365 environment in alignment with CIS benchmarks designated "Automatic".</p>
|
|
</div>
|
|
<div>
|
|
<h3> Syntax </h3>
|
|
</div>
|
|
<div class="panel panel-default">
|
|
<div class='panel-body'>
|
|
<pre class="brush: ps">Invoke-M365SecurityAudit [-TenantAdminUrl <String>] [-DomainName <String>] [-ApprovedCloudStorageProviders <String[]>] [-ApprovedFederatedDomains <String[]>] [-DoNotConnect] [-DoNotDisconnect] [-NoModuleCheck] [-DoNotConfirmConnections] [-AuthParams <CISAuthenticationParameters>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
|
|
|
Invoke-M365SecurityAudit [-TenantAdminUrl <String>] [-DomainName <String>] -ELevel <String> -ProfileLevel <String> [-ApprovedCloudStorageProviders <String[]>] [-ApprovedFederatedDomains <String[]>] [-DoNotConnect] [-DoNotDisconnect] [-NoModuleCheck] [-DoNotConfirmConnections] [-AuthParams <CISAuthenticationParameters>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
|
|
|
Invoke-M365SecurityAudit [-TenantAdminUrl <String>] [-DomainName <String>] -IncludeIG1 [-ApprovedCloudStorageProviders <String[]>] [-ApprovedFederatedDomains <String[]>] [-DoNotConnect] [-DoNotDisconnect] [-NoModuleCheck] [-DoNotConfirmConnections] [-AuthParams <CISAuthenticationParameters>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
|
|
|
Invoke-M365SecurityAudit [-TenantAdminUrl <String>] [-DomainName <String>] -IncludeIG2 [-ApprovedCloudStorageProviders <String[]>] [-ApprovedFederatedDomains <String[]>] [-DoNotConnect] [-DoNotDisconnect] [-NoModuleCheck] [-DoNotConfirmConnections] [-AuthParams <CISAuthenticationParameters>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
|
|
|
Invoke-M365SecurityAudit [-TenantAdminUrl <String>] [-DomainName <String>] -IncludeIG3 [-ApprovedCloudStorageProviders <String[]>] [-ApprovedFederatedDomains <String[]>] [-DoNotConnect] [-DoNotDisconnect] [-NoModuleCheck] [-DoNotConfirmConnections] [-AuthParams <CISAuthenticationParameters>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
|
|
|
Invoke-M365SecurityAudit [-TenantAdminUrl <String>] [-DomainName <String>] -IncludeRecommendation <String[]> [-ApprovedCloudStorageProviders <String[]>] [-ApprovedFederatedDomains <String[]>] [-DoNotConnect] [-DoNotDisconnect] [-NoModuleCheck] [-DoNotConfirmConnections] [-AuthParams <CISAuthenticationParameters>] [-WhatIf] [-Confirm] [<CommonParameters>]
|
|
|
|
Invoke-M365SecurityAudit [-TenantAdminUrl <String>] [-DomainName <String>] -SkipRecommendation <String[]> [-ApprovedCloudStorageProviders <String[]>] [-ApprovedFederatedDomains <String[]>] [-DoNotConnect] [-DoNotDisconnect] [-NoModuleCheck] [-DoNotConfirmConnections] [-AuthParams <CISAuthenticationParameters>] [-WhatIf] [-Confirm] [<CommonParameters>]</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h3> Parameters </h3>
|
|
<table class="table table-striped table-bordered table-condensed visible-on">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th class="visible-lg visible-md">Alias</th>
|
|
<th>Description</th>
|
|
<th class="visible-lg visible-md">Required?</th>
|
|
<th class="visible-lg">Pipeline Input</th>
|
|
<th class="visible-lg">Default Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><nobr>-TenantAdminUrl</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The URL of the tenant admin. If not specified, none of the SharePoint Online tests will run.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-DomainName</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The domain name of the Microsoft 365 environment to test. It is optional and will trigger various tests to run only for the specified domain.<br> Tests Affected: 2.1.9/Test-EnableDKIM, 1.3.1/Test-PasswordNeverExpirePolicy, 2.1.4/Test-SafeAttachmentsPolicy</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-ELevel</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Specifies the E-Level (E3 or E5) for the audit. This parameter is optional and can be combined with the ProfileLevel parameter.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-ProfileLevel</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Specifies the profile level (L1 or L2) for the audit. This parameter is mandatory, but only when ELevel is selected. Otherwise it is not required.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-IncludeIG1</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, includes tests where IG1 is true.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-IncludeIG2</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, includes tests where IG2 is true.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-IncludeIG3</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, includes tests where IG3 is true.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-IncludeRecommendation</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Specifies specific recommendations to include in the audit. Accepts an array of recommendation numbers.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-SkipRecommendation</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Specifies specific recommendations to exclude from the audit. Accepts an array of recommendation numbers.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-ApprovedCloudStorageProviders</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Specifies the approved cloud storage providers for the audit. Accepts an array of cloud storage provider names for test 8.1.1/Test-TeamsExternalFileSharing.<br> Acceptable values: 'GoogleDrive', 'ShareFile', 'Box', 'DropBox', 'Egnyte'</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">@()</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-ApprovedFederatedDomains</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Specifies the approved federated domains for the audit test 8.2.1/Test-TeamsExternalAccess. Accepts an array of allowed domain names.<br> Additional Tests may include this parameter in the future.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-DoNotConnect</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, the cmdlet will not establish a connection to Microsoft 365 services.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-DoNotDisconnect</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, the cmdlet will not disconnect from Microsoft 365 services after execution.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-NoModuleCheck</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, the cmdlet will not check for the presence of required modules.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-DoNotConfirmConnections</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>If specified, the cmdlet will not prompt for confirmation before proceeding with established connections and will disconnect from all of them.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg">False</td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-AuthParams</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Specifies an authentication object containing parameters for application-based authentication. If provided, this will be used for connecting to services.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-WhatIf</nobr></td>
|
|
<td class="visible-lg visible-md">wi</td>
|
|
<td></td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-Confirm</nobr></td>
|
|
<td class="visible-lg visible-md">cf</td>
|
|
<td></td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
<h3> Inputs </h3>
|
|
<p>The input type is the type of the objects that you can pipe to the cmdlet.</p>
|
|
<ul><li>None. You cannot pipe objects to Invoke-M365SecurityAudit.</li></ul>
|
|
</div>
|
|
<div>
|
|
<h3> Outputs </h3>
|
|
<p>The output type is the type of the objects that the cmdlet emits.</p>
|
|
<ul><li>CISAuditResult[]
|
|
The cmdlet returns an array of CISAuditResult objects representing the results of the security audit.</li></ul>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-heading'>
|
|
<h3 class='panel-title'> Note </h3>
|
|
</div>
|
|
<div class='panel-body'>- This module is based on CIS benchmarks.
|
|
- Governed by the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
|
|
- Commercial use is not permitted. This module cannot be sold or used for commercial purposes.
|
|
- Modifications and sharing are allowed under the same license.
|
|
- For full license details, visit: https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en
|
|
- Register for CIS Benchmarks at: https://www.cisecurity.org/cis-benchmarks</div>
|
|
</div>
|
|
<div>
|
|
<h3> Examples </h3>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-body'>
|
|
<strong>EXAMPLE 1</strong>
|
|
<pre class="brush: ps">Invoke-M365SecurityAudit</pre>
|
|
<div>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</div>
|
|
<strong>EXAMPLE 2</strong>
|
|
<pre class="brush: ps">Invoke-M365SecurityAudit -TenantAdminUrl "https://contoso-admin.sharepoint.com" -DomainName "contoso.com" -ELevel "E5" -ProfileLevel "L1"</pre>
|
|
<div>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</div>
|
|
<strong>EXAMPLE 3</strong>
|
|
<pre class="brush: ps">Invoke-M365SecurityAudit -TenantAdminUrl "https://contoso-admin.sharepoint.com" -DomainName "contoso.com" -IncludeIG1</pre>
|
|
<div>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</div>
|
|
<strong>EXAMPLE 4</strong>
|
|
<pre class="brush: ps">Invoke-M365SecurityAudit -TenantAdminUrl "https://contoso-admin.sharepoint.com" -DomainName "contoso.com" -SkipRecommendation '1.1.3', '2.1.1'</pre>
|
|
<div>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</div>
|
|
<strong>EXAMPLE 5</strong>
|
|
<pre class="brush: ps">$auditResults = Invoke-M365SecurityAudit -TenantAdminUrl "https://contoso-admin.sharepoint.com" -DomainName "contoso.com"
|
|
PS> Export-M365SecurityAuditTable -AuditResults $auditResults -ExportPath "C:\temp" -ExportOriginalTests -ExportAllTests</pre>
|
|
<div>Or:
|
|
PS> $auditResults | Export-Csv -Path "auditResults.csv" -NoTypeInformation
|
|
|
|
Captures the audit results into a variable and exports them to a CSV file (Nested tables will be truncated).
|
|
Output:
|
|
CISAuditResult[]
|
|
auditResults.csv</div>
|
|
<strong>EXAMPLE 6</strong>
|
|
<pre class="brush: ps">Invoke-M365SecurityAudit -WhatIf</pre>
|
|
<div>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".</div>
|
|
</div>
|
|
</div>
|
|
<p class='pull-right'><a onclick='document.body.scrollTop = document.documentElement.scrollTop = 0;' style='cursor: pointer;'>Top of page</a>
|
|
<div>
|
|
<h3> Links </h3>
|
|
<div>
|
|
<ul>
|
|
<li class=''><a href='https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Invoke-M365SecurityAudit' target='_blank'>https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Invoke-M365SecurityAudit</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="New-M365SecurityAuditAuthObject" class="toggle_container">
|
|
<div class="page-header">
|
|
<h2> New-M365SecurityAuditAuthObject </h2>
|
|
<p>Creates a new CISAuthenticationParameters object for Microsoft 365 authentication.</p>
|
|
<p>The New-M365SecurityAuditAuthObject function constructs a new CISAuthenticationParameters object<br>containing the necessary credentials and URLs for authenticating to various Microsoft 365 services.<br>It validates input parameters to ensure they conform to expected formats and length requirements.<br>An app registration in Azure AD with the required permissions to EXO, SPO, MSTeams and MgGraph is needed.</p>
|
|
</div>
|
|
<div>
|
|
<h3> Syntax </h3>
|
|
</div>
|
|
<div class="panel panel-default">
|
|
<div class='panel-body'>
|
|
<pre class="brush: ps">New-M365SecurityAuditAuthObject [-ClientCertThumbPrint] <String> [-ClientId] <String> [-TenantId] <String> [-OnMicrosoftUrl] <String> [-SpAdminUrl] <String> [<CommonParameters>]</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h3> Parameters </h3>
|
|
<table class="table table-striped table-bordered table-condensed visible-on">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th class="visible-lg visible-md">Alias</th>
|
|
<th>Description</th>
|
|
<th class="visible-lg visible-md">Required?</th>
|
|
<th class="visible-lg">Pipeline Input</th>
|
|
<th class="visible-lg">Default Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><nobr>-ClientCertThumbPrint</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The thumbprint of the client certificate used for authentication. It must be a 40-character hexadecimal string.<br>This certificate is used to authenticate the application in Azure AD.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-ClientId</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The Client ID (Application ID) of the Azure AD application. It must be a valid GUID format.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-TenantId</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The Tenant ID of the Azure AD directory. It must be a valid GUID format representing your Microsoft 365 tenant.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-OnMicrosoftUrl</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The URL of your onmicrosoft.com domain. It should be in the format 'example.onmicrosoft.com'.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-SpAdminUrl</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The SharePoint admin URL, which should end with '-admin.sharepoint.com'. This URL is used for connecting to SharePoint Online.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
<h3> Inputs </h3>
|
|
<p>The input type is the type of the objects that you can pipe to the cmdlet.</p>
|
|
<ul><li>None. You cannot pipe objects to this function.</li></ul>
|
|
</div>
|
|
<div>
|
|
<h3> Outputs </h3>
|
|
<p>The output type is the type of the objects that the cmdlet emits.</p>
|
|
<ul><li>CISAuthenticationParameters
|
|
The function returns an instance of the CISAuthenticationParameters class containing the authentication details.</li></ul>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-heading'>
|
|
<h3 class='panel-title'> Note </h3>
|
|
</div>
|
|
<div class='panel-body'>Requires PowerShell 7.0 or later.</div>
|
|
</div>
|
|
<div>
|
|
<h3> Examples </h3>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-body'>
|
|
<strong>EXAMPLE 1</strong>
|
|
<pre class="brush: ps">$authParams = New-M365SecurityAuditAuthObject -ClientCertThumbPrint "ABCDEF1234567890ABCDEF1234567890ABCDEF12" `
|
|
-ClientId "12345678-1234-1234-1234-123456789012" `
|
|
-TenantId "12345678-1234-1234-1234-123456789012" `
|
|
-OnMicrosoftUrl "yourcompany.onmicrosoft.com" `
|
|
-SpAdminUrl "https://yourcompany-admin.sharepoint.com"
|
|
Creates a new CISAuthenticationParameters object with the specified credentials and URLs, validating each parameter's format and length.</pre>
|
|
<div></div>
|
|
</div>
|
|
</div>
|
|
<p class='pull-right'><a onclick='document.body.scrollTop = document.documentElement.scrollTop = 0;' style='cursor: pointer;'>Top of page</a>
|
|
</div>
|
|
<div id="Remove-RowsWithEmptyCSVStatus" class="toggle_container">
|
|
<div class="page-header">
|
|
<h2> Remove-RowsWithEmptyCSVStatus </h2>
|
|
<p>Removes rows from an Excel worksheet where the 'CSV_Status' column is empty and saves the result to a new file.</p>
|
|
<p>The Remove-RowsWithEmptyCSVStatus function imports data from a specified worksheet in an Excel file, checks for the presence of the 'CSV_Status' column, and filters out rows where the 'CSV_Status' column is empty. The filtered data is then exported to a new Excel file with a '-Filtered' suffix added to the original file name.</p>
|
|
</div>
|
|
<div>
|
|
<h3> Syntax </h3>
|
|
</div>
|
|
<div class="panel panel-default">
|
|
<div class='panel-body'>
|
|
<pre class="brush: ps">Remove-RowsWithEmptyCSVStatus [-FilePath] <String> [-WorksheetName] <String> [<CommonParameters>]</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h3> Parameters </h3>
|
|
<table class="table table-striped table-bordered table-condensed visible-on">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th class="visible-lg visible-md">Alias</th>
|
|
<th>Description</th>
|
|
<th class="visible-lg visible-md">Required?</th>
|
|
<th class="visible-lg">Pipeline Input</th>
|
|
<th class="visible-lg">Default Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><nobr>-FilePath</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The path to the Excel file to be processed.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-WorksheetName</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>The name of the worksheet within the Excel file to be processed.</td>
|
|
<td class="visible-lg visible-md">true</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-heading'>
|
|
<h3 class='panel-title'> Note </h3>
|
|
</div>
|
|
<div class='panel-body'>This function requires the ImportExcel module to be installed.</div>
|
|
</div>
|
|
<div>
|
|
<h3> Examples </h3>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-body'>
|
|
<strong>EXAMPLE 1</strong>
|
|
<pre class="brush: ps">Remove-RowsWithEmptyCSVStatus -FilePath "C:\Reports\Report.xlsx" -WorksheetName "Sheet1"
|
|
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.</pre>
|
|
<div></div>
|
|
</div>
|
|
</div>
|
|
<p class='pull-right'><a onclick='document.body.scrollTop = document.documentElement.scrollTop = 0;' style='cursor: pointer;'>Top of page</a>
|
|
</div>
|
|
<div id="Sync-CISExcelAndCsvData" class="toggle_container">
|
|
<div class="page-header">
|
|
<h2> Sync-CISExcelAndCsvData </h2>
|
|
<p>Synchronizes and updates data in an Excel worksheet with new information from a CSV file, including audit dates.</p>
|
|
<p>The Sync-CISExcelAndCsvData function merges and updates data in a specified Excel worksheet from a CSV file. This includes adding or updating fields for connection status, details, failure reasons, and the date of the update. It's designed to ensure that the Excel document maintains a running log of changes over time, ideal for tracking remediation status and audit history.</p>
|
|
</div>
|
|
<div>
|
|
<h3> Syntax </h3>
|
|
</div>
|
|
<div class="panel panel-default">
|
|
<div class='panel-body'>
|
|
<pre class="brush: ps">Sync-CISExcelAndCsvData [[-ExcelPath] <String>] [[-CsvPath] <String>] [[-SheetName] <String>] [<CommonParameters>]</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<h3> Parameters </h3>
|
|
<table class="table table-striped table-bordered table-condensed visible-on">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th class="visible-lg visible-md">Alias</th>
|
|
<th>Description</th>
|
|
<th class="visible-lg visible-md">Required?</th>
|
|
<th class="visible-lg">Pipeline Input</th>
|
|
<th class="visible-lg">Default Value</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td><nobr>-ExcelPath</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Specifies the path to the Excel file to be updated. This parameter is mandatory.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-CsvPath</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Specifies the path to the CSV file containing new data. This parameter is mandatory.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
<tr>
|
|
<td><nobr>-SheetName</nobr></td>
|
|
<td class="visible-lg visible-md"></td>
|
|
<td>Specifies the name of the worksheet in the Excel file where data will be merged and updated. This parameter is mandatory.</td>
|
|
<td class="visible-lg visible-md">false</td>
|
|
<td class="visible-lg">false</td>
|
|
<td class="visible-lg"></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<div>
|
|
<h3> Inputs </h3>
|
|
<p>The input type is the type of the objects that you can pipe to the cmdlet.</p>
|
|
<ul><li>System.String
|
|
The function accepts strings for file paths and worksheet names.</li></ul>
|
|
</div>
|
|
<div>
|
|
<h3> Outputs </h3>
|
|
<p>The output type is the type of the objects that the cmdlet emits.</p>
|
|
<ul><li>None
|
|
The function directly updates the Excel file and does not output any objects.</li></ul>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-heading'>
|
|
<h3 class='panel-title'> Note </h3>
|
|
</div>
|
|
<div class='panel-body'>- Ensure that the 'ImportExcel' module is installed and up to date to handle Excel file manipulations.
|
|
- It is recommended to back up the Excel file before running this function to avoid accidental data loss.
|
|
- The CSV file should have columns that match expected headers like 'Connection', 'Details', 'FailureReason', and 'Status' for correct data mapping.</div>
|
|
</div>
|
|
<div>
|
|
<h3> Examples </h3>
|
|
</div>
|
|
<div class='panel panel-default'>
|
|
<div class='panel-body'>
|
|
<strong>EXAMPLE 1</strong>
|
|
<pre class="brush: ps">Sync-CISExcelAndCsvData -ExcelPath "path\to\excel.xlsx" -CsvPath "path\to\data.csv" -SheetName "AuditData"
|
|
Updates the 'AuditData' worksheet in 'excel.xlsx' with data from 'data.csv', adding new information and the date of the update.</pre>
|
|
<div></div>
|
|
</div>
|
|
</div>
|
|
<p class='pull-right'><a onclick='document.body.scrollTop = document.documentElement.scrollTop = 0;' style='cursor: pointer;'>Top of page</a>
|
|
<div>
|
|
<h3> Links </h3>
|
|
<div>
|
|
<ul>
|
|
<li class=''><a href='https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Sync-CISExcelAndCsvData' target='_blank'>https://criticalsolutionsnetwork.github.io/M365FoundationsCISReport/#Sync-CISExcelAndCsvData</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js" ></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.4/js/bootstrap.min.js" charset="utf-8"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shCore.min.js" charset="utf-8"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/SyntaxHighlighter/3.0.83/scripts/shBrushPowerShell.min.js" charset="utf-8"></script>
|
|
<script>
|
|
$(document).ready(function() {
|
|
$(".toggle_container").hide();
|
|
var previousId;
|
|
if(location.hash) {
|
|
var id = location.hash.slice(1); //Get rid of the # mark
|
|
var elementToShow = $("#" + id); //Save local reference
|
|
if(elementToShow.length) { //Check if the element exists
|
|
elementToShow.slideToggle('fast'); //Show the element
|
|
elementToShow.addClass("check_list_selected"); //Add class to element (the link)
|
|
}
|
|
previousId = id;
|
|
}
|
|
|
|
$('.nav-menu a, .psLink a').click(function() {
|
|
$(".sidebar-navbar-collapse").collapse('hide');
|
|
$('.toggle_container').hide(); // Hide all
|
|
var elem = $(this).prop("hash");
|
|
$(elem).toggle('fast'); // Show HREF/to/ID one
|
|
history.pushState({}, '', $(this).attr("href"));
|
|
window.scrollTo(0, 0);
|
|
return false;
|
|
});
|
|
SyntaxHighlighter.defaults['toolbar'] = false;
|
|
SyntaxHighlighter.defaults['gutter'] = false;
|
|
SyntaxHighlighter.all();
|
|
|
|
$('#searchList').btsListFilter('#searchinput', {itemChild: 'a', initial: false, resetOnBlur: true});
|
|
|
|
$(document).keyup(function( e ) {
|
|
if(!$('#searchinput').is(':focus') && e.which >= 65 && e.which <= 90 ){
|
|
$('#searchinput').val(String.fromCharCode(e.keyCode));
|
|
$('#searchinput').focus();
|
|
}
|
|
});
|
|
$(document).click(function() {
|
|
$('#searchinput').blur();
|
|
});
|
|
});
|
|
</script>
|
|
<!-- bootstrap-list-filter.min.js - removed as external resource and added as content -->
|
|
<script>
|
|
/*
|
|
* bootstrap-list-filter v0.1.7 - 2015-03-30
|
|
*
|
|
* Copyright 2015 Stefano Cudini
|
|
* stefano.cudini@gmail.com
|
|
* http://labs.easyblog.it/
|
|
*
|
|
* Licensed under the MIT license.
|
|
*
|
|
* Demos:
|
|
* http://labs.easyblog.it/bootstrap-list-filter/
|
|
*
|
|
* Source:
|
|
* git@github.com:stefanocudini/bootstrap-list-filter.git
|
|
*
|
|
*/
|
|
!function(a){a.fn.btsListFilter=function(b,c){function d(a,b){return a.replace(/\{ *([\w_]+) *\}/g,function(a,c){return b[c]||""})}function e(a,b){var c;return b=b||300,function(){var d=this,e=arguments;clearTimeout(c),c=setTimeout(function(){a.apply(d,Array.prototype.slice.call(e))},b)}}var f,g=this,h=a(this),i=a(b),j=h;return c=a.extend({delay:300,minLength:1,initial:!0,eventKey:"keyup",resetOnBlur:!0,sourceData:null,sourceTmpl:'<a class="list-group-item" href="#"><span>{title}</span></a>',sourceNode:function(a){return d(c.sourceTmpl,a)},emptyNode:function(){return'<a class="list-group-item well" href="#"><span>No Results</span></a>'},itemEl:".list-group-item",itemChild:null,itemFilter:function(b,d){d=d&&d.replace(new RegExp("[({[^.$*+?\\]})]","g"),"");var e=a(b).text(),f=c.initial?"^":"",g=new RegExp(f+d,"i");return g.test(e)}},c),i.on(c.eventKey,e(function(){var b=a(this).val();c.itemEl&&(j=h.find(c.itemEl)),c.itemChild&&(j=j.find(c.itemChild));var d=j.filter(function(){return c.itemFilter.call(g,this,b)}),e=j.not(d);c.itemChild&&(d=d.parents(c.itemEl),e=e.parents(c.itemEl).hide()),""!==b&&b.length>=c.minLength?(d.show(),e.hide(),"function"===a.type(c.sourceData)?(d.hide(),e.hide(),f&&(a.isFunction(f.abort)?f.abort():a.isFunction(f.stop)&&f.stop()),f=c.sourceData.call(g,b,function(b){if(f=null,d.hide(),e.hide(),h.find(".bts-dynamic-item").remove(),b&&0!==b.length)for(var i in b)a(c.sourceNode.call(g,b[i])).addClass("bts-dynamic-item").appendTo(h);else a(c.emptyNode.call(g)).addClass("bts-dynamic-item").appendTo(h)})):0===d.length&&a(c.emptyNode.call(g)).addClass("bts-dynamic-item").appendTo(h)):(d.show(),e.show(),h.find(".bts-dynamic-item").remove())},c.delay)),c.resetOnBlur&&i.on("blur",function(){a(this).val("").trigger(c.eventKey)}),h}}(jQuery);
|
|
</script>
|
|
</body>
|
|
</html>
|