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 ConvertFrom-Base64Url | |
| { | |
| param | |
| ( | |
| [Parameter(Mandatory = $true)] | |
| [string] | |
| $InputString, | |
| [Parameter(Mandatory = $false,ParameterSetName="AsString")] |
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
| #requires -modules "Microsoft.PowerApps.Administration.PowerShell" | |
| $clientId = $env:CDX_CLIENTID | |
| $tenantId = $env:CDX_TENANTID | |
| [string[]]$scopes = "https://api.powerplatform.com/.default", "openid", "profile offline_access" | |
| $pca = [Microsoft.Identity.Client.PublicClientApplicationBuilder]::Create($clientId).WithAuthority( "https://login.microsoftonline.com/$tenantId", $true). | |
| WithRedirectUri( "http://localhost" ). | |
| Build() |
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
| #requires -Modules "Microsoft.Graph.Authentication" | |
| function Invoke-GraphThreatHuntingQuery | |
| { | |
| [CmdletBinding()] | |
| param | |
| ( | |
| [Parameter(Mandatory=$true)] | |
| $HuntingQuery, |
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
| // ALL AGENT INTERACTIONS PER HOUR | |
| CloudAppEvents | |
| | extend AgentName = tostring((RawEventData).AgentName) | |
| | extend UserName = tostring((RawEventData).UserId) | |
| | where ActionType == 'CopilotInteraction' | |
| | where isnotempty(parse_json(RawEventData).AgentName) | |
| | summarize InteractionsPerHour = count() by UserName, DateHour = format_datetime(bin(datetime_utc_to_local(Timestamp,"America/New_York"), 1h), 'yyyy-MM-dd hh:mm:ss'), AgentName | |
| | project ['Date/Hour (Eastern)'] = DateHour, UserName, AgentName, InteractionsPerHour | |
| | order by ['Date/Hour (Eastern)'], InteractionsPerHour desc |
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
| kind: AdaptiveDialog | |
| beginDialog: | |
| kind: OnGeneratedResponse | |
| id: main | |
| priority: 1 | |
| actions: | |
| - kind: ConditionGroup | |
| id: has-answer-conditions | |
| conditions: | |
| - id: has-answer |
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
| #requires -modules "Microsoft.PowerApps.Administration.PowerShell" | |
| function Get-PowerPlatformEntraHttpConnection | |
| { | |
| [CmdletBinding()] | |
| param | |
| ( | |
| [Parameter(Mandatory=$true)] | |
| [string] | |
| $EnvironmentId, |
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
| #requires -modules "PnP.PowerShell" | |
| # requires SharePoint > application > sites.fullcontrol.all permissions | |
| $sites = "https://m365cpi68930152.sharepoint.com/sites/security-policies1", | |
| "https://m365cpi68930152.sharepoint.com/sites/security-policies2" | |
| $timestamp = Get-Date -Format FileDateTime | |
| foreach( $site in $sites ) |
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
| #requries -modules "Microsoft.PowerApps.Administration.PowerShell" | |
| function Get-AuthorizationHeader | |
| { | |
| [CmdletBinding()] | |
| param | |
| ( | |
| [Parameter(Mandatory=$true)] | |
| [string] | |
| $EnvironmentUrl |
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
| kind: AdaptiveDialog | |
| beginDialog: | |
| kind: OnActivity | |
| id: main | |
| condition: =DateDiff(DateAdd(Coalesce(Global.UserProfile.LastRefreshed,Now()), 1440, TimeUnit.Minutes), Now(),TimeUnit.Minutes) > 0 | |
| type: Message | |
| actions: | |
| - kind: BeginDialog | |
| id: 0FnaSJ | |
| input: {} |
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
| Import-Module -Name "Microsoft.PowerPlatform.EnterprisePolicies" -ErrorAction Stop | |
| Connect-AzAccount | |
| $tenantId = "<YOUR TENANT ID>" | |
| $environmentId = "<ENVIRONMENT ID>" | |
| $hostname = "dc.services.visualstudio.com" | |
| Test-DnsResolution ` | |
| -EnvironmentId $environmentId ` |
NewerOlder