This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using namespace System.Management.Automation | |
function Set-StandardMember { | |
[CmdletBinding()] | |
param( | |
[parameter(Mandatory, ValueFromPipeline)] | |
[object] $InputObject, | |
[parameter(Mandatory)] | |
[string[]] $DefaultProperties |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"> | |
<Obj RefId="0"> | |
<TN RefId="0"> | |
<T>System.Collections.Hashtable</T> | |
<T>System.Object</T> | |
</TN> | |
<DCT> | |
<En> | |
<S N="Key">SourceApp</S> | |
<Obj N="Value" RefId="1"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Linq; | |
using System.Threading.Tasks; | |
using DotNetCoreRazor_MSGraph.Graph; | |
using Microsoft.AspNetCore.Authorization; | |
using Microsoft.AspNetCore.Mvc; | |
using Microsoft.AspNetCore.Mvc.RazorPages; | |
using Microsoft.Extensions.Logging; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Remove-GraphGroupMember { | |
<# | |
.SYNOPSIS | |
Removes Members from Azure AD Security Group or Microsoft 365 Group | |
.DESCRIPTION | |
Removes Members from Azure AD Security Group or Microsoft 365 Group | |
.PARAMETER UserID | |
This is the User's ID. This is the user to be removed from the group |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Find-MgGraphCommand | |
Find-MgGraphPermission | |
Get-MgSecurityAction | |
Get-MgSecurityAlert | |
Get-MgSecurityAttackSimulation | |
Get-MgSecurityCloudAppSecurityProfile | |
Get-MgSecurityDomainSecurityProfile | |
Get-MgSecurityFileSecurityProfile | |
Get-MgSecurityHostSecurityProfile | |
Get-MgSecurityIncident |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Usage | |
# GUI that saves and encrypts credentials that generate Bearer Token (Run this once per app registration) | |
# If application-only Graph API Permision, click "Export Tenant Config" button | |
# If also (or only) delegate permissions click both "Export Tenant Config" and "Export Tenant Credentials" buttons | |
# Copy the last command output from the GUI. This is how you connect each time. | |
Add-GraphConfig -Tenant Contoso -workload DescribePermissions | |
# GUI will provide exactly what to use to connect | |
Connect-Graph -Tenant Contoso -Workload DescribePermissions #use -Delegated switch if needed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Connect-GraphRefresh { | |
[CmdletBinding()] | |
param ( | |
) | |
if (-not $Delegated) { | |
Connect-Graph -Tenant $Script:Tenant -Workload $Script:Workload -Delegated:$Script:Delegated | |
} | |
else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Connect-Graph { | |
<# | |
.SYNOPSIS | |
Connect to Graph with delegate or application only permissions | |
.DESCRIPTION | |
Connect to Graph with delegate or application only permissions | |
.PARAMETER Tenant | |
** Use NameOfTenant if the tenant domain is NameOfTenant.onmicrosoft.com ** |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Add-GraphConfig { | |
<# | |
.SYNOPSIS | |
Create the encrypted file needed to connect to Microsoft Graph using: Connect-Graph | |
.DESCRIPTION | |
Create the encrypted file needed to connect to Microsoft Graph using: Connect-Graph | |
.PARAMETER Tenant | |
use NameOfTenant if the tenant domain is NameOfTenant.onmicrosoft.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Hide-PSGCalendar { | |
<# | |
.SYNOPSIS | |
if Owner of Calendar... | |
1. Remove as Owner from Calendar, if not chosen by client in PrimaryOwnerFilePath | |
2. Add as Editor to Calendar | |
3. Hide Calendar if #1 and #2 does not work | |
.DESCRIPTION |
NewerOlder