Skip to content

Instantly share code, notes, and snippets.

View SrujanEnsar's full-sized avatar

Srujan Vemuri SrujanEnsar

  • Ensar Solutions
  • Hyderabad
  • 10:28 (UTC +05:30)
View GitHub Profile
@SrujanEnsar
SrujanEnsar / audit-log-script.ps1
Created October 15, 2025 13:53
Reads a JSON file: audit-report.json from C:/Users/{userprofile}/Desktop/audit-log-report as raw text. Parses the JSON into a PowerShell object with ConvertFrom-Json. Flattens all advisories: iterates $data.advisories property values into a list (note: name says “critical” but there’s no actual severity filter yet). Expands findings: for each ad…
# Step 1: Read the JSON file content
$jsonContent = Get-Content -Raw -Path "C:/Users/{userprofile}/Desktop/audit-log-report/audit-report.json"
# Step 2: Convert JSON content to PowerShell objects
$data = $jsonContent | ConvertFrom-Json
# Step 3: Filter critical advisories
$criticalAdvisories = $data.advisories.PSObject.Properties |
ForEach-Object { $_.Value }
@SrujanEnsar
SrujanEnsar / audit-log-script.ps1
Last active October 15, 2025 13:54
Reads a JSON file: audit-report.json from C:/Users/{userprofile}/Desktop/audit-log-report as raw text. Parses the JSON into a PowerShell object with ConvertFrom-Json. Flattens all advisories: iterates $data.advisories property values into a list (note: name says “critical” but there’s no actual severity filter yet). Expands findings: for each ad…
# Step 1: Read the JSON file content
$jsonContent = Get-Content -Raw -Path "C:/Users/{userprofile}/Desktop/audit-log-report/audit-report.json"
# Step 2: Convert JSON content to PowerShell objects
$data = $jsonContent | ConvertFrom-Json
# Step 3: Filter critical advisories
$criticalAdvisories = $data.advisories.PSObject.Properties |
ForEach-Object { $_.Value }