Skip to content

Commit

Permalink
Update Get-AuditPolicy.psm1
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyPhipps authored Apr 15, 2024
1 parent bf0ee55 commit 0720a2e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Modules/Get-AuditPolicy.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function Get-AuditPolicy {
}
.NOTES
Updated: 2024-03-27
Updated: 2024-04-15
Contributing Authors:
Anthony Phipps
Expand Down Expand Up @@ -66,6 +66,7 @@ function Get-AuditPolicy {

process{

$IdleLockoutTime = (Get-ItemPropertyValue -Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System" -Name "InactivityTimeoutSecs" -ErrorAction SilentlyContinue)/60

$ResultsArray = auditpol.exe /get /category:* /r | ConvertFrom-Csv |
Select-Object -Property "Subcategory", "Subcategory GUID", "Inclusion Setting", "Exclusion Setting"
Expand All @@ -79,9 +80,10 @@ function Get-AuditPolicy {
return $ResultsArray |
Select-Object Host, DateScanned, "Subcategory", "Subcategory GUID", "Inclusion Setting", "Exclusion Setting" |
Group-Object Host, DateScanned | Foreach-Object {
$hash = [ordered]@{
$hash = [Ordered]@{
Host = ($_.Name -Split', ')[0]
DateScanned = ($_.Name -Split', ')[1]
IdleLockoutTime = $IdleLockoutTime
}

$_.Group | Foreach-Object {
Expand Down

0 comments on commit 0720a2e

Please sign in to comment.