├── AzSentinelCMDLets.xlsx ├── Azure Sentinel Analytics Rules with Data Sources.xlsx ├── Azure Sentinel incident management using PowerShell.pdf ├── Azure Sentinel management using PowerShell.pdf ├── EBook Examples ├── Analytics Rule Management │ ├── Add a new automated response for the Analytics rule.ps1 │ ├── Count Analytics rules template types.ps1 │ ├── Count all the Analytics rule templates.ps1 │ ├── Create a new custom Analytics Rule.ps1 │ ├── Create new Analytics Rules based on a Template.ps1 │ ├── Disable enabled Analytics rule.ps1 │ ├── Export All Analytics Rule Templates to a CSV File.ps1 │ ├── Export All Analytics Rules to JSON.ps1 │ ├── Export-AllSentinelAnalyticsRulesWithDataConnectors.ps1 │ ├── Filter Analytics rules based on the CreatedDateUtc property.ps1 │ ├── Get Analytics rule action detailed information.ps1 │ ├── Get Analytics rule action.ps1 │ ├── List all Analytics rule templates.ps1 │ ├── List all Analytics rules and group by Severity.ps1 │ ├── List all Analytics rules and sort rules based on the severity.ps1 │ ├── List all Analytics rules where Data Sources contains SecurityEvents.ps1 │ ├── List all Low Severity based Analytics rules.ps1 │ ├── List all enabled Analytics Rules.ps1 │ └── Remove automated response from the Analytics rule.ps1 ├── Bookmark Management │ ├── Get Bookmark.ps1 │ ├── New Bookmark.ps1 │ ├── Remove Bookmark.ps1 │ └── Update Bookmark.ps1 ├── Data Connectors │ ├── Enable Azure Security Center Data Connector.ps1 │ └── Get Data Connectors.ps1 └── Incident Management │ ├── Add a comment to an incident.ps1 │ ├── Create an incident.ps1 │ ├── Get a specific incident.ps1 │ ├── Get all incidents and convert CreatedTimeUTC property to local DateTime.ps1 │ ├── Get all incidents and order by CreatedTimeUTC property.ps1 │ ├── Getting started.ps1 │ ├── List all incidents.ps1 │ ├── Read incident comments.ps1 │ ├── Remove incident.ps1 │ └── Update incident details.ps1 ├── MS Examples ├── Get-AzSentinelAlertRule.txt ├── Get-AzSentinelAlertRuleAction.txt ├── Get-AzSentinelAlertRuleTemplate.txt ├── Get-AzSentinelBookmark.txt ├── Get-AzSentinelDataConnector.txt ├── Get-AzSentinelIncident.txt ├── Get-AzSentinelIncidentComment.txt ├── New-AzSentinelAlertRule.txt ├── New-AzSentinelAlertRuleAction.txt ├── New-AzSentinelBookmark.txt ├── New-AzSentinelDataConnector.txt ├── New-AzSentinelIncident.txt ├── New-AzSentinelIncidentComment.txt ├── New-AzSentinelIncidentOwner.txt ├── Remove-AzSentinelAlertRule.txt ├── Remove-AzSentinelAlertRuleAction.txt ├── Remove-AzSentinelBookmark.txt ├── Remove-AzSentinelDataConnector.txt ├── Remove-AzSentinelIncident.txt ├── Update-AzSentinelAlertRule.txt ├── Update-AzSentinelAlertRuleAction.txt ├── Update-AzSentinelBookmark.txt ├── Update-AzSentinelDataConnector.txt └── Update-AzSentinelIncident.txt └── README.md /AzSentinelCMDLets.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kaidja/AzSentinelPowerShell/9faeb428d80a74c3e0f70592db89d1a6a26f66cf/AzSentinelCMDLets.xlsx -------------------------------------------------------------------------------- /Azure Sentinel Analytics Rules with Data Sources.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kaidja/AzSentinelPowerShell/9faeb428d80a74c3e0f70592db89d1a6a26f66cf/Azure Sentinel Analytics Rules with Data Sources.xlsx -------------------------------------------------------------------------------- /Azure Sentinel incident management using PowerShell.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kaidja/AzSentinelPowerShell/9faeb428d80a74c3e0f70592db89d1a6a26f66cf/Azure Sentinel incident management using PowerShell.pdf -------------------------------------------------------------------------------- /Azure Sentinel management using PowerShell.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Kaidja/AzSentinelPowerShell/9faeb428d80a74c3e0f70592db89d1a6a26f66cf/Azure Sentinel management using PowerShell.pdf -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Add a new automated response for the Analytics rule.ps1: -------------------------------------------------------------------------------- 1 | #Add a new automated response for the Analytics rule 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | 7 | $LogicAppsInfo = @{ 8 | ResourceGroupName = "RG-PROD-IT-LOGIC-APPS-WE" 9 | Name = "Post-Message-Teams" 10 | } 11 | 12 | $LogicAppResourceID = Get-AzLogicApp @LogicAppsInfo 13 | $LogicAppTriggerURI = Get-AzLogicAppTriggerCallbackUrl @LogicAppsInfo -TriggerName "When_a_response_to_an_Azure_Sentinel_alert_is_triggered" 14 | 15 | $AnalyticsRule = Get-AzSentinelAlertRule @AzureSentinelWorkSpaceInfo | 16 | Where-Object {$PSItem.DisplayName -eq "Log Analytics Agent Health"} 17 | 18 | New-AzSentinelAlertRuleAction @AzureSentinelWorkSpaceInfo -AlertRuleId $AnalyticsRule.Name -LogicAppResourceId ($LogicAppResourceID.Id) -TriggerUri ($LogicAppTriggerURI.Value) -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Count Analytics rules template types.ps1: -------------------------------------------------------------------------------- 1 | #Count Analytics Rule template types 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | 7 | Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo | 8 | Group-Object -Property Kind | 9 | Select-Object -Property Count,Name -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Count all the Analytics rule templates.ps1: -------------------------------------------------------------------------------- 1 | #Count all the Analytics rule templates 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo | Measure-Object -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Create a new custom Analytics Rule.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | 6 | $NewAnalyticsRuleData = @{ 7 | Scheduled = $True 8 | Enabled = $True 9 | Query = "Heartbeat 10 | | summarize LastHeartbeat=max(TimeGenerated) by Computer 11 | | where LastHeartbeat < ago(5m) 12 | | extend HostCustomEntity = Computer" 13 | 14 | DisplayName = "Log Analytics Agent Health" 15 | Description = "Get disconnected Log Analytics nodes" 16 | QueryPeriod = (New-TimeSpan -Hours 1) 17 | QueryFrequency = (New-TimeSpan -Hours 1) 18 | TriggerThreshold = 0 19 | TriggerOperator = "GreaterThan" #Equal, GreaterThan, LessThan, NotEqual 20 | Severity = "Medium" # Low, Medium, High 21 | } 22 | 23 | New-AzSentinelAlertRule @AzureSentinelWorkSpaceInfo @NewAnalyticsRuleData -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Create new Analytics Rules based on a Template.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | 6 | $AnalyticsRule = Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo | 7 | Where-Object {$PSItem.DisplayName -eq "Rare application consent"} 8 | 9 | #Scheduled based Template info 10 | 11 | $ScheduledBasedTemplateInfo = @{ 12 | AlertRuleTemplateName = $AnalyticsRule.Name 13 | Enabled = $True 14 | DisplayName = $AnalyticsRule.DisplayName 15 | Scheduled = $True 16 | Query = $AnalyticsRule.Query 17 | QueryFrequency = $AnalyticsRule.QueryFrequency 18 | QueryPeriod = $AnalyticsRule.QueryPeriod 19 | Severity = $AnalyticsRule.Severity 20 | TriggerThreshold = $AnalyticsRule.TriggerThreshold 21 | TriggerOperator = $AnalyticsRule.TriggerOperator 22 | 23 | } 24 | 25 | New-AzSentinelAlertRule @AzureSentinelWorkSpaceInfo @ScheduledBasedTemplateInfo -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Disable enabled Analytics rule.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | 6 | $AnalyticsRule = Get-AzSentinelAlertRule @AzureSentinelWorkSpaceInfo | 7 | Where-Object {$PSItem.DisplayName -eq "Log Analytics Agent Health"} 8 | 9 | Update-AzSentinelAlertRule @AzureSentinelWorkSpaceInfo -AlertRuleId $AnalyticsRule.Name -Disabled -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Export All Analytics Rule Templates to a CSV File.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | 6 | Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo | Select-Object -Property DisplayName,Name,CreatedDateUtc,Severity | 7 | Export-Csv -Path "$($ENv:USERPROFILE)\Desktop\AzureSentinelAnalyticsRules.csv" -NoTypeInformation -UseCulture -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Export All Analytics Rules to JSON.ps1: -------------------------------------------------------------------------------- 1 | #Connect to Azure 2 | Connect-AzAccount 3 | 4 | #Run the Set-AzContext only, if you have multiple subscriptions 5 | #Set-AzContext -Subscription "YOUR SUBSCRIPTION ID" 6 | 7 | #Define the Azure Sentinel workspace information 8 | $AzureSentinelWorkSpaceInfo = @{ 9 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 10 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 11 | } 12 | 13 | $Rules = Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo 14 | 15 | foreach($Rule in $Rules){ 16 | 17 | #Properties to export 18 | $TemplateInfo = @{ 19 | AlertRuleTemplateName = $Rule.Name 20 | DisplayName = $Rule.DisplayName 21 | Query = $Rule.Query 22 | QueryFrequency = $Rule.QueryFrequency 23 | QueryPeriod = $Rule.QueryPeriod 24 | Severity = $Rule.Severity 25 | TriggerThreshold = $Rule.TriggerThreshold 26 | TriggerOperator = $Rule.TriggerOperator 27 | Kind = $Rule.Kind 28 | } 29 | 30 | $JSON = $TemplateInfo | ConvertTo-Json 31 | $JSON | Out-File -FilePath "($env:USERPROFILE)\Desktop\$($TemplateInfo.DisplayName).json" 32 | 33 | } -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Export-AllSentinelAnalyticsRulesWithDataConnectors.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | 6 | $Rules = Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo 7 | 8 | foreach($Rule in $Rules){ 9 | 10 | $RuleProperties = [ORDERED]@{ 11 | DisplayName = $Rule.DisplayName 12 | Name = $Rule.Name 13 | CreatedDateUtc = $Rule.CreatedDateUtc 14 | Severity = $Rule.Severity 15 | Kind = $Rule.Kind 16 | } 17 | 18 | $i = 0 19 | foreach($DataType in $Rule.RequiredDataConnectors){ 20 | 21 | $RuleProperties += @{"Datasource$i" = "$($DataType.DataTypes) ($($DataType.ConnectorId))"} 22 | 23 | $i++ 24 | } 25 | 26 | $RuleObject = New-Object -TypeName PSObject -Property $RuleProperties 27 | $RuleObject | ConvertTo-Csv -OutVariable RuleObjectCSV -NoTypeInformation -Delimiter ";" |Out-Null 28 | 29 | $RuleObjectCSV[1..($RuleObjectCSV.count - 1)] | 30 | ForEach-Object {Add-Content -Value $_ -Path "C:\AzureSentinelAnalyticsRulesBasicDetails2.csv"} 31 | 32 | } 33 | -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Filter Analytics rules based on the CreatedDateUtc property.ps1: -------------------------------------------------------------------------------- 1 | #Filter Analytics rules based on the CreatedDateUtc property 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | 7 | $TimeRange = (Get-Date).AddDays(-60) 8 | Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo | 9 | Where-Object {$PSItem.CreatedDateUtc -ge $TimeRange} | 10 | Select-Object -Property DisplayName,CreatedDateUtc,Severity | 11 | Sort-Object -Property CreatedDateUtc -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Get Analytics rule action detailed information.ps1: -------------------------------------------------------------------------------- 1 | #Get Analytics rule action detailed information 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | 7 | $LogicAppsInfo = @{ 8 | ResourceGroupName = "RG-PROD-IT-LOGIC-APPS-WE" 9 | } 10 | 11 | $AlertRuleId = "84d3a26d-1a32-4992-8c35-769cb2a98032" 12 | $AlertRuleAction = Get-AzSentinelAlertRuleAction @AzureSentinelWorkSpaceInfo -AlertRuleId $AlertRuleId 13 | $AlertRuleActionName = $AlertRuleAction.LogicAppResourceId | Split-Path -Leaf 14 | Get-AzLogicApp @LogicAppsInfo -Name $AlertRuleActionName -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Get Analytics rule action.ps1: -------------------------------------------------------------------------------- 1 | #Get Analytics rule action 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | 7 | $AlertRuleId = "84d3a26d-1a32-4992-8c35-769cb2a98032" 8 | Get-AzSentinelAlertRuleAction @AzureSentinelWorkSpaceInfo -AlertRuleId $AlertRuleId -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/List all Analytics rule templates.ps1: -------------------------------------------------------------------------------- 1 | #List all Analytics rule templates 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | 7 | Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo 8 | -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/List all Analytics rules and group by Severity.ps1: -------------------------------------------------------------------------------- 1 | #List all Analytics rules and group by Severity 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo | 7 | Group-Object -Property Severity -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/List all Analytics rules and sort rules based on the severity.ps1: -------------------------------------------------------------------------------- 1 | #List all Analytics rules and sort rules based on the severity 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo | 7 | Select-Object -Property DisplayName,Status,CreatedDateUtc,Severity | 8 | Sort-Object -Property Severity -Descending -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/List all Analytics rules where Data Sources contains SecurityEvents.ps1: -------------------------------------------------------------------------------- 1 | #List all Analytics rules where Data Sources contains "SecurityEvents" 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo | 7 | Where-Object {$PSItem.RequiredDataConnectors.ConnectorId -contains "SecurityEvents"} | 8 | Select-Object -Property DisplayName,Status,CreatedDateUtc,Severity,Name,RequiredDataConnectors | 9 | Sort-Object -Property Severity -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/List all Low Severity based Analytics rules.ps1: -------------------------------------------------------------------------------- 1 | #List all Low Severity based Analytics rules 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | 7 | Get-AzSentinelAlertRuleTemplate @AzureSentinelWorkSpaceInfo | 8 | Where-Object {$PSItem.Severity -eq "Low"} | 9 | Select-Object -Property DisplayName,Severity -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/List all enabled Analytics Rules.ps1: -------------------------------------------------------------------------------- 1 | #List all enabled Analytics Rules 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | 7 | Get-AzSentinelAlertRule @AzureSentinelWorkSpaceInfo -------------------------------------------------------------------------------- /EBook Examples/Analytics Rule Management/Remove automated response from the Analytics rule.ps1: -------------------------------------------------------------------------------- 1 | #Remove automated response from the Analytics rule 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | 7 | $AnalyticsRule = Get-AzSentinelAlertRule @AzureSentinelWorkSpaceInfo | 8 | Where-Object {$PSItem.DisplayName -eq "Log Analytics Agent Health"} 9 | 10 | $AlertRuleAction = Get-AzSentinelAlertRuleAction @AzureSentinelWorkSpaceInfo -AlertRuleId $AnalyticsRule.Name 11 | 12 | Remove-AzSentinelAlertRuleAction @AzureSentinelWorkSpaceInfo -AlertRuleId $AnalyticsRule.Name -ActionId $AlertRuleAction.Name -------------------------------------------------------------------------------- /EBook Examples/Bookmark Management/Get Bookmark.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | 6 | Get-AzSentinelBookmark @AzureSentinelWorkSpaceInfo -------------------------------------------------------------------------------- /EBook Examples/Bookmark Management/New Bookmark.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | 6 | $BookMarkQuery = @" 7 | let AllWindowsServers = 8 | Heartbeat 9 | | where OSType == 'Windows' and OSType != "Linux" 10 | | summarize arg_max(TimeGenerated, *) by SourceComputerId 11 | | summarize makeset(Computer); 12 | ProtectionStatus 13 | | where Computer in (AllWindowsServers) 14 | | sort by TimeGenerated desc 15 | | summarize arg_max(TimeGenerated, *) by SourceComputerId 16 | | summarize count() by TypeofProtection, AMProductVersion 17 | "@ 18 | 19 | $DisplayName = "Get Windows Defender Status from Windows Servers" 20 | $Notes = "Please review" 21 | 22 | New-AzSentinelBookmark @AzureSentinelWorkSpaceInfo -DisplayName $DisplayName -Query $BookMarkQuery -Note $Notes -------------------------------------------------------------------------------- /EBook Examples/Bookmark Management/Remove Bookmark.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | 6 | $BookMark = Get-AzSentinelBookmark @AzureSentinelWorkSpaceInfo | 7 | Where-Object {$PSItem.DisplayName -eq "Get Windows Defender Status from Windows Servers"} 8 | 9 | Remove-AzSentinelBookmark @AzureSentinelWorkSpaceInfo -BookmarkId $BookMark.Name -------------------------------------------------------------------------------- /EBook Examples/Bookmark Management/Update Bookmark.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | 6 | $BookMark = Get-AzSentinelBookmark @AzureSentinelWorkSpaceInfo | 7 | Where-Object {$PSItem.DisplayName -eq "Get Windows Defender Status from Windows Servers"} 8 | 9 | Update-AzSentinelBookmark @AzureSentinelWorkSpaceInfo -BookmarkId $BookMark.Name -Note "Check out the Server1. Something seems wrong with that" -------------------------------------------------------------------------------- /EBook Examples/Data Connectors/Enable Azure Security Center Data Connector.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | New-AzSentinelDataConnector @AzureSentinelWorkSpaceInfo -AzureSecurityCenter -SubscriptionId "%YOURSUBSCRIPTIONID%" -Alerts Enabled -------------------------------------------------------------------------------- /EBook Examples/Data Connectors/Get Data Connectors.ps1: -------------------------------------------------------------------------------- 1 | $AzureSentinelWorkSpaceInfo = @{ 2 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 3 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 4 | } 5 | Get-AzSentinelDataConnector @AzureSentinelWorkSpaceInfo | 6 | Select-Object -Property Kind,Name -------------------------------------------------------------------------------- /EBook Examples/Incident Management/Add a comment to an incident.ps1: -------------------------------------------------------------------------------- 1 | #Add a comment to an incident 2 | $AzureSentinelWorkSpaceInfo = @{ 3 | ResourceGroupName = "RG-PROD-IT-AZ-MANAGEMENT-TIER-0-WE" 4 | WorkspaceName = "LF-TIER-0-LOG-ANALYTICS-WE" 5 | } 6 | 7 | $IncidentID = "499d8110-790e-43d9-a9d9-a15f0539fcf0" 8 | New-AzSentinelIncidentComment @AzureSentinelWorkSpaceInfo -IncidentId $IncidentID -Message "