mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-07-26 20:00:09 +00:00
Compare commits
96 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 98e93aa07d | |||
| 707c0ed4b2 | |||
| 3a69d14354 | |||
| 95789953a8 | |||
| 927ae5cd15 | |||
| 26ecff620c | |||
| 4358edfd8f | |||
| 31c7e9d817 | |||
| 6718b35aaf | |||
| 808af75ab9 | |||
| 6745e547a4 | |||
| 642c4844a5 | |||
| cd72f79f85 | |||
| 8d32cb443e | |||
| 4f4fddddae | |||
| a374433922 | |||
| 96a5e0789e | |||
| f37887c8bf | |||
| 497438dc1e | |||
| 503b82ca02 | |||
| 790b3b97e0 | |||
| 07a8c77763 | |||
| 9dfc4d01c3 | |||
| a59a418e98 | |||
| 5a1f7da921 | |||
| 8bdb157330 | |||
| 096c6354d7 | |||
| a3427496e9 | |||
| 9fb76d701f | |||
| 7b4d31781c | |||
| 21bcf2c3a6 | |||
| 46947e0ee9 | |||
| 12d4dfc634 | |||
| 44be1f8d97 | |||
| 864d2cd516 | |||
| 0db67a6d70 | |||
| 189401d62b | |||
| 212f59dd38 | |||
| 7b80dc2d8e | |||
| 5afa032042 | |||
| 00b8586edc | |||
| 08b07de729 | |||
| 3b04efcbc8 | |||
| 051544f353 | |||
| 307dec14df | |||
| 9ec8f5128b | |||
| 7b68b12b02 | |||
| 029225a65c | |||
| ae2a0bd84c | |||
| cb473ae5fa | |||
| e156ef9a24 | |||
| 40cd4dc8ad | |||
| 92f3fcb692 | |||
| bd103a513b | |||
| 8268002ac0 | |||
| 038e4036b9 | |||
| 632f2b0c26 | |||
| 84805cf134 | |||
| d7ebc89d54 | |||
| 4288829415 | |||
| f3d426ba93 | |||
| fef37130bb | |||
| d62b8e47f7 | |||
| 63f1ccd232 | |||
| e61ef74920 | |||
| b63e333fd0 | |||
| 9b0ab0c1c2 | |||
| ee3b25ee88 | |||
| 25c13b54aa | |||
| 2b9faa4e61 | |||
| 42f3053896 | |||
| edcba71e7f | |||
| c8ee2cca56 | |||
| 3b4617af83 | |||
| 6830b1e219 | |||
| 28c55deaa7 | |||
| c757c8281b | |||
| e3e5582696 | |||
| 8e2f4f1552 | |||
| 863c9fabc9 | |||
| 972b51b472 | |||
| 060fb95064 | |||
| fdfc700c6f | |||
| 81eaac3fd1 | |||
| cf9164766e | |||
| 4de2e2a57e | |||
| 663e6058e6 | |||
| f681a5586e | |||
| 4c022bfc16 | |||
| c03f158b77 | |||
| 4824633787 | |||
| 8dc7e5b26d | |||
| 68ed20f3e8 | |||
| df2bacdba7 | |||
| f67ade6341 | |||
| 5855ca2a7c |
@@ -0,0 +1,8 @@
|
||||
Ignore/*
|
||||
.vs/*
|
||||
.vscode/*
|
||||
Releases/*
|
||||
ReleasesUnpacked/*
|
||||
*.log
|
||||
*.html
|
||||
Artefacts/*
|
||||
+212
-277
@@ -1,290 +1,225 @@
|
||||
Clear-Host
|
||||
|
||||
$Configuration = @{
|
||||
Information = @{
|
||||
ModuleName = 'GPOZaurr'
|
||||
DirectoryProjects = 'C:\Support\GitHub'
|
||||
Invoke-ModuleBuild -ModuleName 'GPOZaurr' {
|
||||
# Usual defaults as per standard module
|
||||
$Manifest = @{
|
||||
# Version number of this module.
|
||||
ModuleVersion = '1.1.X'
|
||||
# Supported PSEditions
|
||||
CompatiblePSEditions = @('Desktop')
|
||||
# ID used to uniquely identify this module
|
||||
GUID = 'f7d4c9e4-0298-4f51-ad77-e8e3febebbde'
|
||||
# Author of this module
|
||||
Author = 'Przemyslaw Klys'
|
||||
# Company or vendor of this module
|
||||
CompanyName = 'Evotec'
|
||||
# Copyright statement for this module
|
||||
Copyright = "(c) 2011 - $((Get-Date).Year) Przemyslaw Klys @ Evotec. All rights reserved."
|
||||
# Description of the functionality provided by this module
|
||||
Description = 'Group Policy Eater is a PowerShell module that aims to gather information about Group Policies but also allows fixing issues that you may find in them.'
|
||||
# Minimum version of the Windows PowerShell engine required by this module
|
||||
PowerShellVersion = '5.1'
|
||||
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
|
||||
Tags = @('Windows', 'ActiveDirectory', 'GPO', 'GroupPolicy')
|
||||
#IconUri = 'https://evotec.xyz/wp-content/uploads/2019/02/PSPublishModule.png'
|
||||
|
||||
FunctionsToExport = 'Public'
|
||||
AliasesToExport = 'Public'
|
||||
|
||||
Manifest = @{
|
||||
# Version number of this module.
|
||||
ModuleVersion = '0.0.X'
|
||||
# Supported PSEditions
|
||||
CompatiblePSEditions = @('Desktop')
|
||||
# ID used to uniquely identify this module
|
||||
GUID = 'f7d4c9e4-0298-4f51-ad77-e8e3febebbde'
|
||||
# Author of this module
|
||||
Author = 'Przemyslaw Klys'
|
||||
# Company or vendor of this module
|
||||
CompanyName = 'Evotec'
|
||||
# Copyright statement for this module
|
||||
Copyright = "(c) 2011 - $((Get-Date).Year) Przemyslaw Klys @ Evotec. All rights reserved."
|
||||
# Description of the functionality provided by this module
|
||||
Description = 'Group Policy Eater is a PowerShell module that aims to gather information about Group Policies but also allows fixing issues that you may find in them.'
|
||||
# Minimum version of the Windows PowerShell engine required by this module
|
||||
PowerShellVersion = '5.1'
|
||||
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
|
||||
Tags = @('Windows', 'ActiveDirectory', 'GPO', 'GroupPolicy')
|
||||
#IconUri = 'https://evotec.xyz/wp-content/uploads/2019/02/PSPublishModule.png'
|
||||
|
||||
ProjectUri = 'https://github.com/EvotecIT/GPOZaurr'
|
||||
|
||||
RequiredModules = @(
|
||||
@{ ModuleName = 'PSSharedGoods'; ModuleVersion = 'Latest'; Guid = 'ee272aa8-baaa-4edf-9f45-b6d6f7d844fe' }
|
||||
@{ ModuleName = 'ADEssentials'; ModuleVersion = '0.0.148'; Guid = '9fc9fd61-7f11-4f4b-a527-084086f1905f' }
|
||||
@{ ModuleName = 'PSWriteHTML'; ModuleVersion = "Latest"; Guid = 'a7bdf640-f5cb-4acf-9de0-365b322d245c' }
|
||||
)
|
||||
ExternalModuleDependencies = @(
|
||||
#"ActiveDirectory"
|
||||
#"GroupPolicy"
|
||||
"CimCmdlets"
|
||||
'Microsoft.PowerShell.Management'
|
||||
'Microsoft.PowerShell.Utility'
|
||||
'Microsoft.PowerShell.Security'
|
||||
)
|
||||
CommandModuleDependencies = @{
|
||||
ActiveDirectory = @(
|
||||
'Add-GPOPermission'
|
||||
'Add-GPOZaurrPermission'
|
||||
'Backup-GPOZaurr'
|
||||
'Clear-GPOZaurrSysvolDFSR'
|
||||
'ConvertFrom-CSExtension'
|
||||
'Find-CSExtension'
|
||||
'Get-GPOZaurr'
|
||||
'Get-GPOZaurrAD'
|
||||
'Get-GPOZaurrBackupInformation'
|
||||
'Get-GPOZaurrBroken'
|
||||
'Get-GPOZaurrDictionary'
|
||||
'Get-GPOZaurrDuplicateObject'
|
||||
'Get-GPOZaurrFiles'
|
||||
'Get-GPOZaurrFilesPolicyDefinition'
|
||||
'Get-GPOZaurrFolders'
|
||||
'Get-GPOZaurrInheritance'
|
||||
'Get-GPOZaurrLegacyFiles'
|
||||
'Get-GPOZaurrLink'
|
||||
'Get-GPOZaurrLinkSummary'
|
||||
'Get-GPOZaurrNetLogon'
|
||||
'Get-GPOZaurrOwner'
|
||||
'Get-GPOZaurrPassword'
|
||||
'Get-GPOZaurrPermission'
|
||||
'Get-GPOZaurrPermissionConsistency'
|
||||
'Get-GPOZaurrPermissionRoot'
|
||||
'Get-GPOZaurrPermissionSummary'
|
||||
'Get-GPOZaurrSysvolDFSR'
|
||||
'Get-GPOZaurrWMI'
|
||||
'Invoke-GPOZaurr'
|
||||
#'Invoke-GPOZaurrContent'
|
||||
'Invoke-GPOZaurrPermission'
|
||||
'Invoke-GPOZaurrSupport'
|
||||
'New-GPOZaurrWMI'
|
||||
'Optimize-GPOZaurr'
|
||||
'Remove-GPOPermission'
|
||||
'Remove-GPOZaurr'
|
||||
'Remove-GPOZaurrBroken'
|
||||
'Remove-GPOZaurrDuplicateObject'
|
||||
'Remove-GPOZaurrFolders'
|
||||
'Remove-GPOZaurrLegacyFiles'
|
||||
'Remove-GPOZaurrPermission'
|
||||
'Remove-GPOZaurrWMI'
|
||||
'Repair-GPOZaurrNetLogonOwner'
|
||||
'Repair-GPOZaurrPermissionConsistency'
|
||||
'Restore-GPOZaurr'
|
||||
'Save-GPOZaurrFiles'
|
||||
'Set-GPOOwner'
|
||||
'Set-GPOZaurrOwner'
|
||||
'Find-GPO'
|
||||
'Get-GPOZaurrFilesPolicyDefinitions'
|
||||
'Get-GPOZaurrSysvol'
|
||||
'Remove-GPOZaurrOrphaned'
|
||||
'Show-GPO'
|
||||
'Show-GPOZaurr'
|
||||
)
|
||||
GroupPolicy = @(
|
||||
'Add-GPOPermission'
|
||||
'Add-GPOZaurrPermission'
|
||||
'Backup-GPOZaurr'
|
||||
'Clear-GPOZaurrSysvolDFSR'
|
||||
'ConvertFrom-CSExtension'
|
||||
'Find-CSExtension'
|
||||
'Get-GPOZaurr'
|
||||
'Get-GPOZaurrAD'
|
||||
'Get-GPOZaurrBackupInformation'
|
||||
'Get-GPOZaurrBroken'
|
||||
'Get-GPOZaurrDictionary'
|
||||
'Get-GPOZaurrDuplicateObject'
|
||||
'Get-GPOZaurrFiles'
|
||||
'Get-GPOZaurrFilesPolicyDefinition'
|
||||
'Get-GPOZaurrFolders'
|
||||
'Get-GPOZaurrInheritance'
|
||||
'Get-GPOZaurrLegacyFiles'
|
||||
'Get-GPOZaurrLink'
|
||||
'Get-GPOZaurrLinkSummary'
|
||||
'Get-GPOZaurrNetLogon'
|
||||
'Get-GPOZaurrOwner'
|
||||
'Get-GPOZaurrPassword'
|
||||
'Get-GPOZaurrPermission'
|
||||
'Get-GPOZaurrPermissionConsistency'
|
||||
'Get-GPOZaurrPermissionRoot'
|
||||
'Get-GPOZaurrPermissionSummary'
|
||||
'Get-GPOZaurrSysvolDFSR'
|
||||
'Get-GPOZaurrWMI'
|
||||
'Invoke-GPOZaurr'
|
||||
#'Invoke-GPOZaurrContent'
|
||||
'Invoke-GPOZaurrPermission'
|
||||
'Invoke-GPOZaurrSupport'
|
||||
'New-GPOZaurrWMI'
|
||||
'Optimize-GPOZaurr'
|
||||
'Remove-GPOPermission'
|
||||
'Remove-GPOZaurr'
|
||||
'Remove-GPOZaurrBroken'
|
||||
'Remove-GPOZaurrDuplicateObject'
|
||||
'Remove-GPOZaurrFolders'
|
||||
'Remove-GPOZaurrLegacyFiles'
|
||||
'Remove-GPOZaurrPermission'
|
||||
'Remove-GPOZaurrWMI'
|
||||
'Repair-GPOZaurrNetLogonOwner'
|
||||
'Repair-GPOZaurrPermissionConsistency'
|
||||
'Restore-GPOZaurr'
|
||||
'Save-GPOZaurrFiles'
|
||||
'Set-GPOOwner'
|
||||
'Set-GPOZaurrOwner'
|
||||
'Find-GPO'
|
||||
'Get-GPOZaurrFilesPolicyDefinitions'
|
||||
'Get-GPOZaurrSysvol'
|
||||
'Remove-GPOZaurrOrphaned'
|
||||
'Show-GPO'
|
||||
'Show-GPOZaurr'
|
||||
)
|
||||
}
|
||||
}
|
||||
ProjectUri = 'https://github.com/EvotecIT/GPOZaurr'
|
||||
}
|
||||
Options = @{
|
||||
Merge = @{
|
||||
Sort = 'None'
|
||||
FormatCodePSM1 = @{
|
||||
Enabled = $true
|
||||
RemoveComments = $false
|
||||
FormatterSettings = @{
|
||||
IncludeRules = @(
|
||||
'PSPlaceOpenBrace',
|
||||
'PSPlaceCloseBrace',
|
||||
'PSUseConsistentWhitespace',
|
||||
'PSUseConsistentIndentation',
|
||||
'PSAlignAssignmentStatement',
|
||||
'PSUseCorrectCasing'
|
||||
)
|
||||
New-ConfigurationManifest @Manifest
|
||||
|
||||
Rules = @{
|
||||
PSPlaceOpenBrace = @{
|
||||
Enable = $true
|
||||
OnSameLine = $true
|
||||
NewLineAfter = $true
|
||||
IgnoreOneLineBlock = $true
|
||||
}
|
||||
New-ConfigurationModule -Type RequiredModule -Name 'PSWriteColor', 'PSSharedGoods', 'ADEssentials' -Guid Auto -Version Latest
|
||||
New-ConfigurationModule -Type RequiredModule -Name "PSWriteHTML" -Guid Auto -Version "1.27.0"
|
||||
#New-ConfigurationModule -Type ExternalModule -Name 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Management','Microsoft.PowerShell.Security'
|
||||
New-ConfigurationModule -Type ApprovedModule -Name 'PSSharedGoods', 'PSWriteColor', 'Connectimo', 'PSUnifi', 'PSWebToolbox', 'PSMyPassword', 'ADEssentials'
|
||||
|
||||
PSPlaceCloseBrace = @{
|
||||
Enable = $true
|
||||
NewLineAfter = $false
|
||||
IgnoreOneLineBlock = $true
|
||||
NoEmptyLineBefore = $false
|
||||
}
|
||||
New-ConfigurationModule -Type ExternalModule -Name @(
|
||||
"CimCmdlets"
|
||||
'Microsoft.PowerShell.Management'
|
||||
'Microsoft.PowerShell.Utility'
|
||||
'Microsoft.PowerShell.Security'
|
||||
)
|
||||
|
||||
PSUseConsistentIndentation = @{
|
||||
Enable = $true
|
||||
Kind = 'space'
|
||||
PipelineIndentation = 'IncreaseIndentationAfterEveryPipeline'
|
||||
IndentationSize = 4
|
||||
}
|
||||
New-ConfigurationModuleSkip -IgnoreModuleName @(
|
||||
# this are builtin into PowerShell, so not critical
|
||||
'powershellget'
|
||||
'GroupPolicy'
|
||||
'ScheduledTasks'
|
||||
'ActiveDirectory'
|
||||
'Microsoft.WSMan.Management'
|
||||
'NetConnection'
|
||||
'NetSecurity'
|
||||
'NetTCPIP'
|
||||
) -IgnoreFunctionName @(
|
||||
'Select-Unique'
|
||||
)
|
||||
|
||||
PSUseConsistentWhitespace = @{
|
||||
Enable = $true
|
||||
CheckInnerBrace = $true
|
||||
CheckOpenBrace = $true
|
||||
CheckOpenParen = $true
|
||||
CheckOperator = $true
|
||||
CheckPipe = $true
|
||||
CheckSeparator = $true
|
||||
}
|
||||
New-ConfigurationCommand -ModuleName 'ActiveDirectory' -CommandName @(
|
||||
'Add-GPOPermission'
|
||||
'Add-GPOZaurrPermission'
|
||||
'Backup-GPOZaurr'
|
||||
'Clear-GPOZaurrSysvolDFSR'
|
||||
'ConvertFrom-CSExtension'
|
||||
'Find-CSExtension'
|
||||
'Get-GPOZaurr'
|
||||
'Get-GPOZaurrAD'
|
||||
'Get-GPOZaurrBackupInformation'
|
||||
'Get-GPOZaurrBroken'
|
||||
'Get-GPOZaurrDictionary'
|
||||
'Get-GPOZaurrDuplicateObject'
|
||||
'Get-GPOZaurrFiles'
|
||||
'Get-GPOZaurrFilesPolicyDefinition'
|
||||
'Get-GPOZaurrFolders'
|
||||
'Get-GPOZaurrInheritance'
|
||||
'Get-GPOZaurrLegacyFiles'
|
||||
'Get-GPOZaurrLink'
|
||||
'Get-GPOZaurrLinkSummary'
|
||||
'Get-GPOZaurrNetLogon'
|
||||
'Get-GPOZaurrOwner'
|
||||
'Get-GPOZaurrPassword'
|
||||
'Get-GPOZaurrPermission'
|
||||
'Get-GPOZaurrPermissionConsistency'
|
||||
'Get-GPOZaurrPermissionRoot'
|
||||
'Get-GPOZaurrPermissionSummary'
|
||||
'Get-GPOZaurrSysvolDFSR'
|
||||
'Get-GPOZaurrWMI'
|
||||
'Invoke-GPOZaurr'
|
||||
#'Invoke-GPOZaurrContent'
|
||||
'Invoke-GPOZaurrPermission'
|
||||
'Invoke-GPOZaurrSupport'
|
||||
'New-GPOZaurrWMI'
|
||||
'Optimize-GPOZaurr'
|
||||
'Remove-GPOPermission'
|
||||
'Remove-GPOZaurr'
|
||||
'Remove-GPOZaurrBroken'
|
||||
'Remove-GPOZaurrDuplicateObject'
|
||||
'Remove-GPOZaurrFolders'
|
||||
'Remove-GPOZaurrLegacyFiles'
|
||||
'Remove-GPOZaurrPermission'
|
||||
'Remove-GPOZaurrWMI'
|
||||
'Repair-GPOZaurrNetLogonOwner'
|
||||
'Repair-GPOZaurrPermissionConsistency'
|
||||
'Restore-GPOZaurr'
|
||||
'Save-GPOZaurrFiles'
|
||||
'Set-GPOOwner'
|
||||
'Set-GPOZaurrOwner'
|
||||
'Find-GPO'
|
||||
'Get-GPOZaurrFilesPolicyDefinitions'
|
||||
'Get-GPOZaurrSysvol'
|
||||
'Remove-GPOZaurrOrphaned'
|
||||
'Show-GPO'
|
||||
'Show-GPOZaurr'
|
||||
)
|
||||
New-ConfigurationCommand -ModuleName 'GroupPolicy' -CommandName @(
|
||||
'Add-GPOPermission'
|
||||
'Add-GPOZaurrPermission'
|
||||
'Backup-GPOZaurr'
|
||||
'Clear-GPOZaurrSysvolDFSR'
|
||||
'ConvertFrom-CSExtension'
|
||||
'Find-CSExtension'
|
||||
'Get-GPOZaurr'
|
||||
'Get-GPOZaurrAD'
|
||||
'Get-GPOZaurrBackupInformation'
|
||||
'Get-GPOZaurrBroken'
|
||||
'Get-GPOZaurrDictionary'
|
||||
'Get-GPOZaurrDuplicateObject'
|
||||
'Get-GPOZaurrFiles'
|
||||
'Get-GPOZaurrFilesPolicyDefinition'
|
||||
'Get-GPOZaurrFolders'
|
||||
'Get-GPOZaurrInheritance'
|
||||
'Get-GPOZaurrLegacyFiles'
|
||||
'Get-GPOZaurrLink'
|
||||
'Get-GPOZaurrLinkSummary'
|
||||
'Get-GPOZaurrNetLogon'
|
||||
'Get-GPOZaurrOwner'
|
||||
'Get-GPOZaurrPassword'
|
||||
'Get-GPOZaurrPermission'
|
||||
'Get-GPOZaurrPermissionConsistency'
|
||||
'Get-GPOZaurrPermissionRoot'
|
||||
'Get-GPOZaurrPermissionSummary'
|
||||
'Get-GPOZaurrSysvolDFSR'
|
||||
'Get-GPOZaurrWMI'
|
||||
'Invoke-GPOZaurr'
|
||||
#'Invoke-GPOZaurrContent'
|
||||
'Invoke-GPOZaurrPermission'
|
||||
'Invoke-GPOZaurrSupport'
|
||||
'New-GPOZaurrWMI'
|
||||
'Optimize-GPOZaurr'
|
||||
'Remove-GPOPermission'
|
||||
'Remove-GPOZaurr'
|
||||
'Remove-GPOZaurrBroken'
|
||||
'Remove-GPOZaurrDuplicateObject'
|
||||
'Remove-GPOZaurrFolders'
|
||||
'Remove-GPOZaurrLegacyFiles'
|
||||
'Remove-GPOZaurrPermission'
|
||||
'Remove-GPOZaurrWMI'
|
||||
'Repair-GPOZaurrNetLogonOwner'
|
||||
'Repair-GPOZaurrPermissionConsistency'
|
||||
'Restore-GPOZaurr'
|
||||
'Save-GPOZaurrFiles'
|
||||
'Set-GPOOwner'
|
||||
'Set-GPOZaurrOwner'
|
||||
'Find-GPO'
|
||||
'Get-GPOZaurrFilesPolicyDefinitions'
|
||||
'Get-GPOZaurrSysvol'
|
||||
'Remove-GPOZaurrOrphaned'
|
||||
'Show-GPO'
|
||||
'Show-GPOZaurr'
|
||||
)
|
||||
|
||||
PSAlignAssignmentStatement = @{
|
||||
Enable = $true
|
||||
CheckHashtable = $true
|
||||
}
|
||||
|
||||
PSUseCorrectCasing = @{
|
||||
Enable = $true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
FormatCodePSD1 = @{
|
||||
Enabled = $true
|
||||
RemoveComments = $false
|
||||
}
|
||||
Integrate = @{
|
||||
ApprovedModules = 'PSSharedGoods', 'PSWriteColor', 'Connectimo', 'PSUnifi', 'PSWebToolbox', 'PSMyPassword', 'ADEssentials', 'PSPublishModule'
|
||||
}
|
||||
}
|
||||
Standard = @{
|
||||
FormatCodePSM1 = @{
|
||||
$ConfigurationFormat = [ordered] @{
|
||||
RemoveComments = $true
|
||||
RemoveEmptyLines = $true
|
||||
|
||||
}
|
||||
FormatCodePSD1 = @{
|
||||
Enabled = $true
|
||||
#RemoveComments = $true
|
||||
}
|
||||
}
|
||||
PowerShellGallery = @{
|
||||
ApiKey = 'C:\Support\Important\PowerShellGalleryAPI.txt'
|
||||
FromFile = $true
|
||||
}
|
||||
GitHub = @{
|
||||
ApiKey = 'C:\Support\Important\GithubAPI.txt'
|
||||
FromFile = $true
|
||||
UserName = 'EvotecIT'
|
||||
#RepositoryName = 'PSPublishModule' # not required, uses project name
|
||||
}
|
||||
Documentation = @{
|
||||
Path = 'Docs'
|
||||
PathReadme = 'Docs\Readme.md'
|
||||
}
|
||||
Style = @{
|
||||
PSD1 = 'Minimal' # Native
|
||||
}
|
||||
Signing = @{
|
||||
CertificateThumbprint = '36A8A2D0E227D81A2D3B60DCE0CFCF23BEFC343B'
|
||||
}
|
||||
PlaceOpenBraceEnable = $true
|
||||
PlaceOpenBraceOnSameLine = $true
|
||||
PlaceOpenBraceNewLineAfter = $true
|
||||
PlaceOpenBraceIgnoreOneLineBlock = $false
|
||||
|
||||
PlaceCloseBraceEnable = $true
|
||||
PlaceCloseBraceNewLineAfter = $true
|
||||
PlaceCloseBraceIgnoreOneLineBlock = $false
|
||||
PlaceCloseBraceNoEmptyLineBefore = $true
|
||||
|
||||
UseConsistentIndentationEnable = $true
|
||||
UseConsistentIndentationKind = 'space'
|
||||
UseConsistentIndentationPipelineIndentation = 'IncreaseIndentationAfterEveryPipeline'
|
||||
UseConsistentIndentationIndentationSize = 4
|
||||
|
||||
UseConsistentWhitespaceEnable = $true
|
||||
UseConsistentWhitespaceCheckInnerBrace = $true
|
||||
UseConsistentWhitespaceCheckOpenBrace = $true
|
||||
UseConsistentWhitespaceCheckOpenParen = $true
|
||||
UseConsistentWhitespaceCheckOperator = $true
|
||||
UseConsistentWhitespaceCheckPipe = $true
|
||||
UseConsistentWhitespaceCheckSeparator = $true
|
||||
|
||||
AlignAssignmentStatementEnable = $true
|
||||
AlignAssignmentStatementCheckHashtable = $true
|
||||
|
||||
UseCorrectCasingEnable = $true
|
||||
}
|
||||
Steps = @{
|
||||
BuildModule = @{ # requires Enable to be on to process all of that
|
||||
Enable = $true
|
||||
DeleteBefore = $false
|
||||
Merge = $true
|
||||
MergeMissing = $true
|
||||
SignMerged = $true
|
||||
Releases = $true
|
||||
ReleasesUnpacked = $false
|
||||
RefreshPSD1Only = $false
|
||||
}
|
||||
BuildDocumentation = @{
|
||||
Enable = $true # enables documentation processing
|
||||
StartClean = $true # always starts clean
|
||||
UpdateWhenNew = $true # always updates right after new
|
||||
}
|
||||
ImportModules = @{
|
||||
Self = $true
|
||||
RequiredModules = $false
|
||||
Verbose = $false
|
||||
}
|
||||
PublishModule = @{ # requires Enable to be on to process all of that
|
||||
Enabled = $false
|
||||
Prerelease = ''
|
||||
RequireForce = $false
|
||||
GitHub = $false
|
||||
}
|
||||
}
|
||||
}
|
||||
# format PSD1 and PSM1 files when merging into a single file
|
||||
# enable formatting is not required as Configuration is provided
|
||||
New-ConfigurationFormat -ApplyTo 'OnMergePSM1', 'OnMergePSD1' -Sort None @ConfigurationFormat
|
||||
# format PSD1 and PSM1 files within the module
|
||||
# enable formatting is required to make sure that formatting is applied (with default settings)
|
||||
New-ConfigurationFormat -ApplyTo 'DefaultPSD1', 'DefaultPSM1' -EnableFormatting -Sort None
|
||||
# when creating PSD1 use special style without comments and with only required parameters
|
||||
New-ConfigurationFormat -ApplyTo 'DefaultPSD1', 'OnMergePSD1' -PSD1Style 'Minimal'
|
||||
# configuration for documentation, at the same time it enables documentation processing
|
||||
New-ConfigurationDocumentation -Enable:$false -StartClean -UpdateWhenNew -PathReadme 'Docs\Readme.md' -Path 'Docs'
|
||||
|
||||
New-PrepareModule -Configuration $Configuration
|
||||
#New-ConfigurationImportModule -ImportSelf
|
||||
|
||||
New-ConfigurationBuild -Enable:$true -SignModule -MergeModuleOnBuild -MergeFunctionsFromApprovedModules -CertificateThumbprint '483292C9E317AA13B07BB7A96AE9D1A5ED9E7703'
|
||||
|
||||
# New-ConfigurationTest -TestsPath "$PSScriptRoot\..\Tests" -Enable
|
||||
|
||||
New-ConfigurationArtefact -Type Unpacked -Enable -Path "$PSScriptRoot\..\Artefacts\Unpacked" -AddRequiredModules
|
||||
New-ConfigurationArtefact -Type Packed -Enable -Path "$PSScriptRoot\..\Artefacts\Packed" -ArtefactName '<ModuleName>.v<ModuleVersion>.zip' -AddRequiredModules
|
||||
|
||||
# options for publishing to github/psgallery
|
||||
#New-ConfigurationPublish -Type PowerShellGallery -FilePath 'C:\Support\Important\PowerShellGalleryAPI.txt' -Enabled:$true
|
||||
#New-ConfigurationPublish -Type GitHub -FilePath 'C:\Support\Important\GitHubAPI.txt' -UserName 'EvotecIT' -Enabled:$true
|
||||
} -ExitCode
|
||||
@@ -1,5 +1,78 @@
|
||||
# GPOZaurr Release History
|
||||
|
||||
## Unreleased
|
||||
- Fix `WindowsDefender` content detection for newer ADMX categories by supporting both:
|
||||
- `Windows Components/Windows Defender*`
|
||||
- `Windows Components/Microsoft Defender Antivirus*`
|
||||
- Fix `WindowsDefenderExploitGuard` detection for legacy/new category naming variants.
|
||||
- Add Defender registry fallback parsing (`SOFTWARE\Microsoft\Windows Defender*`) so Defender settings that land in `RegistrySettings` are still surfaced in `WindowsDefender` report output. [#81](https://github.com/EvotecIT/GPOZaurr/issues/81)
|
||||
|
||||
## 1.1.9 - 2024.12.02
|
||||
- Fixes `Invoke-GPOZaurr` when using SplitReports without path [#58](https://github.com/EvotecIT/GPOZaurr/issues/58)
|
||||
|
||||
## 1.1.8 - 2024.11.20
|
||||
### What's new
|
||||
- Added `RestrictedGroups` to GroupAnalysis
|
||||
|
||||
**Full Changelog**: https://github.com/EvotecIT/GPOZaurr/compare/v1.1.7...v1.1.8
|
||||
|
||||
## 1.1.7 - 2024.11.20
|
||||
### What's Changed
|
||||
- Added some additional logging to track down issue
|
||||
|
||||
## 1.1.6 - 2024.10.17
|
||||
### What's Changed
|
||||
* Improve HTML reports with `ScrollX`
|
||||
* Improve HTML reports by hiding some unnesecary columns
|
||||
* Added `SizeMB` and `Size` to reports around files/GPOs which could help analyze performance issues
|
||||
* Other minor HTML fixes
|
||||
* Fixed typo "Unfortunetly" -> "Unfortunately" by @davidmwilliams in https://github.com/EvotecIT/GPOZaurr/pull/61
|
||||
* Minor typo correction "incosistent" -> "inconsistent" by @davidmwilliams in https://github.com/EvotecIT/GPOZaurr/pull/60
|
||||
* Update Invoke.GPOZaurrDuplicate.ps1 by @SamErde in https://github.com/EvotecIT/GPOZaurr/pull/63
|
||||
* Fix typo and grammar by @SamErde in https://github.com/EvotecIT/GPOZaurr/pull/64
|
||||
|
||||
### New Contributors
|
||||
* @davidmwilliams made their first contribution in https://github.com/EvotecIT/GPOZaurr/pull/61
|
||||
* @SamErde made their first contribution in https://github.com/EvotecIT/GPOZaurr/pull/63
|
||||
|
||||
**Full Changelog**: https://github.com/EvotecIT/GPOZaurr/compare/v1.1.5...v1.1.6
|
||||
|
||||
## 1.1.5 - 2024.07.06
|
||||
* Added or improved help on all functions. by @neztach in https://github.com/EvotecIT/GPOZaurr/pull/56
|
||||
|
||||
### New Contributors
|
||||
* @neztach made their first contribution in https://github.com/EvotecIT/GPOZaurr/pull/56
|
||||
|
||||
## 1.1.4 - 2024.06.11
|
||||
- Small improvements & fixes
|
||||
|
||||
## 1.1.3 - 2024.04.16
|
||||
- Fixes report showing unessecary `WhatIf` [#53](https://github.com/EvotecIT/GPOZaurr/issues/53)
|
||||
|
||||
## 1.1.2 - 2024.04.16
|
||||
- Fixes `Forest` parameter for GPOAnalysis [#54](https://github.com/EvotecIT/GPOZaurr/issues/54)
|
||||
|
||||
## 1.1.1 - 2024.02.07
|
||||
- Force specific DC for `Invoke-GPOZaurrContent`
|
||||
- Update to Duplicate Object detection for error handling [#52](https://github.com/EvotecIT/GPOZaurr/issues/52)
|
||||
|
||||
## 1.1.0 - 2024.04.02
|
||||
- Improve `Invoke-GPOZaurr` - by adding `GPOName` and `GPOGUID` parameters, providing ability to analyse single/multiple GPOs
|
||||
- Those parameters are only applicable to `GPOAnalysis`,`GPOBrokenPartially` for now (need to be expanded further)
|
||||
- Improve `Invoke-GPOZaurrContent` by allowing `GPOName` and `GPOGUID` parameters, providing ability to analyse single/multiple GPOs
|
||||
- Small verbose message improvement for `Export-GPOZaurrContent`
|
||||
- Added `Get-GPOZaurrMissingFiles` to detect missing files for GPOs
|
||||
- Added `Invoke-GPOZaurr` - type `GPOBrokenPartially` to detect missing files for GPOs
|
||||
- Improve detection of empty GPOs by including check for GPF files
|
||||
- Added `FilesCount` to `Get-GPOZaurr` to detect number of files in GPO
|
||||
|
||||
## 1.0.0 - 2023.09.17
|
||||
- `Get-GPOZaurrUpdates` fix small typo
|
||||
- `Get-GPOZaurrAD` improve performance a bit
|
||||
- `Get-GPOZaurrAD` changed pipeline into standard foreach to improve performance and potential problems for large domains
|
||||
- Added `Get-GPOZaurrRedirect` to detect if GPO path was redirected (security issue)
|
||||
- Added `GPORedirect` report type to `Invoke-GPOZaurr` to detect if GPO path was redirected (security issue)
|
||||
|
||||
## 0.0.160 - 2023.05.26
|
||||
- Fixes `Remove-GPOZaurr` limit processing feature which would not stop in some cases
|
||||
|
||||
|
||||
+221
-166
@@ -8,7 +8,7 @@ schema: 2.0.0
|
||||
# Invoke-GPOZaurrContent
|
||||
|
||||
## SYNOPSIS
|
||||
{{ Fill in the Synopsis }}
|
||||
Invokes GPOZaurrContent function to retrieve Group Policy Objects information.
|
||||
|
||||
## SYNTAX
|
||||
|
||||
@@ -17,92 +17,45 @@ schema: 2.0.0
|
||||
Invoke-GPOZaurrContent [-Forest <String>] [-ExcludeDomains <String[]>] [-IncludeDomains <String[]>]
|
||||
[-ExtendedForestInformation <IDictionary>] [-Type <String[]>] [-Splitter <String>] [-FullObjects]
|
||||
[-OutputType <String[]>] [-OutputPath <String>] [-Open] [-Online] [-CategoriesOnly] [-SingleObject]
|
||||
[-SkipNormalize] [-SkipCleanup] [-Extended] [<CommonParameters>]
|
||||
[-SkipNormalize] [-SkipCleanup] [-Extended] [-GPOName <String[]>] [-GPOGUID <String[]>]
|
||||
[-ProgressAction <ActionPreference>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
### Local
|
||||
```
|
||||
Invoke-GPOZaurrContent [-GPOPath <String>] [-Type <String[]>] [-Splitter <String>] [-FullObjects]
|
||||
[-OutputType <String[]>] [-OutputPath <String>] [-Open] [-Online] [-CategoriesOnly] [-SingleObject]
|
||||
[-SkipNormalize] [-SkipCleanup] [-Extended] [<CommonParameters>]
|
||||
[-SkipNormalize] [-SkipCleanup] [-Extended] [-ProgressAction <ActionPreference>] [<CommonParameters>]
|
||||
```
|
||||
|
||||
## DESCRIPTION
|
||||
{{ Fill in the Description }}
|
||||
This function retrieves Group Policy Objects information based on the specified parameters.
|
||||
It can search for GPOs in a forest, exclude specific domains, include specific domains, and provide extended forest information.
|
||||
|
||||
## EXAMPLES
|
||||
|
||||
### Example 1
|
||||
```powershell
|
||||
PS C:\> {{ Add example code here }}
|
||||
### EXAMPLE 1
|
||||
```
|
||||
Invoke-GPOZaurrContent -Forest "Contoso" -IncludeDomains "Domain1", "Domain2" -Type "Security" -OutputType "HTML" -OutputPath "C:\Reports\GPOReport.html"
|
||||
Retrieves security-related Group Policy Objects information for the specified domains and saves the output as an HTML file.
|
||||
```
|
||||
|
||||
{{ Add example description here }}
|
||||
### EXAMPLE 2
|
||||
```
|
||||
Invoke-GPOZaurrContent -GPOPath "CN={31B2F340-016D-11D2-945F-00C04FB984F9},CN=Policies,CN=System,DC=Contoso,DC=com" -Type "All" -OutputType "Object"
|
||||
Retrieves all information for a specific Group Policy Object and outputs the result as an object.
|
||||
```
|
||||
|
||||
### EXAMPLE 3
|
||||
```
|
||||
Invoke-GPOZaurrContent -GPOName "Group Policy Test" -SingleObject | ConvertTo-Json -Depth 3
|
||||
Quickly view GPO settings by name in JSON format for easy inspection.
|
||||
```
|
||||
|
||||
## PARAMETERS
|
||||
|
||||
### -CategoriesOnly
|
||||
{{ Fill CategoriesOnly Description }}
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ExcludeDomains
|
||||
{{ Fill ExcludeDomains Description }}
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: Default
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Extended
|
||||
{{ Fill Extended Description }}
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ExtendedForestInformation
|
||||
{{ Fill ExtendedForestInformation Description }}
|
||||
|
||||
```yaml
|
||||
Type: IDictionary
|
||||
Parameter Sets: Default
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Forest
|
||||
{{ Fill Forest Description }}
|
||||
Specifies the forest name to search for Group Policy Objects.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
@@ -116,27 +69,12 @@ Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FullObjects
|
||||
{{ Fill FullObjects Description }}
|
||||
### -ExcludeDomains
|
||||
Specifies an array of domains to exclude from the search.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -GPOPath
|
||||
{{ Fill GPOPath Description }}
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: Local
|
||||
Type: String[]
|
||||
Parameter Sets: Default
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
@@ -147,7 +85,7 @@ Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -IncludeDomains
|
||||
{{ Fill IncludeDomains Description }}
|
||||
Specifies an array of domains to include in the search.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
@@ -161,12 +99,12 @@ Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Online
|
||||
{{ Fill Online Description }}
|
||||
### -ExtendedForestInformation
|
||||
Specifies additional information about the forest.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Type: IDictionary
|
||||
Parameter Sets: Default
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
@@ -176,27 +114,12 @@ Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Open
|
||||
{{ Fill Open Description }}
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -OutputPath
|
||||
{{ Fill OutputPath Description }}
|
||||
### -GPOPath
|
||||
Specifies the path to a specific Group Policy Object.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Parameter Sets: Local
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
@@ -206,59 +129,13 @@ Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -OutputType
|
||||
{{ Fill OutputType Description }}
|
||||
### -Type
|
||||
Specifies the type of information to retrieve.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
Accepted values: HTML, Object
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SingleObject
|
||||
{{ Fill SingleObject Description }}
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SkipCleanup
|
||||
{{ Fill SkipCleanup Description }}
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SkipNormalize
|
||||
{{ Fill SkipNormalize Description }}
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
@@ -268,7 +145,52 @@ Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Splitter
|
||||
{{ Fill Splitter Description }}
|
||||
Specifies the delimiter to use for splitting information.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: [System.Environment]::NewLine
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -FullObjects
|
||||
Indicates whether to retrieve full objects.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -OutputType
|
||||
Specifies the type of output (HTML or Object).
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: Object
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -OutputPath
|
||||
Specifies the path to save the output.
|
||||
|
||||
```yaml
|
||||
Type: String
|
||||
@@ -282,12 +204,133 @@ Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Type
|
||||
{{ Fill Type Description }}
|
||||
### -Open
|
||||
Indicates whether to open the output after retrieval.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Online
|
||||
Indicates whether to retrieve information online.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -CategoriesOnly
|
||||
Indicates whether to retrieve only categories.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SingleObject
|
||||
When enabled, returns a single consolidated object per GPO rather than multiple objects for each setting. For example, with drive mappings, instead of returning separate objects for each mapped drive in a GPO, it will return one object containing all drive mappings for that GPO. This affects how the data is structured in the output reports.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SkipNormalize
|
||||
Indicates whether to skip normalization.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -SkipCleanup
|
||||
Indicates whether to skip cleanup of the output hashtable. When enabled, empty values in the output hashtable are preserved rather than being removed via Remove-EmptyValue. This parameter affects the final processing step before returning GPO analysis results.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -Extended
|
||||
When enabled, returns the complete output hashtable containing all GPO analysis data, including both the processed reports and raw categories. By default, only the processed reports are returned. This parameter is useful for debugging or when you need access to the underlying data structure.
|
||||
|
||||
```yaml
|
||||
Type: SwitchParameter
|
||||
Parameter Sets: (All)
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: False
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -GPOName
|
||||
Specifies the name of the Group Policy Object to retrieve. The alias of this parameter is `Name`.
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: (All)
|
||||
Parameter Sets: Default
|
||||
Aliases: Name
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -GPOGUID
|
||||
Specifies one or more Group Policy Object GUIDs to retrieve. This parameter allows you to target specific GPOs by their unique identifier rather than display name.
|
||||
|
||||
|
||||
```yaml
|
||||
Type: String[]
|
||||
Parameter Sets: Default
|
||||
Aliases:
|
||||
|
||||
Required: False
|
||||
@@ -297,16 +340,28 @@ Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### -ProgressAction
|
||||
Specifies the action to take when progress is reported.
|
||||
|
||||
```yaml
|
||||
Type: ActionPreference
|
||||
Parameter Sets: (All)
|
||||
Aliases: proga
|
||||
|
||||
Required: False
|
||||
Position: Named
|
||||
Default value: None
|
||||
Accept pipeline input: False
|
||||
Accept wildcard characters: False
|
||||
```
|
||||
|
||||
### CommonParameters
|
||||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
|
||||
|
||||
## INPUTS
|
||||
|
||||
### None
|
||||
|
||||
## OUTPUTS
|
||||
|
||||
### System.Object
|
||||
## NOTES
|
||||
|
||||
## RELATED LINKS
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# Remove GPOS
|
||||
Remove-GPOZaurr -Type Empty, Unlinked -BackupPath "$Env:UserProfile\Desktop\GPO" -BackupDated -LimitProcessing 2 -Verbose -WhatIf
|
||||
# Remove GPOS, but don't touch 2 defined exclusions
|
||||
$ExcludeGroupPolicies = {
|
||||
'TEST | Drive Mapping 1',
|
||||
'TEST | Drive Mapping 2'
|
||||
}
|
||||
Remove-GPOZaurr -Type Empty -BackupPath "$Env:UserProfile\Desktop\GPO" -BackupDated -LimitProcessing 3 -Verbose -WhatIf -ExcludeGroupPolicies $ExcludeGroupPolicies
|
||||
|
||||
# Remove GPOS, but don't touch 2 defined exclusions
|
||||
Remove-GPOZaurr -Type Empty, Unlinked -BackupPath "$Env:UserProfile\Desktop\GPO" -BackupDated -LimitProcessing 2 -Verbose -WhatIf {
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
#$GPOS = Get-GPOZaurr -GPOName 'TEST | Office Configuration'
|
||||
#$GPOS | Format-Table -AutoSize *
|
||||
|
||||
$GPOS = Get-GPOZaurr -GPOName 'New Group Policy Object3'
|
||||
$GPOS = Get-GPOZaurr -GPOName 'TEST | EmptyWITHGPF'
|
||||
$GPOS | Format-Table -AutoSize *
|
||||
@@ -1,3 +1,3 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
#Clear-Host
|
||||
Remove-GPOZaurrPermission -Verbose -Type Unknown -LimitProcessing 1 #-WhatIf
|
||||
Remove-GPOZaurrPermission -Verbose -Type Unknown -LimitProcessing 5 -GPOName 'CA TEST'
|
||||
@@ -2,7 +2,16 @@
|
||||
|
||||
# This gets the same thing as earlier examples
|
||||
# with a difference where one entry per gpo and all settings for that GPO is stored under settings property.
|
||||
$Output = Invoke-GPOZaurrContent -Verbose #-SingleObject -Verbose
|
||||
#$Output = Invoke-GPOZaurrContent -Verbose #-SingleObject -Verbose
|
||||
#$Output | Format-Table
|
||||
|
||||
|
||||
$Output = Invoke-GPOZaurrContent -Verbose -GPOName 'Default Domain Policy'
|
||||
$Output | Format-Table
|
||||
|
||||
Invoke-GPOZaurr -Type GPOAnalysis -GPOName 'Default Domain Policy' -Verbose
|
||||
|
||||
|
||||
return
|
||||
$Output.Reports.RegistrySettings | Format-Table *
|
||||
$Output.Reports.RegistrySettings[0].Settings | Format-Table *
|
||||
@@ -1,4 +1,5 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
$Files = Get-GPOZaurrFiles -Limited -Signature
|
||||
$Files | ConvertTo-Excel -OpenWorkBook -FilePath $Env:USERPROFILE\Desktop\GPOTesting.xlsx -ExcelWorkSheetName 'GPO Output' -AutoFilter -AutoFit -FreezeTopRowFirstColumn
|
||||
$Files = Get-GPOZaurrFiles -Type All -Verbose
|
||||
#$Files | ConvertTo-Excel -OpenWorkBook -FilePath $Env:USERPROFILE\Desktop\GPOTesting.xlsx -ExcelWorkSheetName 'GPO Output' -AutoFilter -AutoFit -FreezeTopRowFirstColumn
|
||||
$Files | Format-Table
|
||||
@@ -4,7 +4,7 @@
|
||||
#$Objects = Get-GPOZaurrInheritance
|
||||
#$Objects | Format-Table
|
||||
|
||||
# Get same output DN, CanonicalName, BlockInheritance (True/False) + Users/Computers + UsersCount/ComputerCount for those with Blocked Inhertiance
|
||||
# Get same output DN, CanonicalName, BlockInheritance (True/False) + Users/Computers + UsersCount/ComputerCount for those with Blocked Inheritance
|
||||
# This is so you can have a list what machines are affected
|
||||
$ExcludedOU = @(
|
||||
# Works on OU/
|
||||
|
||||
@@ -1,19 +1,30 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
Invoke-GPOZaurr -Type GPOOrganizationalUnit -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html
|
||||
# # Shows how to use exclusions for GPOList (different way)
|
||||
# Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOList -Online -Exclusions {
|
||||
# Skip-GroupPolicy -Name 'de14_usr_std'
|
||||
# Skip-GroupPolicy -Name 'ALL | Enable RDP' -DomaiName 'ad.evotec.xyz'
|
||||
# '01446204-d2b5-4c9a-a539-5d0f64f27fbc'
|
||||
# '{01cef2e1-ea5c-4c4a-bd43-94d89d8a7810}'
|
||||
# }
|
||||
|
||||
# Shows how to use exclusions (supported only in GPOBlockedInheritance)
|
||||
Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOBlockedInheritance -Online -Exclusions @(
|
||||
'OU=Test,OU=ITR02,DC=ad,DC=evotec,DC=xyz'
|
||||
)
|
||||
# Invoke-GPOZaurr -Type GPOOrganizationalUnit -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html
|
||||
|
||||
# different approach to query multiple reports or just one
|
||||
Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -PassThru -Type GPOConsistency, GPOList, GPODuplicates, GPOBroken, GPOOwners, NetLogonOwners, GPOPermissionsRead, GPOPermissionsAdministrative,GPOPermissionsUnknown
|
||||
# # Shows how to use exclusions (supported only in GPOBlockedInheritance)
|
||||
# Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOBlockedInheritance -Online -Exclusions @(
|
||||
# 'OU=Test,OU=ITR02,DC=ad,DC=evotec,DC=xyz'
|
||||
# )
|
||||
|
||||
Invoke-GPOZaurr -Type GPOOwners -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html
|
||||
# # different approach to query multiple reports or just one
|
||||
# Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -PassThru -Type GPOConsistency, GPOList, GPODuplicates, GPOBroken, GPOOwners, NetLogonOwners, GPOPermissionsRead, GPOPermissionsAdministrative, GPOPermissionsUnknown
|
||||
|
||||
# Shows how to use exclusions for GPOList (different way)
|
||||
Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOList -Online -Exclusions {
|
||||
Skip-GroupPolicy -Name 'de14_usr_std'
|
||||
Skip-GroupPolicy -Name 'ALL | Enable RDP' -DomaiName 'ad.evotec.xyz'
|
||||
}
|
||||
#Invoke-GPOZaurr -Type GPOOwners,GPOConsistency -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html
|
||||
|
||||
#Invoke-GPOZaurr -Type GPOOwners -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html
|
||||
|
||||
##Invoke-GPOZaurr -Type GPOOwners,GPOConsistency -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html -SplitReports
|
||||
#invoke-gpozaurr -Type GPOOrganizationalUnit
|
||||
#Invoke-GPOZaurr -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPOAnalysis #-SplitReports -Forest test.evotec.pl
|
||||
|
||||
|
||||
Invoke-GPOZaurr -FilePath $PSScriptRoot\Reports\GPOZaurr.html # -Verbose #-Type GPOBlockedInheritance -Forest 'ad.evotec.xyz'
|
||||
@@ -0,0 +1,16 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
#Save-GPOZaurrFiles -GPOPath $Env:USERPROFILE\Desktop\TestF
|
||||
|
||||
#Get-GPOZaurr -GPOPath "$Env:USERPROFILE\Desktop\TestF" | Sort-Object -Property DisplayName | Where-Object { $_.EMpty -eq $true } | Format-Table *
|
||||
|
||||
|
||||
|
||||
return
|
||||
$GPO = Get-GPOZaurr -GPOName 'ALL | Allow use of biometrics'
|
||||
$GPO | Format-List *
|
||||
|
||||
#$GPO.Count
|
||||
#$GPO | Where-Object { $_.Empty -eq $true } | Format-Table *
|
||||
#($GPO | Where-Object { $_.Empty -eq $true }).Count
|
||||
#$GPO | Where-Object { $_.DisplayName -like "*TEST*" } | Format-Table *
|
||||
@@ -0,0 +1,4 @@
|
||||
Import-Module .\GPoZaurr.psd1 -Force
|
||||
|
||||
$Data = Invoke-GPOZaurr -Online -FilePath $PSScriptRoot\Reports\GPOZaurr.html -Type GPORedirect -PassThru
|
||||
$Data.GPORedirect
|
||||
@@ -0,0 +1,11 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
$Output = Invoke-GPOZaurrContent -Verbose -GPOName 'Default Domain Policy'
|
||||
$Output | Format-Table
|
||||
|
||||
# You need PSWriteOffice for that
|
||||
foreach ($Key in $Output.Keys) {
|
||||
$Output[$Key] | Export-OfficeExcel -FilePath $Env:USERPROFILE\Desktop\GPOAnalysis.xlsx -WorkSheetName $Key
|
||||
}
|
||||
|
||||
Invoke-GPOZaurr -Type GPOAnalysis -GPOName 'ALL | Allow use of biometrics', 'ALL | Enable RDP' -GPOGUID '{31B2F340-016D-11D2-945F-00C04FB984F9}' -IncludeDomains 'ad.evotec.xyz' -Verbose
|
||||
@@ -0,0 +1,10 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# search by guid or name for specific GPOs
|
||||
#Get-GPOZaurrMissingFiles -GPOGUID '{2F326111-C21B-4892-B7BC-9BDCB201FFCC}' | Format-Table
|
||||
|
||||
# search for all GPOs with missing files
|
||||
#Get-GPOZaurrMissingFiles -BrokenOnly | Format-Table
|
||||
|
||||
# search for all GPOs with missing files for everythin
|
||||
Invoke-GPOZaurr -Type GPOBrokenPartially #, GPOBroken, GPOBrokenLink
|
||||
@@ -0,0 +1,4 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
Get-GPOZaurrDuplicateObject -Verbose
|
||||
|
||||
@@ -3097,7 +3097,7 @@ Import-Module GPOZaurr -Force</pre><div class="defaultText"><span>Using force ma
|
||||
"When executed it will take a while to generate all data and provide you with new report depending on size of environment."
|
||||
"Once confirmed that data is still showing issues and requires fixing please proceed with next step."
|
||||
</span></div><div class="defaultText"><span>Alternatively if you prefer working with console you can run: </span></div><pre data-enlighter-language="powershell">$GPOOutput = Get-GPOZaurrPermissionConsistency
|
||||
$GPOOutput | Format-Table # do your actions as desired</pre><div class="defaultText"><span>It provides same data as you see in table above just doesn't prettify it for you.</span></div></div><div style="padding:0px" id="WizardStep-0tiejcyn" class="tab-pane flexElement" role="tabpanel"><div class="defaultText"><span>Following command when executed fixes inconsistent permissions.</span></div><div class="defaultText"><span style="color:#000000;font-weight:normal">Make sure when running it for the first time to run it with </span><span style="color:#ff0000;font-weight:bold">WhatIf</span><span style="color:#000000;font-weight:normal"> parameter as shown below to prevent accidental removal.</span></div><div class="defaultText"><span>Make sure to fill in TargetDomain to match your Domain Admin permission account</span></div><pre data-enlighter-language="powershell">Repair-GPOZaurrPermissionConsistency -IncludeDomains "TargetDomain" -Verbose -WhatIf</pre><div class="defaultText"><span>After execution please make sure there are no errors, make sure to review provided output, and confirm that what is about to be deleted matches expected data. Once happy with results please follow with command: </span></div><pre data-enlighter-language="powershell">Repair-GPOZaurrPermissionConsistency -LimitProcessing 2 -IncludeDomains "TargetDomain"</pre><div class="defaultText"><span>This command when executed repairs only first X inconsistent permissions. Use LimitProcessing parameter to prevent mass fixing and increase the counter when no errors occur. </span><span>Repeat step above as much as needed increasing LimitProcessing count till there's nothing left. In case of any issues please review and action accordingly. </span></div><div class="defaultText"><span>If there's nothing else to be fixed, we can skip to next step step</span></div></div><div style="padding:0px" id="WizardStep-rj10lm2s" class="tab-pane flexElement" role="tabpanel"><div class="defaultText"><span>Unfortunetly this step is manual until automation is developed. </span></div><div class="defaultText"><span>If there are inconsistent permissions found inside GPO one has to fix them manually by going into SYSVOL and making sure inheritance is enabled, and that permissions are consistent across all files.</span></div></div><div style="padding:0px" id="WizardStep-xg65antb" class="tab-pane flexElement" role="tabpanel"><div class="defaultText"><span>Once cleanup task was executed properly, we need to verify that report now shows no problems.</span></div><pre data-enlighter-language="powershell">Invoke-GPOZaurr -FilePath $Env:UserProfile\Desktop\GPOZaurrPermissionsInconsistentAfter.html -Verbose -Type GPOConsistency</pre><div class="defaultText"><span style="color:#4d1a7f">If everything is healthy in the report you're done! Enjoy rest of the day!</span></div></div></div><script> $(document).ready(function(){
|
||||
$GPOOutput | Format-Table # do your actions as desired</pre><div class="defaultText"><span>It provides same data as you see in table above just doesn't prettify it for you.</span></div></div><div style="padding:0px" id="WizardStep-0tiejcyn" class="tab-pane flexElement" role="tabpanel"><div class="defaultText"><span>Following command when executed fixes inconsistent permissions.</span></div><div class="defaultText"><span style="color:#000000;font-weight:normal">Make sure when running it for the first time to run it with </span><span style="color:#ff0000;font-weight:bold">WhatIf</span><span style="color:#000000;font-weight:normal"> parameter as shown below to prevent accidental removal.</span></div><div class="defaultText"><span>Make sure to fill in TargetDomain to match your Domain Admin permission account</span></div><pre data-enlighter-language="powershell">Repair-GPOZaurrPermissionConsistency -IncludeDomains "TargetDomain" -Verbose -WhatIf</pre><div class="defaultText"><span>After execution please make sure there are no errors, make sure to review provided output, and confirm that what is about to be deleted matches expected data. Once happy with results please follow with command: </span></div><pre data-enlighter-language="powershell">Repair-GPOZaurrPermissionConsistency -LimitProcessing 2 -IncludeDomains "TargetDomain"</pre><div class="defaultText"><span>This command when executed repairs only first X inconsistent permissions. Use LimitProcessing parameter to prevent mass fixing and increase the counter when no errors occur. </span><span>Repeat step above as much as needed increasing LimitProcessing count till there's nothing left. In case of any issues please review and action accordingly. </span></div><div class="defaultText"><span>If there's nothing else to be fixed, we can skip to next step step</span></div></div><div style="padding:0px" id="WizardStep-rj10lm2s" class="tab-pane flexElement" role="tabpanel"><div class="defaultText"><span>Unfortunately this step is manual until automation is developed. </span></div><div class="defaultText"><span>If there are inconsistent permissions found inside GPO one has to fix them manually by going into SYSVOL and making sure inheritance is enabled, and that permissions are consistent across all files.</span></div></div><div style="padding:0px" id="WizardStep-xg65antb" class="tab-pane flexElement" role="tabpanel"><div class="defaultText"><span>Once cleanup task was executed properly, we need to verify that report now shows no problems.</span></div><pre data-enlighter-language="powershell">Invoke-GPOZaurr -FilePath $Env:UserProfile\Desktop\GPOZaurrPermissionsInconsistentAfter.html -Verbose -Type GPOConsistency</pre><div class="defaultText"><span style="color:#4d1a7f">If everything is healthy in the report you're done! Enjoy rest of the day!</span></div></div></div><script> $(document).ready(function(){
|
||||
// SmartWizard initialize
|
||||
$('#TabPanel-fbsgNINg').smartWizard({
|
||||
"autoAdjustHeight": false,
|
||||
|
||||
+16
-11
@@ -4,31 +4,36 @@
|
||||
CmdletsToExport = @()
|
||||
CompanyName = 'Evotec'
|
||||
CompatiblePSEditions = @('Desktop')
|
||||
Copyright = '(c) 2011 - 2023 Przemyslaw Klys @ Evotec. All rights reserved.'
|
||||
Copyright = '(c) 2011 - 2025 Przemyslaw Klys @ Evotec. All rights reserved.'
|
||||
Description = 'Group Policy Eater is a PowerShell module that aims to gather information about Group Policies but also allows fixing issues that you may find in them.'
|
||||
FunctionsToExport = @('Add-GPOPermission', 'Add-GPOZaurrPermission', 'Backup-GPOZaurr', 'Clear-GPOZaurrSysvolDFSR', 'ConvertFrom-CSExtension', 'Export-GPOZaurrContent', 'Find-CSExtension', 'Get-GPOZaurr', 'Get-GPOZaurrAD', 'Get-GPOZaurrBackupInformation', 'Get-GPOZaurrBroken', 'Get-GPOZaurrBrokenLink', 'Get-GPOZaurrDictionary', 'Get-GPOZaurrDuplicateObject', 'Get-GPOZaurrFiles', 'Get-GPOZaurrFilesPolicyDefinition', 'Get-GPOZaurrFolders', 'Get-GPOZaurrInheritance', 'Get-GPOZaurrLegacyFiles', 'Get-GPOZaurrLink', 'Get-GPOZaurrLinkSummary', 'Get-GPOZaurrNetLogon', 'Get-GPOZaurrOrganizationalUnit', 'Get-GPOZaurrOwner', 'Get-GPOZaurrPassword', 'Get-GPOZaurrPermission', 'Get-GPOZaurrPermissionAnalysis', 'Get-GPOZaurrPermissionConsistency', 'Get-GPOZaurrPermissionIssue', 'Get-GPOZaurrPermissionRoot', 'Get-GPOZaurrPermissionSummary', 'Get-GPOZaurrSysvolDFSR', 'Get-GPOZaurrUpdates', 'Get-GPOZaurrWMI', 'Invoke-GPOZaurr', 'Invoke-GPOZaurrContent', 'Invoke-GPOZaurrPermission', 'Invoke-GPOZaurrSupport', 'New-GPOZaurrWMI', 'Optimize-GPOZaurr', 'Remove-GPOPermission', 'Remove-GPOZaurr', 'Remove-GPOZaurrBroken', 'Remove-GPOZaurrDuplicateObject', 'Remove-GPOZaurrFolders', 'Remove-GPOZaurrLegacyFiles', 'Remove-GPOZaurrLinkEmptyOU', 'Remove-GPOZaurrPermission', 'Remove-GPOZaurrWMI', 'Repair-GPOZaurrBrokenLink', 'Repair-GPOZaurrNetLogonOwner', 'Repair-GPOZaurrPermission', 'Repair-GPOZaurrPermissionConsistency', 'Restore-GPOZaurr', 'Save-GPOZaurrFiles', 'Set-GPOOwner', 'Set-GPOZaurrOwner', 'Set-GPOZaurrStatus', 'Skip-GroupPolicy')
|
||||
FunctionsToExport = @('Add-GPOPermission', 'Add-GPOZaurrPermission', 'Backup-GPOZaurr', 'Clear-GPOZaurrSysvolDFSR', 'ConvertFrom-CSExtension', 'Export-GPOZaurrContent', 'Find-CSExtension', 'Get-GPOZaurr', 'Get-GPOZaurrAD', 'Get-GPOZaurrBackupInformation', 'Get-GPOZaurrBroken', 'Get-GPOZaurrBrokenLink', 'Get-GPOZaurrDictionary', 'Get-GPOZaurrDuplicateObject', 'Get-GPOZaurrFiles', 'Get-GPOZaurrFilesPolicyDefinition', 'Get-GPOZaurrFolders', 'Get-GPOZaurrInheritance', 'Get-GPOZaurrLegacyFiles', 'Get-GPOZaurrLink', 'Get-GPOZaurrLinkSummary', 'Get-GPOZaurrMissingFiles', 'Get-GPOZaurrNetLogon', 'Get-GPOZaurrOrganizationalUnit', 'Get-GPOZaurrOwner', 'Get-GPOZaurrPassword', 'Get-GPOZaurrPermission', 'Get-GPOZaurrPermissionAnalysis', 'Get-GPOZaurrPermissionConsistency', 'Get-GPOZaurrPermissionIssue', 'Get-GPOZaurrPermissionRoot', 'Get-GPOZaurrPermissionSummary', 'Get-GPOZaurrRedirect', 'Get-GPOZaurrSysvolDFSR', 'Get-GPOZaurrUpdates', 'Get-GPOZaurrWMI', 'Invoke-GPOZaurr', 'Invoke-GPOZaurrContent', 'Invoke-GPOZaurrPermission', 'Invoke-GPOZaurrSupport', 'New-GPOZaurrWMI', 'Optimize-GPOZaurr', 'Remove-GPOPermission', 'Remove-GPOZaurr', 'Remove-GPOZaurrBroken', 'Remove-GPOZaurrDuplicateObject', 'Remove-GPOZaurrFolders', 'Remove-GPOZaurrLegacyFiles', 'Remove-GPOZaurrLinkEmptyOU', 'Remove-GPOZaurrPermission', 'Remove-GPOZaurrWMI', 'Repair-GPOZaurrBrokenLink', 'Repair-GPOZaurrNetLogonOwner', 'Repair-GPOZaurrPermission', 'Repair-GPOZaurrPermissionConsistency', 'Restore-GPOZaurr', 'Save-GPOZaurrFiles', 'Set-GPOOwner', 'Set-GPOZaurrOwner', 'Set-GPOZaurrStatus', 'Skip-GroupPolicy')
|
||||
GUID = 'f7d4c9e4-0298-4f51-ad77-e8e3febebbde'
|
||||
ModuleVersion = '0.0.159'
|
||||
ModuleVersion = '1.1.10'
|
||||
PowerShellVersion = '5.1'
|
||||
PrivateData = @{
|
||||
PSData = @{
|
||||
ProjectUri = 'https://github.com/EvotecIT/GPOZaurr'
|
||||
Tags = @('Windows', 'ActiveDirectory', 'GPO', 'GroupPolicy')
|
||||
ExternalModuleDependencies = @('CimCmdlets', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Security')
|
||||
ProjectUri = 'https://github.com/EvotecIT/GPOZaurr'
|
||||
RequireLicenseAcceptance = $false
|
||||
Tags = @('Windows', 'ActiveDirectory', 'GPO', 'GroupPolicy')
|
||||
}
|
||||
}
|
||||
RequiredModules = @(@{
|
||||
ModuleName = 'PSSharedGoods'
|
||||
ModuleVersion = '0.0.264'
|
||||
Guid = '0b0ba5c5-ec85-4c2b-a718-874e55a8bc3f'
|
||||
ModuleName = 'PSWriteColor'
|
||||
ModuleVersion = '1.0.3'
|
||||
}, @{
|
||||
Guid = 'ee272aa8-baaa-4edf-9f45-b6d6f7d844fe'
|
||||
ModuleName = 'PSSharedGoods'
|
||||
ModuleVersion = '0.0.312'
|
||||
}, @{
|
||||
ModuleName = 'ADEssentials'
|
||||
ModuleVersion = '0.0.148'
|
||||
Guid = '9fc9fd61-7f11-4f4b-a527-084086f1905f'
|
||||
ModuleName = 'ADEssentials'
|
||||
ModuleVersion = '0.0.267'
|
||||
}, @{
|
||||
ModuleName = 'PSWriteHTML'
|
||||
ModuleVersion = '0.0.188'
|
||||
Guid = 'a7bdf640-f5cb-4acf-9de0-365b322d245c'
|
||||
ModuleName = 'PSWriteHTML'
|
||||
ModuleVersion = '1.27.0'
|
||||
}, 'CimCmdlets', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Utility', 'Microsoft.PowerShell.Security')
|
||||
RootModule = 'GPOZaurr.psm1'
|
||||
}
|
||||
+4
-4
@@ -13,7 +13,7 @@ if ($AssemblyFolders.BaseName -contains 'Standard') {
|
||||
}
|
||||
}
|
||||
$FoundErrors = @(
|
||||
Foreach ($Import in @($Assembly)) {
|
||||
foreach ($Import in @($Assembly)) {
|
||||
try {
|
||||
Add-Type -Path $Import.Fullname -ErrorAction Stop
|
||||
} catch [System.Reflection.ReflectionTypeLoadException] {
|
||||
@@ -35,10 +35,10 @@ $FoundErrors = @(
|
||||
}
|
||||
}
|
||||
#Dot source the files
|
||||
Foreach ($Import in @($Private + $Public)) {
|
||||
Try {
|
||||
foreach ($Import in @($Private + $Public)) {
|
||||
try {
|
||||
. $Import.Fullname
|
||||
} Catch {
|
||||
} catch {
|
||||
Write-Error -Message "Failed to import functions from $($import.Fullname): $_"
|
||||
$true
|
||||
}
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function ConvertFrom-XMLRSOP {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts XML data representing Resultant Set of Policy (RSOP) into a structured PowerShell object.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes XML data representing RSOP and converts it into a structured PowerShell object for easier manipulation and analysis.
|
||||
|
||||
.PARAMETER Content
|
||||
The XML content representing the RSOP data.
|
||||
|
||||
.PARAMETER ResultsType
|
||||
The type of results being processed.
|
||||
|
||||
.PARAMETER Splitter
|
||||
The delimiter used to split certain data elements.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertFrom-XMLRSOP -Content $xmlData -ResultsType "Computer" -Splitter "`n"
|
||||
|
||||
Description:
|
||||
Converts the XML data in $xmlData representing computer RSOP results using a newline as the splitter.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertFrom-XMLRSOP -Content $xmlData -ResultsType "User" -Splitter ","
|
||||
|
||||
Description:
|
||||
Converts the XML data in $xmlData representing user RSOP results using a comma as the splitter.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Xml.XmlElement]$Content,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLAccountPolicy {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing an account policy into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing an account policy and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the account policy.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLAccountPolicy -GPO $accountPolicyObject -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $accountPolicyObject into XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$accountPolicies | ConvertTo-XMLAccountPolicy -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple account policies in $accountPolicies into XML format for each object.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLAudit {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing an audit policy into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing an audit policy and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the audit policy.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLAudit -GPO $auditPolicyObject -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $auditPolicyObject into XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$auditPolicies | ConvertTo-XMLAudit -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple audit policies in $auditPolicies into XML format for each object.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function ConvertTo-XMLCertificates {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing certificate data into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing certificate data and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the certificate data.
|
||||
|
||||
.PARAMETER Category
|
||||
An array of categories for the certificate data.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLCertificates -GPO $certificateDataObject -Category @('Category1', 'Category2') -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $certificateDataObject into XML format for multiple categories as a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$certificateDataObjects | ConvertTo-XMLCertificates -Category @('Category1') -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple certificate data objects in $certificateDataObjects into XML format for a single category.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLDriveMapSettings {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing drive mapping settings into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing drive mapping settings and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the drive mapping settings.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLDriveMapSettings -GPO $driveMapSettingsObject -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $driveMapSettingsObject into XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$driveMapSettings | ConvertTo-XMLDriveMapSettings -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple drive mapping settings in $driveMapSettings into XML format for each object.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,38 @@
|
||||
function ConvertTo-XMLEventLog {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) data to an XML event log format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PSCustomObject representing GPO data and converts it to an XML event log format. It creates a structured XML output with specific GPO properties.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the PSCustomObject containing GPO data to be converted.
|
||||
|
||||
.EXAMPLE
|
||||
$GPOData = [PSCustomObject]@{
|
||||
DisplayName = 'Example GPO'
|
||||
DomainName = 'example.com'
|
||||
GUID = '12345678-1234-1234-1234-1234567890AB'
|
||||
GpoType = 'Security'
|
||||
DataSet = @(
|
||||
[PSCustomObject]@{
|
||||
Log = 'Application'
|
||||
Name = 'AuditLogRetentionPeriod'
|
||||
SettingNumber = '1'
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
Log = 'System'
|
||||
Name = 'MaximumLogSize'
|
||||
SettingNumber = '1024'
|
||||
}
|
||||
)
|
||||
Linked = $true
|
||||
LinksCount = 2
|
||||
Links = @('OU=Finance,DC=example,DC=com', 'OU=IT,DC=example,DC=com')
|
||||
}
|
||||
ConvertTo-XMLEventLog -GPO $GPOData
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLFolderRedirection {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing folder redirection settings into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing folder redirection settings and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the folder redirection settings.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLFolderRedirection -GPO $folderRedirectionSettingsObject -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $folderRedirectionSettingsObject into XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$folderRedirectionSettings | ConvertTo-XMLFolderRedirection -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple folder redirection settings in $folderRedirectionSettings into XML format for each object.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function ConvertTo-XMLGenericPolicy {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PowerShell custom object representing generic policy settings into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PowerShell custom object representing generic policy settings and converts it into XML format for storage or transmission.
|
||||
|
||||
.PARAMETER GPO
|
||||
The PowerShell custom object representing the generic policy settings.
|
||||
|
||||
.PARAMETER Category
|
||||
An array of categories for the generic policy settings.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLGenericPolicy -GPO $genericPolicyObject -Category @('Category1', 'Category2') -SingleObject
|
||||
|
||||
Description:
|
||||
Converts the $genericPolicyObject into XML format for multiple categories as a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$genericPolicyObjects | ConvertTo-XMLGenericPolicy -Category @('Category1') -SingleObject
|
||||
|
||||
Description:
|
||||
Converts multiple generic policy settings in $genericPolicyObjects into XML format for a single category.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
@@ -64,7 +92,26 @@
|
||||
|
||||
#>
|
||||
if ($Value.Value.Element) {
|
||||
$Settings["$SubName"] = $Value.Value.Element.Data -join '; '
|
||||
[Array] $ElementValues = foreach ($Element in @($Value.Value.Element)) {
|
||||
if (-not $Element) {
|
||||
continue
|
||||
}
|
||||
$ElementName = [string] $Element.Name
|
||||
$ElementData = [string] $Element.Data
|
||||
|
||||
if (-not [string]::IsNullOrWhiteSpace($ElementName) -and ($ElementData -eq '' -or $ElementData -eq '0')) {
|
||||
$ElementName
|
||||
} elseif (-not [string]::IsNullOrWhiteSpace($ElementName) -and -not [string]::IsNullOrWhiteSpace($ElementData) -and $ElementName -ne $ElementData) {
|
||||
"$ElementName ($ElementData)"
|
||||
} elseif (-not [string]::IsNullOrWhiteSpace($ElementData)) {
|
||||
$ElementData
|
||||
} elseif (-not [string]::IsNullOrWhiteSpace($ElementName)) {
|
||||
$ElementName
|
||||
}
|
||||
}
|
||||
if ($ElementValues.Count -gt 0) {
|
||||
$Settings["$SubName"] = $ElementValues -join '; '
|
||||
}
|
||||
} elseif ($null -eq $Value.Value.Name) {
|
||||
# Shouldn't happen but lets see
|
||||
Write-Verbose "Tracking $Value"
|
||||
@@ -146,7 +193,26 @@
|
||||
|
||||
#>
|
||||
if ($Value.Value.Element) {
|
||||
$CreateGPO["$SubName"] = $Value.Value.Element.Data -join '; '
|
||||
[Array] $ElementValues = foreach ($Element in @($Value.Value.Element)) {
|
||||
if (-not $Element) {
|
||||
continue
|
||||
}
|
||||
$ElementName = [string] $Element.Name
|
||||
$ElementData = [string] $Element.Data
|
||||
|
||||
if (-not [string]::IsNullOrWhiteSpace($ElementName) -and ($ElementData -eq '' -or $ElementData -eq '0')) {
|
||||
$ElementName
|
||||
} elseif (-not [string]::IsNullOrWhiteSpace($ElementName) -and -not [string]::IsNullOrWhiteSpace($ElementData) -and $ElementName -ne $ElementData) {
|
||||
"$ElementName ($ElementData)"
|
||||
} elseif (-not [string]::IsNullOrWhiteSpace($ElementData)) {
|
||||
$ElementData
|
||||
} elseif (-not [string]::IsNullOrWhiteSpace($ElementName)) {
|
||||
$ElementName
|
||||
}
|
||||
}
|
||||
if ($ElementValues.Count -gt 0) {
|
||||
$CreateGPO["$SubName"] = $ElementValues -join '; '
|
||||
}
|
||||
} elseif ($null -eq $Value.Value.Name) {
|
||||
# Shouldn't happen but lets see
|
||||
Write-Verbose "Tracking $Value"
|
||||
@@ -176,4 +242,4 @@
|
||||
#}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLGenericPublicKey {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a PSCustomObject representing a Group Policy Object (GPO) to an XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a PSCustomObject representing a GPO and converts it to an XML format. It extracts specific properties from the GPO object and organizes them into a structured XML output.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the PSCustomObject representing the GPO to be converted.
|
||||
|
||||
.PARAMETER Category
|
||||
Specifies an array of strings representing categories to include in the XML output.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLGenericPublicKey -GPO $MyGPO -Category @("Category1", "Category2") -SingleObject
|
||||
Converts the PSCustomObject $MyGPO to an XML format including categories "Category1" and "Category2" as a single object.
|
||||
|
||||
.EXAMPLE
|
||||
$GPOs | ConvertTo-XMLGenericPublicKey -Category @("Category1")
|
||||
Converts multiple GPOs in the $GPOs array to an XML format including category "Category1".
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function ConvertTo-XMLGenericSecuritySettings {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Generic Security Settings to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Generic Security Settings to XML format for further processing.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to convert.
|
||||
|
||||
.PARAMETER Category
|
||||
Specifies the category of settings to convert.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLGenericSecuritySettings -GPO $GPOObject -Category 'Security'
|
||||
|
||||
Description:
|
||||
Converts the security settings of the specified GPO object to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLGenericSecuritySettings -GPO $GPOObject -Category 'Network'
|
||||
|
||||
Description:
|
||||
Converts the network settings of the specified GPO object to XML format.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLLocalGroups {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Objects (GPO) to XML format for local groups.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Group Policy Objects (GPO) to XML format for local groups. It takes a GPO object and an optional switch to process a single object.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to be converted to XML format.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to process a single GPO object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLLocalGroups -GPO $myGPO
|
||||
Converts the specified GPO object to XML format for local groups.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLLocalGroups -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object to XML format for local groups.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,27 @@
|
||||
function ConvertTo-XMLLocalUser {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Objects (GPO) data to XML format for local users.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts GPO data to XML format specifically for local users. It extracts relevant user settings from the GPO data and organizes them into a structured XML format.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object containing user data to be converted.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single user object or multiple user objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLLocalUser -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object to XML format for local users.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLLocalUser -GPO $myGPO
|
||||
Converts multiple GPO objects to XML format for local users.
|
||||
|
||||
#>
|
||||
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,35 @@
|
||||
function ConvertTo-XMLNested {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts nested XML elements to a structured format for further processing.
|
||||
|
||||
.DESCRIPTION
|
||||
This function recursively converts nested XML elements to a structured format for easier manipulation and analysis. It extracts properties from the XML elements and organizes them into a hierarchical structure.
|
||||
|
||||
.PARAMETER CreateGPO
|
||||
Specifies the dictionary representing the XML structure being created.
|
||||
|
||||
.PARAMETER Setting
|
||||
Specifies the XML element to be processed.
|
||||
|
||||
.PARAMETER SkipNames
|
||||
Specifies an array of property names to skip during processing.
|
||||
|
||||
.PARAMETER Name
|
||||
Specifies the name of the current XML element being processed.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLNested -CreateGPO $MyGPO -Setting $XmlSetting -SkipNames @('Name', 'Value') -Name 'Root'
|
||||
|
||||
Description:
|
||||
Converts the nested XML element $XmlSetting into a structured format stored in $MyGPO, skipping properties 'Name' and 'Value', with the root element named 'Root'.
|
||||
|
||||
.EXAMPLE
|
||||
$XmlElements | ForEach-Object { ConvertTo-XMLNested -CreateGPO $Output -Setting $_ -SkipNames @('ID') -Name 'Element' }
|
||||
|
||||
Description:
|
||||
Processes multiple XML elements in $XmlElements, converting each into a structured format stored in $Output, skipping property 'ID', and naming each element 'Element'.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Collections.IDictionary] $CreateGPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLPolicies {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) data to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts the provided GPO data into XML format for easier processing and analysis.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object containing the data to be converted.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPolicies -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object $myGPO to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPolicies -GPO $GPOList
|
||||
Converts multiple GPO objects in $GPOList to XML format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLPrinter {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Objects (GPO) to an XML printer format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts GPO objects to an XML printer format, providing detailed information about printers and printer connections.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object to be converted.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPrinter -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object $myGPO to an XML printer format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPrinter -GPO $myGPO
|
||||
Converts multiple GPO objects to an XML printer format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function ConvertTo-XMLPrinterInternal {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts printer settings to XML format for internal use.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts printer settings to XML format for internal use. It takes a GPO object, entry details, type, and a switch for limited output. The output includes various printer settings in XML format.
|
||||
|
||||
.PARAMETER GPO
|
||||
The GPO object containing printer settings.
|
||||
|
||||
.PARAMETER Entry
|
||||
Details of the printer entry.
|
||||
|
||||
.PARAMETER Type
|
||||
The type of printer setting.
|
||||
|
||||
.PARAMETER Limited
|
||||
Switch to output limited printer settings.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPrinterInternal -GPO $GPO -Entry $Entry -Type "Network" -Limited
|
||||
Converts the specified printer settings to XML format with limited output.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLPrinterInternal -GPO $GPO -Entry $Entry -Type "Local"
|
||||
Converts the specified printer settings to XML format without limited output.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,59 @@
|
||||
function ConvertTo-XMLRegistryAutologon {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a Group Policy Object (GPO) to an XML format for Registry Autologon settings.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a GPO object as input and extracts relevant Registry Autologon settings to create an XML representation.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to be converted to XML format for Registry Autologon settings.
|
||||
|
||||
.EXAMPLE
|
||||
$GPO = [PSCustomObject]@{
|
||||
DisplayName = "Autologon GPO"
|
||||
DomainName = "example.com"
|
||||
GUID = "12345678-1234-5678-1234-567812345678"
|
||||
GpoType = "Registry"
|
||||
DataSet = [PSCustomObject]@{
|
||||
Registry = @(
|
||||
[PSCustomObject]@{
|
||||
Properties = [PSCustomObject]@{
|
||||
Key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
Name = "AutoAdminLogon"
|
||||
Value = $true
|
||||
Changed = Get-Date
|
||||
}
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
Properties = [PSCustomObject]@{
|
||||
Key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
Name = "DefaultDomainName"
|
||||
Value = "example.com"
|
||||
Changed = Get-Date
|
||||
}
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
Properties = [PSCustomObject]@{
|
||||
Key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
Name = "DefaultUserName"
|
||||
Value = "user"
|
||||
Changed = Get-Date
|
||||
}
|
||||
},
|
||||
[PSCustomObject]@{
|
||||
Properties = [PSCustomObject]@{
|
||||
Key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
Name = "DefaultPassword"
|
||||
Value = "password"
|
||||
Changed = Get-Date
|
||||
}
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
ConvertTo-XMLRegistryAutologon -GPO $GPO
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
function ConvertTo-XMLRegistryAutologonOnReport {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) settings related to Autologon into an XML report.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a GPO object as input and extracts Autologon related settings to generate an XML report.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object containing Autologon settings.
|
||||
|
||||
.EXAMPLE
|
||||
$GPO = [PSCustomObject]@{
|
||||
DisplayName = "Autologon GPO"
|
||||
DomainName = "example.com"
|
||||
GUID = "12345678-1234-1234-1234-1234567890AB"
|
||||
GpoType = "Security"
|
||||
Settings = @(
|
||||
[PSCustomObject]@{
|
||||
Key = "SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon"
|
||||
Name = "AutoAdminLogon"
|
||||
Value = $true
|
||||
Changed = (Get-Date)
|
||||
}
|
||||
)
|
||||
Linked = $true
|
||||
LinksCount = 1
|
||||
Links = "area1.local"
|
||||
}
|
||||
ConvertTo-XMLRegistryAutologonOnReport -GPO $GPO
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
function ConvertTo-XMLRegistryDefenderOnReport {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Defender-related raw registry settings from the RegistrySettings report.
|
||||
|
||||
.DESCRIPTION
|
||||
This function is used as a fallback for Defender settings that are not exposed as
|
||||
policy categories but are still present in RegistrySettings output.
|
||||
|
||||
.PARAMETER GPO
|
||||
RegistrySettings report object generated by ConvertTo-XMLRegistrySettings -SingleObject.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
)
|
||||
|
||||
[Array] $RegistrySettings = @()
|
||||
if ($GPO.Settings) {
|
||||
$RegistrySettings = $GPO.Settings
|
||||
} elseif ($GPO.DataSet) {
|
||||
# This path supports direct use from dictionary code where RegistrySettings is not requested explicitly.
|
||||
[Array] $DataSet = $GPO.DataSet
|
||||
if ($DataSet.Count -gt 0 -and (
|
||||
$DataSet[0].PSObject.Properties.Name -contains 'Properties' -or
|
||||
$DataSet[0].PSObject.Properties.Name -contains 'Registry' -or
|
||||
$DataSet[0].PSObject.Properties.Name -contains 'Collection'
|
||||
)
|
||||
) {
|
||||
$RegistrySettings = Get-XMLNestedRegistry -GPO $GPO -DataSet $GPO.DataSet
|
||||
}
|
||||
}
|
||||
|
||||
$UsedNames = [System.Collections.Generic.List[string]]::new()
|
||||
$CreateGPO = [ordered] @{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
}
|
||||
$DefenderSettings = 0
|
||||
|
||||
foreach ($Registry in $RegistrySettings) {
|
||||
if ($Registry.Key -like 'SOFTWARE\Microsoft\Windows Defender*') {
|
||||
$DefenderSettings++
|
||||
$SettingName = if ($Registry.Name) { $Registry.Name } else { $Registry.Key }
|
||||
$PropertyName = Format-ToTitleCase -Text $SettingName -RemoveWhiteSpace -RemoveChar ',', '-', "'", '\(', '\)', ':'
|
||||
|
||||
if ($PropertyName -in $UsedNames) {
|
||||
$UsedNames.Add($PropertyName)
|
||||
$TimesUsed = ($UsedNames | Group-Object | Where-Object { $_.Name -eq $PropertyName }).Count
|
||||
$PropertyName = -join ($PropertyName, "$TimesUsed")
|
||||
} else {
|
||||
$UsedNames.Add($PropertyName)
|
||||
}
|
||||
|
||||
$SettingValue = $Registry.Value
|
||||
if ($null -eq $SettingValue -or "$SettingValue" -eq '') {
|
||||
$SettingValue = $Registry.Name
|
||||
}
|
||||
$CreateGPO[$PropertyName] = $SettingValue
|
||||
|
||||
# Some Defender data can be encoded in either value or value-name depending on setting type.
|
||||
if ($Registry.Name -and "$SettingValue" -ne "$($Registry.Name)") {
|
||||
$CreateGPO["$($PropertyName)ValueName"] = $Registry.Name
|
||||
}
|
||||
if ($Registry.Key) {
|
||||
$CreateGPO["$($PropertyName)RegistryKey"] = $Registry.Key
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($DefenderSettings -gt 0) {
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,19 @@
|
||||
function ConvertTo-XMLRegistryInternetExplorerZones {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts registry settings related to Internet Explorer security zones into XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts registry settings from a Group Policy Object (GPO) related to Internet Explorer security zones into XML format. It extracts relevant information such as display name, domain name, GUID, GPO type, configuration, policy type, and security zone based on the registry settings provided.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) containing the registry settings to be converted.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLRegistryInternetExplorerZones -GPO $GPO
|
||||
Converts the registry settings from the specified Group Policy Object ($GPO) related to Internet Explorer security zones into XML format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLRegistrySettings {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) settings to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts the settings of a Group Policy Object (GPO) to XML format. It can be used to export GPO settings for analysis or backup purposes.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to convert to XML format.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLRegistrySettings -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLRegistrySettings -GPO $myGPO
|
||||
Converts multiple GPO objects to XML format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
function ConvertTo-XMLRestrictedGroups {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
[switch] $SingleObject
|
||||
)
|
||||
if ($SingleObject) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
Count = 0
|
||||
Settings = $null
|
||||
}
|
||||
[Array] $CreateGPO['Settings'] = foreach ($Script in $GPO.DataSet) {
|
||||
$Members = foreach ($Member in $Group.Member) {
|
||||
if ($($Member.SID.'#text')) {
|
||||
"$($Member.Name.'#text') ($($Member.SID.'#text'))"
|
||||
} else {
|
||||
$Member.Name.'#text'
|
||||
}
|
||||
}
|
||||
$MemberOf = foreach ($Member in $Group.MemberOf) {
|
||||
if ($($Member.SID.'#text')) {
|
||||
"$($Member.Name.'#text') ($($Member.SID.'#text'))"
|
||||
} else {
|
||||
$Member.Name.'#text'
|
||||
}
|
||||
}
|
||||
[PSCustomObject]@{
|
||||
GroupName = $Group.GroupName.Name
|
||||
GroupSID = $Group.GroupName.SID.'#text'
|
||||
Members = $Members -join ', '
|
||||
MembersOf = $MemberOf -join ', '
|
||||
}
|
||||
}
|
||||
$CreateGPO['DataCount'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($Group in $GPO.DataSet) {
|
||||
$Members = foreach ($Member in $Group.Member) {
|
||||
if ($($Member.SID.'#text')) {
|
||||
"$($Member.Name.'#text') ($($Member.SID.'#text'))"
|
||||
} else {
|
||||
$Member.Name.'#text'
|
||||
}
|
||||
}
|
||||
$MemberOf = foreach ($Member in $Group.MemberOf) {
|
||||
if ($($Member.SID.'#text')) {
|
||||
"$($Member.Name.'#text') ($($Member.SID.'#text'))"
|
||||
} else {
|
||||
$Member.Name.'#text'
|
||||
}
|
||||
}
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
GroupName = $Group.GroupName.Name.'#text'
|
||||
GroupSID = $Group.GroupName.SID.'#text'
|
||||
Members = $Members -join ', '
|
||||
MembersOf = $MemberOf -join ', '
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLScripts {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Objects (GPO) to XML scripts.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts GPO objects to XML scripts for further processing.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object to be converted.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLScripts -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object to an XML script.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLScripts -GPO $myGPO
|
||||
Converts multiple GPO objects to XML scripts.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLSecurityOptions {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) data to XML security options.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts GPO data to XML security options for further processing.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object to convert.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSecurityOptions -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object to XML security options.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSecurityOptions -GPO $myGPO
|
||||
Converts multiple GPO objects to XML security options.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLSoftwareInstallation {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Object (GPO) data into XML format for software installation.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes GPO data and converts it into XML format suitable for software installation. It creates an XML structure with detailed information about each software installation entry.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object containing software installation data.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSoftwareInstallation -GPO $GPOObject -SingleObject
|
||||
Converts a single GPO object into XML format for software installation.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSoftwareInstallation -GPO $GPOObject
|
||||
Converts multiple GPO objects into XML format for software installation.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLSystemServices {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Group Policy Objects (GPO) data to an XML format for System Services.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a GPO object and converts its data into an XML format suitable for System Services. It organizes the GPO data including service names, startup modes, security auditing status, permissions, and security descriptors.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the GPO object to be converted to XML format.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSystemServices -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object $myGPO to XML format for System Services.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSystemServices -GPO $myGPO
|
||||
Converts multiple GPO objects to XML format for System Services.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
function ConvertTo-XMLSystemServicesNT {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a Group Policy Object (GPO) to an XML representation for System Services on Windows NT.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a GPO object and converts it into an XML format specifically tailored for System Services on Windows NT. It extracts relevant information about each service defined in the GPO and structures it in an XML format.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to be converted to XML.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLSystemServicesNT -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object $myGPO to an XML representation for System Services on Windows NT.
|
||||
|
||||
.EXAMPLE
|
||||
$GPOs | ConvertTo-XMLSystemServicesNT
|
||||
Converts multiple GPO objects in the $GPOs array to XML representations for System Services on Windows NT.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
function ConvertTo-XMLTaskScheduler {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Task Scheduler settings to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Task Scheduler settings from a PSCustomObject to XML format. It provides detailed information about the task settings for each task.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) containing the Task Scheduler settings.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLTaskScheduler -GPO $GPOObject -SingleObject
|
||||
Converts the Task Scheduler settings from the specified GPO object to XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLTaskScheduler -GPO $GPOObject
|
||||
Converts the Task Scheduler settings from the specified GPO object to XML format for multiple objects.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLUserRightsAssignment {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts user rights assignments to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts user rights assignments to XML format based on the provided GPO object.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) to extract user rights assignments from.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to process a single object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLUserRightsAssignment -GPO $GPOObject -SingleObject
|
||||
Converts user rights assignments from a single GPO object to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLUserRightsAssignment -GPO $GPOObject
|
||||
Converts user rights assignments from multiple GPO objects to XML format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLWindowsFirewall {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a Group Policy Object (GPO) to an XML representation for Windows Firewall settings.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a GPO object and converts it into an XML format suitable for Windows Firewall settings. It can handle single GPO objects or multiple GPO objects.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object to be converted to XML.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple GPO objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewall -GPO $myGPO -SingleObject
|
||||
Converts a single GPO object $myGPO to an XML representation for Windows Firewall settings.
|
||||
|
||||
.EXAMPLE
|
||||
$GPOs | ConvertTo-XMLWindowsFirewall
|
||||
Converts multiple GPO objects in the $GPOs array to XML representations for Windows Firewall settings.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
function ConvertTo-XMLWindowsFirewallConnectionSecurityAuthentiation {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Windows Firewall Connection Security Authentication settings to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Windows Firewall Connection Security Authentication settings from a PSCustomObject to XML format. It provides detailed information about the authentication settings for each connection.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) containing the Windows Firewall Connection Security Authentication settings.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallConnectionSecurityAuthentiation -GPO $GPOObject -SingleObject
|
||||
Converts the Windows Firewall Connection Security Authentication settings from the specified GPO object to XML format for a single object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallConnectionSecurityAuthentiation -GPO $GPOObject
|
||||
Converts the Windows Firewall Connection Security Authentication settings from the specified GPO object to XML format for multiple objects.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLWindowsFirewallProfile {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a Windows Firewall profile to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a Windows Firewall profile object and converts it to XML format for further processing.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Windows Firewall profile object to convert.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single object or multiple objects.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallProfile -GPO $FirewallProfile -SingleObject
|
||||
Converts a single Windows Firewall profile object to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallProfile -GPO $FirewallProfiles -SingleObject:$false
|
||||
Converts multiple Windows Firewall profile objects to XML format.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function ConvertTo-XMLWindowsFirewallRules {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Windows Firewall rules to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Windows Firewall rules to XML format for easier management and analysis.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) containing the firewall rules to be converted.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single firewall rule object.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallRules -GPO $GPOObject -SingleObject
|
||||
Converts all firewall rules in the specified GPO to XML format.
|
||||
|
||||
.EXAMPLE
|
||||
ConvertTo-XMLWindowsFirewallRules -GPO $GPOObject
|
||||
Converts all firewall rules in the specified GPO to XML format without creating a single object.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,28 @@
|
||||
function ConvertTo-XMLWindowsFirewallSecurityRules {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts Windows Firewall security rules data to XML format.
|
||||
|
||||
.DESCRIPTION
|
||||
This function converts Windows Firewall security rules data to XML format. It takes a GPO object as input and generates XML data representing the security rules.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) containing the security rules data.
|
||||
|
||||
.PARAMETER SingleObject
|
||||
Indicates whether to convert a single GPO object or multiple security rules.
|
||||
|
||||
.EXAMPLE
|
||||
$GPO = Get-GPO -Name "FirewallRules"
|
||||
ConvertTo-XMLWindowsFirewallSecurityRules -GPO $GPO -SingleObject
|
||||
Converts the security rules data from the GPO "FirewallRules" to XML format for a single GPO object.
|
||||
|
||||
.EXAMPLE
|
||||
$GPOs = Get-GPO -All
|
||||
ConvertTo-XMLWindowsFirewallSecurityRules -GPO $GPOs -SingleObject:$false
|
||||
Converts the security rules data from all GPOs to XML format for multiple security rules.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,19 @@
|
||||
function Find-GPOPassword {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Finds and decrypts the password stored in the cpassword attribute of a Group Policy Object (GPO) XML file.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes the path to a GPO XML file as input, searches for the cpassword attribute, decrypts it, and returns the password.
|
||||
|
||||
.PARAMETER Path
|
||||
Specifies the path to the GPO XML file.
|
||||
|
||||
.EXAMPLE
|
||||
Find-GPOPassword -Path "C:\GPOs\GPO1.xml"
|
||||
Searches for the cpassword attribute in the GPO XML file "GPO1.xml" and returns the decrypted password.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string] $Path
|
||||
|
||||
@@ -1,4 +1,25 @@
|
||||
function Format-CamelCaseToDisplayName {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Converts a camelCase string to a display name with spaces.
|
||||
|
||||
.DESCRIPTION
|
||||
This function takes a camelCase string and converts it to a display name by adding spaces between words.
|
||||
|
||||
.PARAMETER Text
|
||||
The camelCase string(s) to be converted to display name.
|
||||
|
||||
.PARAMETER AddChar
|
||||
The character to add between words in the display name.
|
||||
|
||||
.EXAMPLE
|
||||
Format-CamelCaseToDisplayName -Text 'testString' -AddChar ' '
|
||||
Converts 'testString' to 'Test String'
|
||||
|
||||
.EXAMPLE
|
||||
Format-CamelCaseToDisplayName -Text 'anotherExample' -AddChar '-'
|
||||
Converts 'anotherExample' to 'Another-Example'
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string[]] $Text,
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
function Get-ChoosenDates {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves dates based on the specified date range.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves dates based on the specified date range. The available date ranges are:
|
||||
- Everything
|
||||
- PastHour
|
||||
- CurrentHour
|
||||
- PastDay
|
||||
- CurrentDay
|
||||
- PastMonth
|
||||
- CurrentMonth
|
||||
- PastQuarter
|
||||
- CurrentQuarter
|
||||
- Last14Days
|
||||
- Last21Days
|
||||
- Last30Days
|
||||
- Last7Days
|
||||
- Last3Days
|
||||
- Last1Days
|
||||
|
||||
.PARAMETER DateRange
|
||||
Specifies the date range to retrieve dates for.
|
||||
|
||||
.EXAMPLE
|
||||
Get-ChoosenDates -DateRange PastHour
|
||||
Retrieves dates for the past hour.
|
||||
|
||||
.EXAMPLE
|
||||
Get-ChoosenDates -DateRange CurrentMonth
|
||||
Retrieves dates for the current month.
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[ValidateSet('Everything', 'PastHour', 'CurrentHour', 'PastDay', 'CurrentDay', 'PastMonth', 'CurrentMonth', 'PastQuarter', 'CurrentQuarter', 'Last14Days', 'Last21Days', 'Last30Days' , 'Last7Days', 'Last3Days', 'Last1Days')][string] $DateRange
|
||||
|
||||
@@ -1,4 +1,38 @@
|
||||
function Get-GPOBlockedInheritance {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves information about Organizational Units (OUs) with blocked inheritance of Group Policy Objects (GPOs).
|
||||
|
||||
.DESCRIPTION
|
||||
The Get-GPOBlockedInheritance function retrieves information about OUs within a specified forest that have blocked inheritance of GPOs. It returns a list of OUs with their distinguished names and whether they have blocked inheritance enabled.
|
||||
|
||||
.PARAMETER Filter
|
||||
Specifies a filter to select specific OUs. Default is '*'.
|
||||
|
||||
.PARAMETER Forest
|
||||
Specifies the name of the forest to query.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Specifies an array of domain names to exclude from the query.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Specifies an array of domain names to include in the query.
|
||||
|
||||
.PARAMETER AsHashTable
|
||||
Indicates whether to return the results as a hashtable. If specified, the function returns a hashtable with OU distinguished names as keys and blocked inheritance status as values.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies additional forest information to include in the query.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOBlockedInheritance -Forest 'contoso.com'
|
||||
Retrieves a list of all OUs within the 'contoso.com' forest with blocked inheritance status.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOBlockedInheritance -Forest 'contoso.com' -IncludeDomains 'child1.contoso.com', 'child2.contoso.com' -AsHashTable
|
||||
Retrieves a hashtable of OUs within the 'contoso.com' forest from specified domains with blocked inheritance status.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string] $Filter = '*',
|
||||
|
||||
@@ -1,4 +1,33 @@
|
||||
function Get-GPOCategories {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves GPO categories based on the provided GPO object and XML output.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves GPO categories by analyzing the provided GPO object and XML output. It categorizes GPO settings based on different criteria.
|
||||
|
||||
.PARAMETER GPO
|
||||
The GPO object containing information about the Group Policy Object.
|
||||
|
||||
.PARAMETER GPOOutput
|
||||
An array of XML elements representing the GPO output.
|
||||
|
||||
.PARAMETER Splitter
|
||||
The delimiter used to split GPO settings.
|
||||
|
||||
.PARAMETER FullObjects
|
||||
A switch parameter to indicate whether to retrieve full GPO objects.
|
||||
|
||||
.PARAMETER CachedCategories
|
||||
A dictionary containing cached GPO categories.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOCategories -GPO $gpoObject -GPOOutput $xmlOutput -Splitter ":" -FullObjects
|
||||
|
||||
Description:
|
||||
Retrieves GPO categories for the specified GPO object and XML output, splitting settings using ":" as the delimiter and retrieving full GPO objects.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -1,4 +1,37 @@
|
||||
function Get-GPOPrivInheritance {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves the Group Policy Object (GPO) inheritance information for a given Active Directory object.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves the inheritance information of Group Policy Objects (GPOs) for a specified Active Directory object. It provides details on how GPOs are linked and inherited by the object.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory object for which to retrieve GPO inheritance information.
|
||||
|
||||
.PARAMETER CacheReturnedGPOs
|
||||
Specifies a dictionary containing cached GPO information to optimize retrieval.
|
||||
|
||||
.PARAMETER ForestInformation
|
||||
Specifies a dictionary containing information about the Active Directory forest.
|
||||
|
||||
.PARAMETER Domain
|
||||
Specifies the domain for which to retrieve GPO privilege link information.
|
||||
|
||||
.PARAMETER SkipDomainRoot
|
||||
Indicates whether to skip the Domain Root container.
|
||||
|
||||
.PARAMETER SkipDomainControllers
|
||||
Indicates whether to skip the Domain Controllers container.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOPrivInheritance -ADObject $ADObject -CacheReturnedGPOs $Cache -ForestInformation $ForestInfo -Domain "example.com" -SkipDomainRoot -SkipDomainControllers
|
||||
Retrieves GPO inheritance information for the specified ADObject in the "example.com" domain, skipping the Domain Root container and Domain Controllers container.
|
||||
|
||||
.NOTES
|
||||
File Name : Get-GPOPrivInheritance.ps1
|
||||
Prerequisite : This function requires the Get-GPInheritance function.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[parameter(ParameterSetName = 'ADObject', ValueFromPipeline, ValueFromPipelineByPropertyName, Mandatory)][Microsoft.ActiveDirectory.Management.ADObject[]] $ADObject,
|
||||
|
||||
@@ -1,4 +1,45 @@
|
||||
function Get-GPOPrivInheritanceLoop {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves the Group Policy Object (GPO) inheritance loop for a given Active Directory object.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves the GPO inheritance loop for a specified Active Directory object. It analyzes the inheritance of GPOs based on the object's location in the Active Directory structure.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory object for which the GPO inheritance loop needs to be determined.
|
||||
|
||||
.PARAMETER CacheReturnedGPOs
|
||||
Specifies a dictionary containing cached GPO information to optimize retrieval.
|
||||
|
||||
.PARAMETER ForestInformation
|
||||
Specifies a dictionary containing information about the Active Directory forest.
|
||||
|
||||
.PARAMETER Linked
|
||||
Specifies the types of linked objects to consider during the inheritance analysis. Valid values are 'Root', 'DomainControllers', 'OrganizationalUnit'.
|
||||
|
||||
.PARAMETER SearchBase
|
||||
Specifies the base location in Active Directory to start the search for GPO inheritance.
|
||||
|
||||
.PARAMETER SearchScope
|
||||
Specifies the scope of the search in Active Directory.
|
||||
|
||||
.PARAMETER Filter
|
||||
Specifies the filter to apply when searching for Active Directory objects.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOPrivInheritanceLoop -ADObject $ADObject -CacheReturnedGPOs $Cache -ForestInformation $ForestInfo -Linked 'Root' -SearchBase 'DC=contoso,DC=com' -SearchScope Subtree -Filter '(objectClass -eq "organizationalUnit")'
|
||||
|
||||
Description:
|
||||
Retrieves the GPO inheritance loop for the specified Active Directory object located in the 'contoso.com' domain starting from the root.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOPrivInheritanceLoop -ADObject $ADObject -CacheReturnedGPOs $Cache -ForestInformation $ForestInfo -Linked 'DomainControllers' -SearchBase 'DC=contoso,DC=com' -SearchScope Base -Filter '(objectClass -eq "organizationalUnit")'
|
||||
|
||||
Description:
|
||||
Retrieves the GPO inheritance loop for the specified Active Directory object located in the 'contoso.com' domain starting from the Domain Controllers container.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Microsoft.ActiveDirectory.Management.ADObject[]] $ADObject,
|
||||
|
||||
@@ -1,4 +1,43 @@
|
||||
function Get-GPOPrivLink {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves the GPO (Group Policy Object) privilege link information for specified Active Directory objects.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves the GPO privilege link information for the specified Active Directory objects. It allows skipping certain default containers like Domain Root and Domain Controllers if needed. It also provides options to cache returned GPOs and skip duplicates.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory objects for which to retrieve GPO privilege link information.
|
||||
|
||||
.PARAMETER CacheReturnedGPOs
|
||||
Specifies a dictionary to cache returned GPOs for optimization.
|
||||
|
||||
.PARAMETER ForestInformation
|
||||
Specifies a dictionary containing forest information.
|
||||
|
||||
.PARAMETER Domain
|
||||
Specifies the domain for which to retrieve GPO privilege link information.
|
||||
|
||||
.PARAMETER SkipDomainRoot
|
||||
Indicates whether to skip the Domain Root container.
|
||||
|
||||
.PARAMETER SkipDomainControllers
|
||||
Indicates whether to skip the Domain Controllers container.
|
||||
|
||||
.PARAMETER AsHashTable
|
||||
Specifies whether to output the GPO information as a hash table.
|
||||
|
||||
.PARAMETER SkipDuplicates
|
||||
Indicates whether to skip duplicate GPOs.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOPrivLink -ADObject $ADObject -CacheReturnedGPOs $Cache -ForestInformation $ForestInfo -Domain "example.com" -SkipDomainRoot -SkipDuplicates
|
||||
Retrieves GPO privilege link information for the specified ADObject in the "example.com" domain, skipping the Domain Root container and duplicates.
|
||||
|
||||
.NOTES
|
||||
File Name : Get-GPOPrivLink.ps1
|
||||
Prerequisite : This function requires the Get-PrivGPOZaurrLink function.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[parameter(ParameterSetName = 'ADObject', ValueFromPipeline, ValueFromPipelineByPropertyName, Mandatory)][Microsoft.ActiveDirectory.Management.ADObject[]] $ADObject,
|
||||
|
||||
@@ -1,52 +1,52 @@
|
||||
function Get-GPOZaurrLinkInheritance {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Short description
|
||||
Retrieves the Group Policy Object (GPO) inheritance information for a given Active Directory object.
|
||||
|
||||
.DESCRIPTION
|
||||
Long description
|
||||
This function retrieves the inheritance information of Group Policy Objects (GPOs) for a specified Active Directory object. It provides details on how GPOs are linked and inherited by the object.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Parameter description
|
||||
Specifies the Active Directory object for which to retrieve GPO inheritance information.
|
||||
|
||||
.PARAMETER Filter
|
||||
Parameter description
|
||||
Specifies the filter criteria for selecting the types of objects to include in the search. Default value includes 'organizationalUnit', 'domainDNS', and 'site' objects.
|
||||
|
||||
.PARAMETER SearchBase
|
||||
Parameter description
|
||||
Specifies the base distinguished name (DN) for the search operation.
|
||||
|
||||
.PARAMETER SearchScope
|
||||
Parameter description
|
||||
Specifies the scope of the search operation within Active Directory.
|
||||
|
||||
.PARAMETER Linked
|
||||
Parameter description
|
||||
Specifies the type of objects to include in the search. Valid values are 'Root', 'DomainControllers', and 'OrganizationalUnit'.
|
||||
|
||||
.PARAMETER Limited
|
||||
Parameter description
|
||||
Indicates whether to limit the search results. If specified, only a limited set of results will be returned.
|
||||
|
||||
.PARAMETER SkipDuplicates
|
||||
Parameter description
|
||||
Indicates whether to skip duplicate entries in the search results.
|
||||
|
||||
.PARAMETER GPOCache
|
||||
Parameter description
|
||||
Specifies a cache of Group Policy Objects to optimize performance.
|
||||
|
||||
.PARAMETER Forest
|
||||
Target different Forest, by default current forest is used
|
||||
Specifies the target forest to search for GPO inheritance information. By default, the current forest is used.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Exclude domain from search, by default whole forest is scanned
|
||||
Specifies the domains to exclude from the search operation. By default, the entire forest is scanned.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Include only specific domains, by default whole forest is scanned
|
||||
Specifies the specific domains to include in the search operation. By default, the entire forest is scanned.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Parameter description
|
||||
Specifies additional information about the forest to include in the search results.
|
||||
|
||||
.PARAMETER AsHashTable
|
||||
Parameter description
|
||||
Indicates whether to return the results as a hash table.
|
||||
|
||||
.PARAMETER Summary
|
||||
Parameter description
|
||||
Indicates whether to provide a summary of the GPO inheritance information.
|
||||
|
||||
.EXAMPLE
|
||||
$Output = Get-GPOZaurrLinkInheritance -Summary
|
||||
@@ -58,7 +58,7 @@ function Get-GPOZaurrLinkInheritance {
|
||||
$Output[5].LinksObjects | Format-Table
|
||||
|
||||
.NOTES
|
||||
This is based on Get-GPInheritance which isn't ideal and doesn't support sites. Get-GPOZaurrLink is better. Leaving in case I need it later on for private use only.
|
||||
This function is an improved version of Get-GPInheritance and provides better support for sites. It is recommended for retrieving GPO inheritance information.
|
||||
#>
|
||||
[cmdletbinding(DefaultParameterSetName = 'All')]
|
||||
param(
|
||||
|
||||
@@ -1,4 +1,51 @@
|
||||
function Get-GPOZaurrLinkLoop {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves Group Policy Object (GPO) links for Active Directory objects based on specified criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves GPO links for Active Directory objects based on the provided parameters. It allows searching for GPO links within specific sites, domains, or organizational units. The function can handle duplicates and provides flexibility in defining search criteria.
|
||||
|
||||
.PARAMETER ADObject
|
||||
Specifies the Active Directory objects for which GPO links will be retrieved.
|
||||
|
||||
.PARAMETER CacheReturnedGPOs
|
||||
A dictionary cache of returned Group Policy Objects for efficient processing.
|
||||
|
||||
.PARAMETER ForestInformation
|
||||
Information about the forest structure and domains for targeted searches.
|
||||
|
||||
.PARAMETER Linked
|
||||
Specifies the type of objects to search for GPO links. Valid values are 'All', 'Root', 'DomainControllers', 'Site', or 'OrganizationalUnit'.
|
||||
|
||||
.PARAMETER SearchBase
|
||||
Specifies the base location for the search within Active Directory.
|
||||
|
||||
.PARAMETER SearchScope
|
||||
Specifies the scope of the search within Active Directory.
|
||||
|
||||
.PARAMETER Filter
|
||||
Specifies additional filters to apply during the search.
|
||||
|
||||
.PARAMETER SkipDuplicates
|
||||
Indicates whether to skip duplicate GPO links during processing.
|
||||
|
||||
.PARAMETER Site
|
||||
Specifies the site(s) to search for GPO links.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrLinkLoop -Site 'SiteA', 'SiteB' -ForestInformation $ForestInfo
|
||||
|
||||
Description:
|
||||
Retrieves GPO links for sites 'SiteA' and 'SiteB' within the forest using the provided forest information.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GPOZaurrLinkLoop -SearchBase 'OU=Users,DC=contoso,DC=com' -SearchScope Subtree -Filter '(objectClass -eq "user")'
|
||||
|
||||
Description:
|
||||
Retrieves GPO links for all user objects within the specified organizational unit 'Users' in the 'contoso.com' domain.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Microsoft.ActiveDirectory.Management.ADObject[]] $ADObject,
|
||||
|
||||
@@ -1,4 +1,27 @@
|
||||
function Get-GitHubVersion {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves the latest version information from a GitHub repository and compares it with the currently installed version of a specified cmdlet.
|
||||
|
||||
.DESCRIPTION
|
||||
The Get-GitHubVersion function retrieves the latest version information from a specified GitHub repository and compares it with the version of a specified cmdlet. It then provides feedback on whether an update is available or if the installed version is up to date.
|
||||
|
||||
.PARAMETER Cmdlet
|
||||
The name of the cmdlet to check for updates.
|
||||
|
||||
.PARAMETER RepositoryOwner
|
||||
The owner of the GitHub repository where the releases are hosted.
|
||||
|
||||
.PARAMETER RepositoryName
|
||||
The name of the GitHub repository.
|
||||
|
||||
.EXAMPLE
|
||||
Get-GitHubVersion -Cmdlet "MyCmdlet" -RepositoryOwner "MyRepoOwner" -RepositoryName "MyRepo"
|
||||
|
||||
Description:
|
||||
Retrieves the latest version information for "MyCmdlet" from the GitHub repository owned by "MyRepoOwner" with the name "MyRepo".
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Parameter(Mandatory)][string] $Cmdlet,
|
||||
|
||||
@@ -1,4 +1,29 @@
|
||||
function Get-LinksFromXML {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves links from XML data.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves links from XML data provided as input. It processes the XML data to extract relevant information about the links.
|
||||
|
||||
.PARAMETER GPOOutput
|
||||
Specifies the XML data containing information about the links.
|
||||
|
||||
.PARAMETER Splitter
|
||||
Specifies the delimiter to use when joining multiple links.
|
||||
|
||||
.PARAMETER FullObjects
|
||||
Indicates whether to return full objects with additional properties for each link.
|
||||
|
||||
.EXAMPLE
|
||||
Get-LinksFromXML -GPOOutput $xmlData -Splitter ";" -FullObjects
|
||||
Retrieves links from the XML data $xmlData, separates them with a semicolon, and returns full objects for each link.
|
||||
|
||||
.EXAMPLE
|
||||
Get-LinksFromXML -GPOOutput $xmlData -Splitter "/"
|
||||
Retrieves links from the XML data $xmlData and joins them with a forward slash.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Xml.XmlElement[]] $GPOOutput,
|
||||
|
||||
@@ -1,4 +1,48 @@
|
||||
function Get-PermissionsAnalysis {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Analyzes permissions for a specified Group Policy Object (GPO) based on provided criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function analyzes permissions for a specified Group Policy Object (GPO) based on the given criteria. It checks for specific administrative groups, standard users, and well-known administrative groups to determine the type of permissions assigned.
|
||||
|
||||
.PARAMETER GPOPermissions
|
||||
An array of GPO permissions to analyze.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of permissions to analyze. Valid values are 'WellKnownAdministrative', 'Administrative', 'AuthenticatedUsers', or 'Default'.
|
||||
|
||||
.PARAMETER PermissionType
|
||||
The specific permission type to include in the analysis.
|
||||
|
||||
.PARAMETER Forest
|
||||
Target different Forest, by default current forest is used.
|
||||
|
||||
.PARAMETER ExcludeDomains
|
||||
Exclude domain from search, by default whole forest is scanned.
|
||||
|
||||
.PARAMETER IncludeDomains
|
||||
Include only specific domains, by default whole forest is scanned.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Ability to provide Forest Information from another command to speed up processing.
|
||||
|
||||
.PARAMETER ADAdministrativeGroups
|
||||
Specifies the Active Directory administrative groups to consider.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PermissionsAnalysis -GPOPermissions $GPOPermissions -Type 'Administrative' -PermissionType 'Read' -Forest 'Contoso' -IncludeDomains 'DomainA', 'DomainB'
|
||||
|
||||
Description:
|
||||
Analyzes permissions for the specified GPOPermissions array, focusing on administrative groups with 'Read' permission in the 'Contoso' forest for 'DomainA' and 'DomainB'.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PermissionsAnalysis -GPOPermissions $GPOPermissions -Type 'WellKnownAdministrative' -PermissionType 'Write'
|
||||
|
||||
Description:
|
||||
Analyzes permissions for the specified GPOPermissions array, targeting well-known administrative groups with 'Write' permission.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPOPermissions,
|
||||
|
||||
@@ -1,4 +1,33 @@
|
||||
function Get-PrivGPOZaurrLink {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves and processes Group Policy Object (GPO) links associated with a given Active Directory object.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves and processes the GPO links associated with a specified Active Directory object. It parses the GPO links to extract relevant information such as distinguished name, canonical name, GUID, enforcement status, and enablement status.
|
||||
|
||||
.PARAMETER Object
|
||||
The Active Directory object for which GPO links will be retrieved and processed.
|
||||
|
||||
.PARAMETER Limited
|
||||
Indicates whether to provide limited information about the GPO links.
|
||||
|
||||
.PARAMETER GPOCache
|
||||
A dictionary cache of Group Policy Objects for efficient processing.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PrivGPOZaurrLink -Object $ADObject
|
||||
|
||||
Description:
|
||||
Retrieves and processes the GPO links associated with the specified Active Directory object.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PrivGPOZaurrLink -Object $ADObject -Limited
|
||||
|
||||
Description:
|
||||
Retrieves limited information about the GPO links associated with the specified Active Directory object.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Microsoft.ActiveDirectory.Management.ADObject] $Object,
|
||||
|
||||
@@ -1,4 +1,69 @@
|
||||
function Get-PrivPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves permissions for a specified Group Policy Object (GPO) based on various criteria.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves permissions for a specified Group Policy Object (GPO) based on the provided parameters. It allows filtering by principal, permission type, and other criteria.
|
||||
|
||||
.PARAMETER GPO
|
||||
Specifies the Group Policy Object (GPO) for which permissions will be retrieved.
|
||||
|
||||
.PARAMETER SecurityRights
|
||||
Specifies the security rights to be evaluated for the GPO.
|
||||
|
||||
.PARAMETER Principal
|
||||
Specifies the principal for which permissions will be retrieved.
|
||||
|
||||
.PARAMETER PrincipalType
|
||||
Specifies the type of principal to filter by. Valid values are 'DistinguishedName', 'Name', 'NetbiosName', or 'Sid'.
|
||||
|
||||
.PARAMETER SkipWellKnown
|
||||
Skips well-known principals when evaluating permissions.
|
||||
|
||||
.PARAMETER SkipAdministrative
|
||||
Skips administrative principals when evaluating permissions.
|
||||
|
||||
.PARAMETER IncludeOwner
|
||||
Includes the owner of the GPO in the permission results.
|
||||
|
||||
.PARAMETER IncludePermissionType
|
||||
Specifies the permission types to include in the results.
|
||||
|
||||
.PARAMETER ExcludePermissionType
|
||||
Specifies the permission types to exclude from the results.
|
||||
|
||||
.PARAMETER PermitType
|
||||
Specifies the type of permissions to include. Valid values are 'Allow', 'Deny', or 'All'.
|
||||
|
||||
.PARAMETER ExcludePrincipal
|
||||
Specifies principals to exclude from the results.
|
||||
|
||||
.PARAMETER ExcludePrincipalType
|
||||
Specifies the type of principal to exclude. Valid values are 'DistinguishedName', 'Name', or 'Sid'.
|
||||
|
||||
.PARAMETER IncludeGPOObject
|
||||
Includes the GPO object in the permission results.
|
||||
|
||||
.PARAMETER ADAdministrativeGroups
|
||||
Specifies the Active Directory administrative groups to consider.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of principals to include. Valid values are 'AuthenticatedUsers', 'DomainComputers', 'Unknown', 'WellKnownAdministrative', 'NotWellKnown', 'NotWellKnownAdministrative', 'NotAdministrative', 'Administrative', or 'All'.
|
||||
|
||||
.PARAMETER ExtendedForestInformation
|
||||
Specifies extended forest information to be used in evaluation.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PrivPermission -GPO $GPO -SecurityRights $SecurityRights -Principal 'Domain Admins' -PrincipalType 'Name' -PermitType 'Allow'
|
||||
|
||||
Retrieves permissions for the specified GPO where 'Domain Admins' have 'Allow' permissions.
|
||||
|
||||
.EXAMPLE
|
||||
Get-PrivPermission -GPO $GPO -SecurityRights $SecurityRights -Principal 'S-1-5-21-3623811015-3361044348-30300820-1013' -PrincipalType 'Sid' -PermitType 'Deny'
|
||||
|
||||
Retrieves permissions for the specified GPO where the principal with the SID 'S-1-5-21-3623811015-3361044348-30300820-1013' has 'Deny' permissions.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Microsoft.GroupPolicy.Gpo] $GPO,
|
||||
|
||||
+121
-51
@@ -1,4 +1,51 @@
|
||||
function Get-XMLGPO {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves information from an XML representation of a Group Policy Object (GPO).
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves various details from an XML representation of a GPO, such as GPO name, domain name, links information, etc.
|
||||
|
||||
.PARAMETER XMLContent
|
||||
The XML content representing the GPO.
|
||||
|
||||
.PARAMETER GPO
|
||||
The Microsoft.GroupPolicy.Gpo object representing the GPO.
|
||||
|
||||
.PARAMETER PermissionsOnly
|
||||
Indicates whether to retrieve only permissions information.
|
||||
|
||||
.PARAMETER OwnerOnly
|
||||
Indicates whether to retrieve only owner information.
|
||||
|
||||
.PARAMETER ADAdministrativeGroups
|
||||
A dictionary of Active Directory administrative groups.
|
||||
|
||||
.PARAMETER Splitter
|
||||
The string used to split values in the output.
|
||||
|
||||
.PARAMETER ExcludeGroupPolicies
|
||||
A dictionary of group policies to exclude.
|
||||
|
||||
.PARAMETER Type
|
||||
An array of types to filter the output.
|
||||
|
||||
.PARAMETER LinksSummaryCache
|
||||
A cache of links summary information.
|
||||
|
||||
.EXAMPLE
|
||||
Get-XMLGPO -XMLContent $xml -GPO $gpo
|
||||
|
||||
Description:
|
||||
Retrieves information from the XML content of a specific GPO.
|
||||
|
||||
.EXAMPLE
|
||||
Get-XMLGPO -XMLContent $xml -GPO $gpo -PermissionsOnly
|
||||
|
||||
Description:
|
||||
Retrieves only the permissions information from the XML content of a specific GPO.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[XML] $XMLContent,
|
||||
@@ -12,6 +59,8 @@
|
||||
[System.Collections.IDictionary] $LinksSummaryCache
|
||||
)
|
||||
|
||||
$SysvolGpoPath = "\\$($GPO.DomainName)\SYSVOL\$($GPO.DomainName)\Policies\{$($GPO.ID)}"
|
||||
|
||||
$DisplayName = $XMLContent.GPO.Name
|
||||
$DomainName = $XMLContent.GPO.Identifier.Domain.'#text'
|
||||
|
||||
@@ -166,7 +215,22 @@
|
||||
[bool] $UserSettingsAvailable = if ($OutputUser.Count -gt 0) { $true } else { $false }
|
||||
}
|
||||
|
||||
if ($ComputerSettingsAvailable -eq $false -and $UserSettingsAvailable -eq $false) {
|
||||
# Check if there are any GPF files in the GPO
|
||||
# those are special files that are used to store settings for some applications (maily Citrix?)
|
||||
# if there are any, then we can't say that GPO is empty, and they are not visible in the XML
|
||||
$GPFFile = $false
|
||||
$FilesCount = 0
|
||||
$TotalSize = 0
|
||||
Get-ChildItem -LiteralPath $SysvolGpoPath -Recurse -ErrorAction SilentlyContinue -File | ForEach-Object {
|
||||
if ($_.Extension -eq '.gpf') {
|
||||
#Write-Warning -Message "Get-XMLGPO - GPO [$DisplayName/$DomainName] has no data in XML, but it contains GPF files. Excluding from empty GPO list."
|
||||
$GPFFile = $true
|
||||
}
|
||||
$FilesCount++
|
||||
$TotalSize += $_.Length
|
||||
}
|
||||
|
||||
if ($ComputerSettingsAvailable -eq $false -and $UserSettingsAvailable -eq $false -and $GPFFile -eq $false) {
|
||||
$Empty = $true
|
||||
} else {
|
||||
$Empty = $false
|
||||
@@ -257,6 +321,7 @@
|
||||
'Inherited' = $false
|
||||
'Permissions' = 'Owner'
|
||||
'GPODistinguishedName' = $GPO.Path
|
||||
'GPOSysvolPath' = $SysvolGpoPath
|
||||
}
|
||||
$XMLContent.GPO.SecurityDescriptor.Permissions.TrusteePermissions | ForEach-Object -Process {
|
||||
if ($_) {
|
||||
@@ -285,57 +350,62 @@
|
||||
'OwnerSID' = $XMLContent.GPO.SecurityDescriptor.Owner.SID.'#text'
|
||||
'OwnerType' = $OwnerType
|
||||
'GPODistinguishedName' = $GPO.Path
|
||||
'GPOSysvolPath' = $SysvolGpoPath
|
||||
}
|
||||
} else {
|
||||
$GPOOutput = [PsCustomObject] @{
|
||||
'DisplayName' = $XMLContent.GPO.Name
|
||||
'DomainName' = $XMLContent.GPO.Identifier.Domain.'#text'
|
||||
'GUID' = $XMLContent.GPO.Identifier.Identifier.InnerText -replace '{' -replace '}'
|
||||
'Days' = (New-TimeSpan -Start ([DateTime] $XMLContent.GPO.ModifiedTime) -End (Get-Date)).Days
|
||||
'Empty' = $Empty
|
||||
'Linked' = $Linked
|
||||
'Enabled' = $EnabledBool
|
||||
'Optimized' = $Optimized
|
||||
'Problem' = $Problem
|
||||
'ApplyPermission' = $null
|
||||
'Exclude' = $Exclude
|
||||
'Description' = $GPO.Description
|
||||
'ComputerPolicies' = $XMLContent.GPO.Computer.ExtensionData.Name -join ", "
|
||||
'UserPolicies' = $XMLContent.GPO.User.ExtensionData.Name -join ", "
|
||||
'LinksCount' = $LinksTotalCount
|
||||
'LinksEnabledCount' = $LinksEnabledCount
|
||||
'LinksDisabledCount' = $LinksDisabledCount
|
||||
'EnabledDetails' = $Enabled
|
||||
'ComputerProblem' = $ComputerProblem
|
||||
'ComputerOptimized' = $ComputerOptimized
|
||||
'UserProblem' = $UserProblem
|
||||
'UserOptimized' = $UserOptimized
|
||||
'ComputerSettingsAvailable' = $ComputerSettingsAvailable
|
||||
'UserSettingsAvailable' = $UserSettingsAvailable
|
||||
'DisplayName' = $XMLContent.GPO.Name
|
||||
'DomainName' = $XMLContent.GPO.Identifier.Domain.'#text'
|
||||
'GUID' = $XMLContent.GPO.Identifier.Identifier.InnerText -replace '{' -replace '}'
|
||||
'Days' = (New-TimeSpan -Start ([DateTime] $XMLContent.GPO.ModifiedTime) -End (Get-Date)).Days
|
||||
'Empty' = $Empty
|
||||
'Linked' = $Linked
|
||||
'Enabled' = $EnabledBool
|
||||
'Optimized' = $Optimized
|
||||
'Problem' = $Problem
|
||||
'ApplyPermission' = $null
|
||||
'Exclude' = $Exclude
|
||||
'SizeMB' = [Math]::Round($TotalSize / 1MB, 2)
|
||||
'Size' = $TotalSize
|
||||
'Description' = $GPO.Description
|
||||
'ComputerPolicies' = $XMLContent.GPO.Computer.ExtensionData.Name -join ", "
|
||||
'UserPolicies' = $XMLContent.GPO.User.ExtensionData.Name -join ", "
|
||||
'FilesCount' = $FilesCount
|
||||
'LinksCount' = $LinksTotalCount
|
||||
'LinksEnabledCount' = $LinksEnabledCount
|
||||
'LinksDisabledCount' = $LinksDisabledCount
|
||||
'EnabledDetails' = $Enabled
|
||||
'ComputerProblem' = $ComputerProblem
|
||||
'ComputerOptimized' = $ComputerOptimized
|
||||
'UserProblem' = $UserProblem
|
||||
'UserOptimized' = $UserOptimized
|
||||
'ComputerSettingsAvailable' = $ComputerSettingsAvailable
|
||||
'UserSettingsAvailable' = $UserSettingsAvailable
|
||||
#'ComputerSettingsAvailableReal' = $ComputerSettingsAvailableReal
|
||||
#'UserSettingsAvailableReal' = $UserSettingsAvailableReal
|
||||
'ComputerSettingsTypes' = $OutputComputer.Name -join ", "
|
||||
'UserSettingsTypes' = $OutputUser.Name -join ", "
|
||||
'ComputerEnabled' = $ComputerEnabled
|
||||
'UserEnabled' = $UserEnabled
|
||||
'ComputerSettingsStatus' = if ($XMLContent.GPO.Computer.VersionDirectory -eq 0 -and $XMLContent.GPO.Computer.VersionSysvol -eq 0) { "NeverModified" } else { "Modified" }
|
||||
'ComputerSetttingsVersionIdentical' = if ($XMLContent.GPO.Computer.VersionDirectory -eq $XMLContent.GPO.Computer.VersionSysvol) { $true } else { $false }
|
||||
'ComputerSettings' = $XMLContent.GPO.Computer.ExtensionData.Extension
|
||||
'UserSettingsStatus' = if ($XMLContent.GPO.User.VersionDirectory -eq 0 -and $XMLContent.GPO.User.VersionSysvol -eq 0) { "NeverModified" } else { "Modified" }
|
||||
'UserSettingsVersionIdentical' = if ($XMLContent.GPO.User.VersionDirectory -eq $XMLContent.GPO.User.VersionSysvol) { $true } else { $false }
|
||||
'UserSettings' = $XMLContent.GPO.User.ExtensionData.Extension
|
||||
'NoSettings' = $NoSettings
|
||||
'CreationTime' = [DateTime] $XMLContent.GPO.CreatedTime
|
||||
'ModificationTime' = [DateTime] $XMLContent.GPO.ModifiedTime
|
||||
'ReadTime' = [DateTime] $XMLContent.GPO.ReadTime
|
||||
'WMIFilter' = $GPO.WmiFilter.name
|
||||
'WMIFilterDescription' = $GPO.WmiFilter.Description
|
||||
'GPODistinguishedName' = $GPO.Path
|
||||
'SDDL' = if ($Splitter -ne '') { $XMLContent.GPO.SecurityDescriptor.SDDL.'#text' -join $Splitter } else { $XMLContent.GPO.SecurityDescriptor.SDDL.'#text' }
|
||||
'Owner' = $XMLContent.GPO.SecurityDescriptor.Owner.Name.'#text'
|
||||
'OwnerSID' = $XMLContent.GPO.SecurityDescriptor.Owner.SID.'#text'
|
||||
'OwnerType' = $OwnerType
|
||||
'ACL' = @(
|
||||
'ComputerSettingsTypes' = $OutputComputer.Name -join ", "
|
||||
'UserSettingsTypes' = $OutputUser.Name -join ", "
|
||||
'ComputerEnabled' = $ComputerEnabled
|
||||
'UserEnabled' = $UserEnabled
|
||||
'ComputerSettingsStatus' = if ($XMLContent.GPO.Computer.VersionDirectory -eq 0 -and $XMLContent.GPO.Computer.VersionSysvol -eq 0) { "NeverModified" } else { "Modified" }
|
||||
'ComputerSettingsVersionIdentical' = if ($XMLContent.GPO.Computer.VersionDirectory -eq $XMLContent.GPO.Computer.VersionSysvol) { $true } else { $false }
|
||||
'ComputerSettings' = $XMLContent.GPO.Computer.ExtensionData.Extension
|
||||
'UserSettingsStatus' = if ($XMLContent.GPO.User.VersionDirectory -eq 0 -and $XMLContent.GPO.User.VersionSysvol -eq 0) { "NeverModified" } else { "Modified" }
|
||||
'UserSettingsVersionIdentical' = if ($XMLContent.GPO.User.VersionDirectory -eq $XMLContent.GPO.User.VersionSysvol) { $true } else { $false }
|
||||
'UserSettings' = $XMLContent.GPO.User.ExtensionData.Extension
|
||||
'NoSettings' = $NoSettings
|
||||
'CreationTime' = [DateTime] $XMLContent.GPO.CreatedTime
|
||||
'ModificationTime' = [DateTime] $XMLContent.GPO.ModifiedTime
|
||||
'ReadTime' = [DateTime] $XMLContent.GPO.ReadTime
|
||||
'WMIFilter' = $GPO.WmiFilter.name
|
||||
'WMIFilterDescription' = $GPO.WmiFilter.Description
|
||||
'GPODistinguishedName' = $GPO.Path
|
||||
'GPOSysvolPath' = $SysvolGpoPath
|
||||
'SDDL' = if ($Splitter -ne '') { $XMLContent.GPO.SecurityDescriptor.SDDL.'#text' -join $Splitter } else { $XMLContent.GPO.SecurityDescriptor.SDDL.'#text' }
|
||||
'Owner' = $XMLContent.GPO.SecurityDescriptor.Owner.Name.'#text'
|
||||
'OwnerSID' = $XMLContent.GPO.SecurityDescriptor.Owner.SID.'#text'
|
||||
'OwnerType' = $OwnerType
|
||||
'ACL' = @(
|
||||
[PsCustomObject] @{
|
||||
'Name' = $XMLContent.GPO.SecurityDescriptor.Owner.Name.'#text'
|
||||
'Sid' = $XMLContent.GPO.SecurityDescriptor.Owner.SID.'#text'
|
||||
@@ -355,10 +425,10 @@
|
||||
}
|
||||
}
|
||||
)
|
||||
'Auditing' = if ($XMLContent.GPO.SecurityDescriptor.AuditingPresent.'#text' -eq 'true') { $true } else { $false }
|
||||
'Links' = $Links
|
||||
'LinksObjects' = $LinksObjects
|
||||
'GPOObject' = $GPO
|
||||
'Auditing' = if ($XMLContent.GPO.SecurityDescriptor.AuditingPresent.'#text' -eq 'true') { $true } else { $false }
|
||||
'Links' = $Links
|
||||
'LinksObjects' = $LinksObjects
|
||||
'GPOObject' = $GPO
|
||||
}
|
||||
if ($GPOOutput.ACL) {
|
||||
$GPOOutput.ApplyPermission = $false
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function Get-XMLNestedRegistry {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Retrieves registry settings from XML data and formats them for output.
|
||||
|
||||
.DESCRIPTION
|
||||
This function retrieves registry settings from XML data and formats them for output. It can either provide a limited set of information or the full details of each registry setting.
|
||||
|
||||
.PARAMETER GPO
|
||||
The Group Policy Object (GPO) associated with the registry settings.
|
||||
|
||||
.PARAMETER DataSet
|
||||
An array of XML elements containing the registry settings.
|
||||
|
||||
.PARAMETER Collection
|
||||
The name of the collection of registry settings.
|
||||
|
||||
.PARAMETER Limited
|
||||
Indicates whether to provide limited information about each registry setting.
|
||||
|
||||
.EXAMPLE
|
||||
Get-XMLNestedRegistry -GPO $GPO -DataSet $DataSet -Collection "SoftwareSettings" -Limited
|
||||
Retrieves limited information about the registry settings in the "SoftwareSettings" collection.
|
||||
|
||||
.EXAMPLE
|
||||
Get-XMLNestedRegistry -GPO $GPO -DataSet $DataSet -Collection "WindowsSettings"
|
||||
Retrieves full details of the registry settings in the "WindowsSettings" collection.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
ActionRequired = $null
|
||||
Data = $null
|
||||
Execute = {
|
||||
Invoke-GPOZaurrContent -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains
|
||||
Invoke-GPOZaurrContent -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -GPOName $GPOName -GPOGUID $GPOGUID
|
||||
}
|
||||
Processing = {
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
Solution = {
|
||||
foreach ($Key in $Script:Reporting['GPOAnalysis']['Data'].Keys) {
|
||||
New-HTMLTab -Name $Key {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOAnalysis']['Data'][$Key] -Filtering -Title $Key
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOAnalysis']['Data'][$Key] -Filtering -Title $Key -ScrollX
|
||||
}
|
||||
}
|
||||
if ($Script:Reporting['GPOAnalysis']['WarningsAndErrors']) {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
$GPOZaurrBlockedInheritance = [ordered] @{
|
||||
Name = 'Group Policy Blocked Inhertiance'
|
||||
Name = 'Group Policy Blocked Inheritance'
|
||||
Enabled = $true
|
||||
ActionRequired = $null
|
||||
Data = $null
|
||||
Execute = {
|
||||
if ($Script:Reporting['GPOBlockedInheritance']['Exclusions']) {
|
||||
Get-GPOZaurrInheritance -IncludeBlockedObjects -IncludeExcludedObjects -OnlyBlockedInheritance -IncludeGroupPoliciesForBlockedObjects -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $Excludeomains -Exclusions $Script:Reporting['GPOBlockedInheritance']['Exclusions']
|
||||
Get-GPOZaurrInheritance -IncludeBlockedObjects -IncludeExcludedObjects -OnlyBlockedInheritance -IncludeGroupPoliciesForBlockedObjects -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -Exclusions $Script:Reporting['GPOBlockedInheritance']['Exclusions']
|
||||
} else {
|
||||
Get-GPOZaurrInheritance -IncludeBlockedObjects -IncludeExcludedObjects -OnlyBlockedInheritance -IncludeGroupPoliciesForBlockedObjects -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $Excludeomains
|
||||
Get-GPOZaurrInheritance -IncludeBlockedObjects -IncludeExcludedObjects -OnlyBlockedInheritance -IncludeGroupPoliciesForBlockedObjects -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains
|
||||
}
|
||||
}
|
||||
Processing = {
|
||||
@@ -80,7 +80,7 @@
|
||||
"As GPOs can be inherited by default, they can also be blocked, if required using the Block Inheritance. "
|
||||
"If the Block Inheritance setting is enabled, the inheritance of group policy setting is blocked. "
|
||||
"This setting is mostly used when the OU contains users or computers that require different settings than what is applied to the domain level. "
|
||||
"Unfortunetly blocking inheritance can have serious security consequences. "
|
||||
"Unfortunately blocking inheritance can have serious security consequences. "
|
||||
)
|
||||
New-HTMLText -Text @(
|
||||
'As it stands currently there are ',
|
||||
@@ -154,14 +154,14 @@
|
||||
New-TableCondition -Name 'ComputersCount' -Value 0
|
||||
} -BackgroundColor Salmon -FailBackgroundColor Amber -HighlightHeaders 'UsersCount', 'ComputersCount'
|
||||
New-TableColumnOption -Hidden $true -ColumnIndex 8
|
||||
} -PagingOptions 5, 10, 20, 30, 40, 50 -ExcludeProperty GroupPolicies
|
||||
} -PagingOptions 5, 10, 20, 30, 40, 50 -ExcludeProperty GroupPolicies -ScrollX
|
||||
}
|
||||
New-HTMLSection -Name 'Group Policies affecting objects in Organizational Units with Blocked Inheritance' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOBlockedInheritance']['Data'].GroupPolicies -Filtering {
|
||||
New-TableCondition -Name 'Enabled' -Value $true -BackgroundColor SpringGreen -FailBackgroundColor Salmon
|
||||
New-TableCondition -Name 'Enforced' -Value $true -BackgroundColor Amber -FailBackgroundColor AirForceBlue
|
||||
New-TableCondition -Name 'LinkedDirectly' -Value $true -BackgroundColor Amber -FailBackgroundColor AirForceBlue
|
||||
} -PagingOptions 5, 10, 20, 30, 40, 50 -DataTableID 'TableWithGroupPoliciesBlockedInheritance'
|
||||
} -PagingOptions 5, 10, 20, 30, 40, 50 -DataTableID 'TableWithGroupPoliciesBlockedInheritance' -ScrollX
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix - Organizational Units with Group Policy Blocked Inheritance' {
|
||||
|
||||
@@ -76,7 +76,7 @@ $GPOZaurrBrokenLink = [ordered] @{
|
||||
New-HTMLSection -Name 'Group Policy Broken Links' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOBrokenLink']['Data'] -Filtering {
|
||||
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to remove Broken Links' {
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
New-HTMLListItem -Text 'Inconsistent top level permissions: ', $Script:Reporting['GPOConsistency']['Variables']['Inconsistent'] -FontWeight normal, bold
|
||||
New-HTMLListItem -Text "Inconsistent inherited permissions: ", $Script:Reporting['GPOConsistency']['Variables']['InconsistentInside'] -FontWeight normal, bold
|
||||
} -FontSize 10pt
|
||||
New-HTMLText -FontSize 10pt -Text 'Having incosistent permissions on AD in comparison to those on SYSVOL can lead to uncontrolled ability to modify them.'
|
||||
New-HTMLText -FontSize 10pt -Text 'Having inconsistent permissions on AD in comparison to those on SYSVOL can lead to uncontrolled ability to modify them.'
|
||||
New-HTMLChart {
|
||||
New-ChartLegend -Names 'Bad', 'Good' -Color PaleGreen, Salmon
|
||||
New-ChartBarOptions -Type barStacked
|
||||
@@ -66,7 +66,7 @@
|
||||
New-HTMLListItem -Text 'Inconsistent top level permissions: ', $Script:Reporting['GPOConsistency']['Variables']['Inconsistent'] -FontWeight normal, bold
|
||||
New-HTMLListItem -Text "Inconsistent inherited permissions: ", $Script:Reporting['GPOConsistency']['Variables']['InconsistentInside'] -FontWeight normal, bold
|
||||
} -FontSize 10pt
|
||||
New-HTMLText -FontSize 10pt -Text 'Having incosistent permissions on AD in comparison to those on SYSVOL can lead to uncontrolled ability to modify them. Please notice that if ', `
|
||||
New-HTMLText -FontSize 10pt -Text 'Having inconsistent permissions on AD in comparison to those on SYSVOL can lead to uncontrolled ability to modify them. Please notice that if ', `
|
||||
' Not available ', 'is visible in the table you should first fix related, more pressing issue, before fixing permissions inconsistency.' -FontWeight normal, bold, normal
|
||||
}
|
||||
Solution = {
|
||||
@@ -91,7 +91,7 @@
|
||||
New-HTMLTableCondition -Name 'ACLConsistentInside' -Value $true -BackgroundColor PaleGreen -TextTransform capitalize -ComparisonType string
|
||||
New-HTMLTableCondition -Name 'ACLConsistent' -Value 'Not available' -BackgroundColor Crimson -ComparisonType string
|
||||
New-HTMLTableCondition -Name 'ACLConsistentInside' -Value 'Not available' -BackgroundColor Crimson -ComparisonType string
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX -ExcludeProperty 'UserVersion', 'ComputerVersion', 'WmiFilter', 'ACLConsistentInsideDetails'
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix - Permissions Consistency' {
|
||||
@@ -145,7 +145,7 @@
|
||||
}
|
||||
New-HTMLWizardStep -Name 'Fix inconsistent downlevel permissions' {
|
||||
New-HTMLText -Text @(
|
||||
"Unfortunetly this step is manual until automation is developed. "
|
||||
"Unfortunately this step is manual until automation is developed. "
|
||||
"If there are inconsistent permissions found inside GPO one has to fix them manually by going into SYSVOL and making sure inheritance is enabled, and that permissions are consistent across all files."
|
||||
"Please keep in mind that it's possible inconsistent downlevel permissions fix will not be required once the top level fix is applied. "
|
||||
"Rerun report to find out if you've just fixed top-level permissions. "
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
"CNF objects, Conflict objects or Duplicate Objects are created in Active Directory when there is simultaneous creation of an AD object under the same container "
|
||||
"on two separate Domain Controllers near about the same time or before the replication occurs. "
|
||||
"This results in a conflict and the same is exhibited by a CNF (Duplicate) object. "
|
||||
"While it doesn't nessecary has a huge impact on Active Directory it's important to keep Active Directory in proper, healthy state. "
|
||||
"While it doesn't nessecarily have a huge impact on Active Directory, it's important to keep Active Directory in proper, healthy state. "
|
||||
}
|
||||
New-HTMLText -Text 'As it stands currently there are ', $Script:Reporting['GPODuplicates']['Data'].Count, ' CNF (Duplicate) Group Policy objects to be deleted.' -FontSize 10pt -FontWeight normal, bold, normal
|
||||
}
|
||||
@@ -48,7 +48,7 @@
|
||||
New-HTMLSection -Name 'Group Policy CNF (Duplicate) Objects' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPODuplicates']['Data'] -Filtering {
|
||||
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix - Remove duplicate (CNF) objects' {
|
||||
@@ -120,4 +120,4 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,12 @@
|
||||
|
||||
}
|
||||
Solution = {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOFiles']['Data'] -Filtering
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOFiles']['Data'] -Filtering -ScrollX -PagingOptions 7, 15, 30, 45, 60 {
|
||||
New-HTMLTableCondition -Name 'SuggestedAction' -Value 'Requires verification' -BackgroundColor YellowOrange -ComparisonType string
|
||||
New-HTMLTableCondition -Name 'SuggestedAction' -Value 'Consider deleting' -BackgroundColor Salmon -ComparisonType string
|
||||
New-HTMLTableCondition -Name 'SuggestedAction' -Value 'GPO requires cleanup' -BackgroundColor RedRobin -ComparisonType string
|
||||
New-HTMLTableCondition -Name 'SuggestedAction' -Value 'Skip assesment' -BackgroundColor LightGreen -ComparisonType string
|
||||
}
|
||||
if ($Script:Reporting['GPOFiles']['WarningsAndErrors']) {
|
||||
New-HTMLSection -Name 'Warnings & Errors to Review' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOFiles']['WarningsAndErrors'] -Filtering {
|
||||
|
||||
@@ -0,0 +1,79 @@
|
||||
$GPOZaurrGPORedirects = [ordered] @{
|
||||
Name = 'Group Policies With Redirected SYSVOL'
|
||||
Enabled = $false
|
||||
ActionRequired = $null
|
||||
Data = $null
|
||||
Execute = {
|
||||
Get-GPOZaurrRedirect -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains
|
||||
}
|
||||
Processing = {
|
||||
foreach ($GPO in $Script:Reporting['GPORedirect']['Data']) {
|
||||
$Script:Reporting['GPORedirect']['Variables']['GPOTotal']++
|
||||
if ($GPO.IsCorrect -eq $true) {
|
||||
$Script:Reporting['GPORedirect']['Variables']['GPOIsCorrect']++
|
||||
} else {
|
||||
$Script:Reporting['GPORedirect']['Variables']['GPOIsNotCorrect']++
|
||||
}
|
||||
}
|
||||
if ($Script:Reporting['GPORedirect']['Variables']['GPOIsNotCorrect'] -gt 0) {
|
||||
$Script:Reporting['GPORedirect']['ActionRequired'] = $true
|
||||
} else {
|
||||
$Script:Reporting['GPORedirect']['ActionRequired'] = $false
|
||||
}
|
||||
}
|
||||
Variables = @{
|
||||
GPOTotal = 0
|
||||
GPOIsCorrect = 0
|
||||
GPOIsNotCorrect = 0
|
||||
}
|
||||
Overview = {
|
||||
|
||||
}
|
||||
Summary = {
|
||||
New-HTMLText -TextBlock {
|
||||
"Group Policies are stored in Active Directory and SYSVOL. SYSVOL is a folder shared by the domain controllers to hold its logon scripts, "
|
||||
"group policy data, and other domain-wide data which needs to be available anywhere there is a domain controller. "
|
||||
"SYSVOL provides a default location for files that must be shared for common access throughout a domain. "
|
||||
"However it is possible to redirect SYSVOL to a different location by modifying "
|
||||
"gPCFileSysPath "
|
||||
"attribute of a GPO. "
|
||||
"This is not recommended and should be avoided, but it can also be a sign of compromise."
|
||||
"This report shows which GPOs are redirected and which are not. "
|
||||
} -FontSize 10pt -LineBreak -FontWeight normal, normal, normal, normal, bold, normal, normal, normal -Color None, None, None, None, RedBerry, None, None, None
|
||||
New-HTMLList -Type Unordered {
|
||||
New-HTMLListItem -Text 'Group Policies in total: ', $Script:Reporting['GPORedirect']['Variables']['GPOTotal'] -FontWeight normal, bold
|
||||
New-HTMLListItem -Text 'Group Policies without redirects: ', $Script:Reporting['GPORedirect']['Variables']['GPOIsCorrect'] -FontWeight normal, bold -Color None, MintGreen
|
||||
New-HTMLListItem -Text 'Group Policies with redirects: ', $Script:Reporting['GPORedirect']['Variables']['GPOIsNotCorrect'] -FontWeight normal, bold -Color None, RedBerry
|
||||
} -FontSize 10pt
|
||||
New-HTMLText -TextBlock {
|
||||
"If you notice any GPO with redirect, you should investigate it. "
|
||||
} -FontSize 10pt -LineBreak
|
||||
}
|
||||
Solution = {
|
||||
New-HTMLSection -Invisible {
|
||||
New-HTMLPanel {
|
||||
& $Script:GPOConfiguration['GPORedirect']['Summary']
|
||||
}
|
||||
New-HTMLPanel {
|
||||
New-HTMLChart {
|
||||
New-ChartBarOptions -Type barStacked
|
||||
New-ChartLegend -Name 'No redirects', 'With redirects' -Color MintGreen, MediumOrchid
|
||||
New-ChartBar -Name 'No redirection' -Value $Script:Reporting['GPORedirect']['Variables']['GPOIsCorrect'], $Script:Reporting['GPORedirect']['Variables']['GPOIsNotCorrect']
|
||||
} -Title 'Group Policies with redirects' -TitleAlignment center
|
||||
}
|
||||
}
|
||||
New-HTMLSection -Name 'Group Policies showing redirects (if any)' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPORedirect']['Data'] -Filtering {
|
||||
New-HTMLTableCondition -Name 'IsCorrect' -Value $false -BackgroundColor Salmon -ComparisonType bool -FailBackgroundColor MintGreen -HighlightHeaders 'IsCorrect', 'Path', 'ExpectedPath'
|
||||
} -ScrollX -PagingOptions 7, 15, 30, 45, 60
|
||||
}
|
||||
if ($Script:Reporting['GPORedirect']['WarningsAndErrors']) {
|
||||
New-HTMLSection -Name 'Warnings & Errors to Review' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPORedirect']['WarningsAndErrors'] -Filtering {
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Warning' -BackgroundColor SandyBrown -ComparisonType string -Row
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Error' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -68,7 +68,7 @@
|
||||
New-HTMLTableCondition -Name 'LinksCount' -Value 0 -ComparisonType number
|
||||
New-HTMLTableCondition -Name 'LinksEnabledCount' -Value 0 -ComparisonType number
|
||||
} -BackgroundColor Salmon -FailBackgroundColor Goldenrod -Logic OR -HighlightHeaders 'LinksCount', 'LinksEnabledCount', 'DisplayName', 'DomainName'
|
||||
}
|
||||
} -ScrollX -PagingOptions 7, 15, 30, 45, 60
|
||||
}
|
||||
if ($Script:Reporting['GPOUpdates']['WarningsAndErrors']) {
|
||||
New-HTMLSection -Name 'Warnings & Errors to Review' {
|
||||
|
||||
@@ -16,7 +16,9 @@ $GPOZaurrLinks = [ordered] @{
|
||||
|
||||
}
|
||||
Solution = {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOLinks']['Data'] -Filtering
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOLinks']['Data'] -Filtering -ScrollX -PagingOptions 7, 15, 30, 45, 60 -ExcludeProperty 'LinksObjects' {
|
||||
New-HTMLTableCondition -Name 'Linked' -Value 'True' -BackgroundColor PaleGreen -ComparisonType string -FailBackgroundColor Salmon
|
||||
}
|
||||
if ($Script:Reporting['GPOLinks']['WarningsAndErrors']) {
|
||||
New-HTMLSection -Name 'Warnings & Errors to Review' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOLinks']['WarningsAndErrors'] -Filtering {
|
||||
|
||||
@@ -388,7 +388,7 @@
|
||||
New-HTMLTableCondition -Name 'UserProblem' -Value $false -BackgroundColor SpringGreen -ComparisonType string
|
||||
New-HTMLTableCondition -Name 'ComputerOptimized' -Value $true -BackgroundColor SpringGreen -ComparisonType string
|
||||
New-HTMLTableCondition -Name 'UserOptimized' -Value $true -BackgroundColor SpringGreen -TextTransform capitalize -ComparisonType string
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX -ExcludeProperty 'LinksObjects', 'GPOObject', 'ACL', 'Size'
|
||||
}
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
$GPOZaurrMissingFiles = [ordered] @{
|
||||
Name = 'Group Policies with missing files'
|
||||
Enabled = $true
|
||||
Action = $null
|
||||
Data = $null
|
||||
Execute = {
|
||||
Get-GPOZaurrMissingFiles -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -GPOName $GPOName -GPOGUID $GPOGUID | Sort-Object -Property ErrorCount -Descending
|
||||
}
|
||||
Processing = {
|
||||
foreach ($GPO in $Script:Reporting['GPOBrokenPartially']['Data']) {
|
||||
if ($GPO.ErrorCount -gt 0) {
|
||||
$Script:Reporting['GPOBrokenPartially']['Variables']['RequireFixing']++
|
||||
}
|
||||
}
|
||||
if ($Script:Reporting['GPOBrokenPartially']['Variables']['RequireFixing'] -gt 0) {
|
||||
$Script:Reporting['GPOBrokenPartially']['ActionRequired'] = $true
|
||||
} else {
|
||||
$Script:Reporting['GPOBrokenPartially']['ActionRequired'] = $false
|
||||
}
|
||||
}
|
||||
Variables = @{
|
||||
RequireFixing = 0
|
||||
}
|
||||
Overview = {
|
||||
|
||||
}
|
||||
Resources = @(
|
||||
|
||||
)
|
||||
Summary = {
|
||||
New-HTMLText -FontSize 10pt -TextBlock {
|
||||
"Group Policies can become broken for various reasons. One of the common reasons is when GPOs are created and then deleted without being properly removed from Active Directory. "
|
||||
"In other cases, it can be due to replication issues, or simply due to corruption. "
|
||||
"This can lead to GPOs not being applied as expected, or not being applied at all. "
|
||||
"If random files are missing from GPOs, it's important to fix them to ensure that GPOs are applied as expected. "
|
||||
"This report provides you with list of GPOs that have missing files. "
|
||||
"Once files are missing, it's usually best to restore them from backup (if available) or remove the given section completely. "
|
||||
"It's not possible to restore missing files from Active Directory directly or manually. "
|
||||
} -LineBreak
|
||||
New-HTMLText -Text 'As it stands currently there are ', $Script:Reporting['GPOBrokenPartially']['Variables']['RequireFixing'], ' error requring fixing. ' -FontSize 10pt -FontWeight normal, bold, normal
|
||||
}
|
||||
Solution = {
|
||||
New-HTMLSection -Invisible {
|
||||
New-HTMLPanel {
|
||||
& $Script:GPOConfiguration['GPOBrokenPartially']['Summary']
|
||||
}
|
||||
New-HTMLPanel {
|
||||
New-HTMLChart {
|
||||
New-ChartLegend -Names 'Bad' -Color Salmon
|
||||
New-ChartBar -Name 'Missing Files' -Value $Script:Reporting['GPOBrokenPartially']['Variables']['RequireFixing']
|
||||
} -Title 'Group Policies with Missing Files' -TitleAlignment center
|
||||
}
|
||||
}
|
||||
New-HTMLSection -Name 'Group Policy Missing Files' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOBrokenPartially']['Data'] -Filtering {
|
||||
New-HTMLTableCondition -Name 'ErrorCount' -Value 0 -BackgroundColor LightGreen -ComparisonType number -FailBackgroundColor Salmon -HighlightHeaders 'ErrorCount', 'ErrorCategory', 'ErrorDetails'
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix - Remove duplicate (CNF) objects' {
|
||||
New-HTMLContainer {
|
||||
New-HTMLSpanStyle -FontSize 10pt {
|
||||
New-HTMLWizard {
|
||||
New-HTMLWizardStep -Name 'Prepare environment' {
|
||||
New-HTMLText -Text "To be able to execute actions in automated way please install required modules. Those modules will be installed straight from Microsoft PowerShell Gallery."
|
||||
New-HTMLCodeBlock -Code {
|
||||
Install-Module GPOZaurr -Force
|
||||
Import-Module GPOZaurr -Force
|
||||
} -Style powershell
|
||||
New-HTMLText -Text "Using force makes sure newest version is downloaded from PowerShellGallery regardless of what is currently installed. Once installed you're ready for next step."
|
||||
}
|
||||
New-HTMLWizardStep -Name 'Prepare report' {
|
||||
New-HTMLText -Text "Depending when this report was run you may want to prepare new report before proceeding fixing duplicate GPO objects. To generate new report please use:"
|
||||
New-HTMLCodeBlock -Code {
|
||||
Invoke-GPOZaurr -FilePath $Env:UserProfile\Desktop\GPOZaurrMissingFilesBefore.html -Verbose -Type GPOMissingFiles
|
||||
}
|
||||
New-HTMLText -TextBlock {
|
||||
"When executed it will take a while to generate all data and provide you with new report depending on size of environment. "
|
||||
"Once confirmed that data is still showing issues and requires fixing please proceed with next step. "
|
||||
}
|
||||
New-HTMLText -Text "Alternatively if you prefer working with console you can run: "
|
||||
New-HTMLCodeBlock -Code {
|
||||
$GPOOutput = Get-GPOZaurrMissingFiles -BrokenOnly
|
||||
$GPOOutput | Format-Table # do your actions as desired
|
||||
}
|
||||
New-HTMLText -Text "It provides same data as you see in table above just doesn't prettify it for you."
|
||||
}
|
||||
New-HTMLWizardStep -Name 'Remove Broken objects' {
|
||||
New-HTMLText -Text "There is no automated way to fix missing files. You need to manually fix them. "
|
||||
New-HTMLText -Text "You can do so by restoring files from backup or removing section completly. "
|
||||
}
|
||||
New-HTMLWizardStep -Name 'Verification report' {
|
||||
New-HTMLText -TextBlock {
|
||||
"Once cleanup task was executed properly, we need to verify that report now shows no problems."
|
||||
}
|
||||
New-HTMLCodeBlock -Code {
|
||||
Invoke-GPOZaurr -FilePath $Env:UserProfile\Desktop\GPOZaurrMissingFilesAfter.html -Verbose -Type GPOMissingFiles
|
||||
}
|
||||
New-HTMLText -Text "If everything is healthy in the report you're done! Enjoy rest of the day!" -Color BlueDiamond
|
||||
}
|
||||
} -RemoveDoneStepOnNavigateBack -Theme arrows -ToolbarButtonPosition center -EnableAllAnchors
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($Script:Reporting['GPOBrokenPartially']['WarningsAndErrors']) {
|
||||
New-HTMLSection -Name 'Warnings & Errors to Review' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOZaurrMissingFiles']['WarningsAndErrors'] -Filtering {
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Warning' -BackgroundColor SandyBrown -ComparisonType string -Row
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Error' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -135,7 +135,7 @@
|
||||
New-HTMLTableCondition -Name 'OwnerType' -Value "WellKnownAdministrative" -BackgroundColor LightGreen -ComparisonType string -Operator eq
|
||||
New-HTMLTableCondition -Name 'Status' -Value "OK" -BackgroundColor LightGreen -ComparisonType string -Operator eq
|
||||
New-HTMLTableCondition -Name 'Status' -Value "OK" -BackgroundColor Salmon -ComparisonType string -Operator ne
|
||||
}
|
||||
} -ScrollX -PagingOptions 7, 15, 30, 45, 60
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix NetLogon Owners ' {
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
New-HTMLTableCondition -Name 'Status' -Value "Review permission required" -BackgroundColor PaleGoldenrod -ComparisonType string -Operator eq
|
||||
New-HTMLTableCondition -Name 'Status' -Value "Removal permission required" -BackgroundColor Salmon -ComparisonType string -Operator eq -Row
|
||||
New-HTMLTableCondition -Name 'Status' -Value "OK" -BackgroundColor LightGreen -ComparisonType string -Operator eq
|
||||
}
|
||||
} -ScrollX -PagingOptions 7, 15, 30, 45, 60
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix NetLogon Permissions ' {
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
#$Script:Reporting['GPOOrganizationalUnit']['Variables']['WillFixPerDomain'][$OU.DomainName]++
|
||||
} elseif ($OU.Status -contains 'Excluded' -or $OU.Status -contains 'Excluded, Default OU') {
|
||||
$Script:Reporting['GPOOrganizationalUnit']['Variables']['Excluded']++
|
||||
$Script:Reporting['GPOOrganizationalUnit']['Variables']['ExcludedOU'].Add($OU.Organizationalunit)
|
||||
$null = $Script:Reporting['GPOOrganizationalUnit']['Variables']['ExcludedOU'].Add($OU.Organizationalunit)
|
||||
} else {
|
||||
$Script:Reporting['GPOOrganizationalUnit']['Variables']['Legitimate']++
|
||||
}
|
||||
@@ -52,6 +52,7 @@
|
||||
DeleteOU = 0
|
||||
Legitimate = 0
|
||||
Excluded = 0
|
||||
# Since we're using Copy-Dictionary this will get translated to Array List
|
||||
ExcludedOU = [System.Collections.Generic.List[string]]::new()
|
||||
WillFix = 0
|
||||
WillFixPerDomain = $null
|
||||
@@ -132,6 +133,7 @@
|
||||
}
|
||||
}
|
||||
New-HTMLSection -Name 'Group Policy Organizational Units' {
|
||||
# Not adding ScrollX to hide Objects, as it can get quite big
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOOrganizationalUnit']['Data'] -Filtering {
|
||||
New-TableHeader -ResponsiveOperations none -Names 'GPONames', 'Objects'
|
||||
New-HTMLTableCondition -Name 'Status' -ComparisonType string -Value 'Unlink GPO, Delete OU' -BackgroundColor Salmon -Row
|
||||
@@ -140,7 +142,7 @@
|
||||
New-HTMLTableCondition -Name 'Status' -ComparisonType string -Value 'OK' -BackgroundColor LightGreen -Row
|
||||
New-HTMLTableCondition -Name 'Status' -ComparisonType string -Value 'Excluded' -BackgroundColor DeepSkyBlue -Row
|
||||
New-HTMLTableCondition -Name 'Status' -ComparisonType string -Value 'Excluded, Default OU' -BackgroundColor DeepSkyBlue -Row
|
||||
} -PagingOptions 10, 20, 30, 40, 50 -ExcludeProperty GPO
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ExcludeProperty GPO
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix Group Organizational Units' {
|
||||
@@ -209,13 +211,13 @@
|
||||
} -LineBreak
|
||||
New-HTMLText -Text 'Once happy with results please follow with command (this will start removal process): ' -LineBreak -FontWeight bold
|
||||
New-HTMLCodeBlock -Code {
|
||||
Remove-GPOZaurrLinkEmptyOU -WhatIf -LimitProcessing 2 -Verbose
|
||||
Remove-GPOZaurrLinkEmptyOU -LimitProcessing 2 -Verbose
|
||||
}
|
||||
New-HTMLText -TextBlock {
|
||||
"Alternatively for multi-domain scenario, if you have limited Domain Admin credentials to a single domain please use following command: "
|
||||
}
|
||||
New-HTMLCodeBlock -Code {
|
||||
Remove-GPOZaurrLinkEmptyOU -WhatIf -LimitProcessing 2 -Verbose -IncludeDomains 'YourDomainYouHavePermissionsFor'
|
||||
Remove-GPOZaurrLinkEmptyOU -LimitProcessing 2 -Verbose -IncludeDomains 'YourDomainYouHavePermissionsFor'
|
||||
}
|
||||
New-HTMLText -TextBlock {
|
||||
"This command when executed deletes only first X broken GPOs. Use LimitProcessing parameter to prevent mass delete and increase the counter when no errors occur. "
|
||||
@@ -256,7 +258,7 @@
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOOrganizationalUnit']['WarningsAndErrors'] -Filtering {
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Warning' -BackgroundColor SandyBrown -ComparisonType string -Row
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Error' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
} -PagingOptions 7, 15, 30, 45, 60
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,8 @@
|
||||
New-HTMLTableCondition -Name 'Status' -Value "Not available on SYSVOL" -BackgroundColor LightCoral -ComparisonType string
|
||||
New-HTMLTableCondition -Name 'Status' -Value "ObjectClass issue" -BackgroundColor MediumOrchid -ComparisonType string
|
||||
New-HTMLTableCondition -Name 'Status' -Value "Permissions issue" -BackgroundColor MediumVioletRed -ComparisonType string -Color White
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
New-HTMLTableCondition -Name 'Status' -Value "Exists" -BackgroundColor LightGreen -ComparisonType string
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix - Not available on SYSVOL / Active Directory / ObjectClass issue' {
|
||||
|
||||
@@ -184,7 +184,7 @@
|
||||
#New-HTMLTableCondition -Name 'Status' -Value 'Administrative, Inconsistent, Approved' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
# New-HTMLTableCondition -Name 'Status' -Value 'NotAdministrative, Inconsistent, Approved' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix Group Policy Owners' {
|
||||
@@ -307,7 +307,7 @@
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOOwners']['WarningsAndErrors'] -Filtering {
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Warning' -BackgroundColor SandyBrown -ComparisonType string -Row
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Error' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
} -PagingOptions 7, 15, 30, 45, 60
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
}
|
||||
Solution = {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPassword']['Data'] -Filtering
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPassword']['Data'] -Filtering -ScrollX -PagingOptions 7, 15, 30, 45, 60
|
||||
|
||||
if ($Script:Reporting['GPOPassword']['WarningsAndErrors']) {
|
||||
New-HTMLSection -Name 'Warnings & Errors to Review' {
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
New-HTMLSection -Name 'Group Policy Administrative Users Analysis' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissionsAdministrative']['Data'].PermissionsAnalysis -Filtering {
|
||||
# New-HTMLTableCondition -Name 'Permission' -Value '' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
} -PagingOptions 7, 15, 30, 45, 60
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix Group Policy Administrative Users' {
|
||||
@@ -202,7 +202,7 @@
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissionsAdministrative']['WarningsAndErrors'] -Filtering {
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Warning' -BackgroundColor SandyBrown -ComparisonType string -Row
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Error' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
} -PagingOptions 7, 15, 30, 45, 60
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -185,7 +185,7 @@
|
||||
} -FontSize 10pt
|
||||
|
||||
New-HTMLText -FontSize 10pt -Text @(
|
||||
"Unfortunetly it's not as simple as it sounds. While checking for permissions mostly works fine, it's possible a Group Policy has totally removed account permissions from being able to asses any of it. ",
|
||||
"Unfortunately it's not as simple as it sounds. While checking for permissions mostly works fine, it's possible a Group Policy has totally removed account permissions from being able to asses any of it. ",
|
||||
"The account we're using "
|
||||
"$($Env:USERDOMAIN)\$($Env:USERNAME.ToUpper())",
|
||||
" may simply not have enough permisions to properly asses permissions for a GPO. "
|
||||
@@ -265,7 +265,7 @@
|
||||
|
||||
New-HTMLText -Text "Fourth problem relates to UNKNOWN SID" -FontSize 10pt -FontWeight bold -TextDecoration underline -Alignment center
|
||||
New-HTMLText -FontSize 10pt -TextBlock {
|
||||
"Sometimes groups or users are deleted in Active Directory and unfortunetly their permissions are not cleaned automatically. "
|
||||
"Sometimes groups or users are deleted in Active Directory and Unfortunately their permissions are not cleaned automatically. "
|
||||
"Those are left in-place and stay there forever until removed. "
|
||||
} -LineBreak
|
||||
|
||||
@@ -309,7 +309,7 @@
|
||||
New-HTMLSection -Name 'Group Policy Visibility Analysis' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissions']['Data'].PermissionsIssues -Filtering {
|
||||
New-HTMLTableCondition -Name 'PermissionIssue' -Value $true -BackgroundColor Salmon -ComparisonType string -Row
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -DefaultSortColumn PermissionIssue -DefaultSortOrder Descending
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -DefaultSortColumn PermissionIssue -DefaultSortOrder Descending -ScrollX
|
||||
}
|
||||
New-HTMLSection -Name 'Group Policy Permissions Analysis' {
|
||||
New-HTMLContainer {
|
||||
@@ -344,7 +344,7 @@
|
||||
New-HTMLTableCondition -Name 'EnterpriseAdmins' -Value 'True' -BackgroundColor Salmon -ComparisonType string -Operator ne
|
||||
|
||||
New-TableEvent -TableID 'GPOPermissionsAll' -SourceColumnName 'GUID' -TargetColumnID 1 # TargetColumnID 1 eq GUID on the other table
|
||||
} -PagingOptions 7, 15, 30, 45, 60
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
}
|
||||
}
|
||||
New-HTMLSection -Name 'All Permissions' {
|
||||
@@ -355,7 +355,7 @@
|
||||
New-HTMLTableCondition -Name 'Permission' -Value 'GpoApply' -BackgroundColor Orange -ComparisonType string
|
||||
New-HTMLTableCondition -Name 'Permission' -Value 'GpoRead' -BackgroundColor MediumSpringGreen -ComparisonType string -Operator eq
|
||||
New-HTMLTableCondition -Name 'PrincipalSidType' -Value 'Unknown' -BackgroundColor Salmon -ComparisonType string -Operator eq
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -DataTableID 'GPOPermissionsAll'
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -DataTableID 'GPOPermissionsAll' -ScrollX -ExcludeProperty 'GPOSecurity', 'GPOSecurityPermissionItem', 'GPOObject'
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix Group Policy Administrative Users' {
|
||||
|
||||
@@ -151,12 +151,12 @@
|
||||
New-HTMLSection -Name 'Group Policy Authenticated Users Analysis' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissionsRead']['Data'].Permissions -Filtering {
|
||||
New-HTMLTableCondition -Name 'Permission' -Value '' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
} -PagingOptions 7, 15, 30, 45, 60
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
}
|
||||
New-HTMLSection -Name 'Group Policy Issues Assesment' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissionsRead']['Data'].Issues -Filtering {
|
||||
New-HTMLTableCondition -Name 'PermissionIssue' -Value $true -BackgroundColor Salmon -ComparisonType string -Row
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -DefaultSortColumn PermissionIssue -DefaultSortOrder Descending
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -DefaultSortColumn PermissionIssue -DefaultSortOrder Descending -ScrollX
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix Group Policy Authenticated Users' {
|
||||
@@ -259,7 +259,7 @@
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissionsRead']['WarningsAndErrors'] -Filtering {
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Warning' -BackgroundColor SandyBrown -ComparisonType string -Row
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Error' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
} -PagingOptions 7, 15, 30, 45, 60
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
}
|
||||
Solution = {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissionsRoot']['Data'] -Filtering
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissionsRoot']['Data'] -Filtering -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
if ($Script:Reporting['GPOPermissionsRoot']['WarningsAndErrors']) {
|
||||
New-HTMLSection -Name 'Warnings & Errors to Review' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissionsRoot']['WarningsAndErrors'] -Filtering {
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
New-HTMLSection -Name 'Group Policy Unknown Permissions Analysis' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissionsUnknown']['Data'] -Filtering {
|
||||
New-HTMLTableCondition -Name 'Permission' -Value '' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
} -PagingOptions 7, 15, 30, 45, 60
|
||||
} -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
}
|
||||
if ($Script:Reporting['Settings']['HideSteps'] -eq $false) {
|
||||
New-HTMLSection -Name 'Steps to fix Group Policy Unknown Permissions' {
|
||||
@@ -174,7 +174,7 @@
|
||||
New-HTMLTable -DataTable $Script:Reporting['GPOPermissionsUnknown']['WarningsAndErrors'] -Filtering {
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Warning' -BackgroundColor SandyBrown -ComparisonType string -Row
|
||||
New-HTMLTableCondition -Name 'Type' -Value 'Error' -BackgroundColor Salmon -ComparisonType string -Row
|
||||
} -PagingOptions 10, 20, 30, 40, 50
|
||||
} -PagingOptions 7, 15, 30, 45, 60
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,9 +14,23 @@
|
||||
}
|
||||
Overview = {
|
||||
|
||||
}
|
||||
Summary = {
|
||||
New-HTMLText -TextBlock {
|
||||
"This report shows legacy ADM files in SYSVOL. These files are no longer used and can be safely removed. "
|
||||
"Before 'adm' files were replaced by 'admx' files, they were stored in the SYSVOL share, directly per each GPO. "
|
||||
"This report will help you identify and remove these files. "
|
||||
}
|
||||
}
|
||||
Solution = {
|
||||
New-HTMLTable -DataTable $Script:Reporting['SysVolLegacyFiles']['Data'] -Filtering
|
||||
New-HTMLSection -Invisible {
|
||||
New-HTMLPanel {
|
||||
& $Script:GPOConfiguration['SysVolLegacyFiles']['Summary']
|
||||
}
|
||||
}
|
||||
New-HTMLSection -Name "Legacy ADM Files in SYSVOL" {
|
||||
New-HTMLTable -DataTable $Script:Reporting['SysVolLegacyFiles']['Data'] -Filtering -PagingOptions 7, 15, 30, 45, 60 -ScrollX
|
||||
}
|
||||
if ($Script:Reporting['SysVolLegacyFiles']['WarningsAndErrors']) {
|
||||
New-HTMLSection -Name 'Warnings & Errors to Review' {
|
||||
New-HTMLTable -DataTable $Script:Reporting['SysVolLegacyFiles']['WarningsAndErrors'] -Filtering {
|
||||
|
||||
@@ -1,4 +1,26 @@
|
||||
function New-GPOZaurrExclusions {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates exclusion code for Group Policy Objects (GPOs) in Zaurr format.
|
||||
|
||||
.DESCRIPTION
|
||||
The New-GPOZaurrExclusions function generates exclusion code for GPOs in Zaurr format based on the provided exclusions. It supports both script block and array types of exclusions.
|
||||
|
||||
.PARAMETER Exclusions
|
||||
Specifies the exclusions to be included in the generated code. This parameter accepts script blocks or arrays of exclusion items.
|
||||
|
||||
.EXAMPLE
|
||||
$exclusions = {
|
||||
# Exclude specific settings
|
||||
'Setting1',
|
||||
'Setting2'
|
||||
}
|
||||
New-GPOZaurrExclusions -Exclusions $exclusions
|
||||
|
||||
.EXAMPLE
|
||||
$exclusions = @('Setting1', 'Setting2')
|
||||
New-GPOZaurrExclusions -Exclusions $exclusions
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[alias('ExcludeGroupPolicies', 'ExclusionsCode', 'ExclusionsArray')][Parameter(Position = 1)][object] $Exclusions
|
||||
|
||||
@@ -1,4 +1,22 @@
|
||||
function New-GPOZaurrReportConsole {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Generates a detailed report of Group Policy Objects (GPO) applied to a computer and user.
|
||||
|
||||
.DESCRIPTION
|
||||
This function provides a comprehensive overview of the Group Policy Objects (GPO) applied to a specific computer and user. It includes information such as last applied time, computer details, domain name, organizational unit, site, GPO types, slow link status, applied GPOs, and denied GPOs.
|
||||
|
||||
.PARAMETER Results
|
||||
An IDictionary containing the results of Group Policy Object queries for both computer and user.
|
||||
|
||||
.PARAMETER ComputerName
|
||||
The name of the computer for which the GPO report is generated.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrReportConsole -Results $Results -ComputerName "MyComputer"
|
||||
Generates a detailed report of Group Policy Objects applied to the computer named "MyComputer".
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Collections.IDictionary] $Results,
|
||||
|
||||
@@ -1,4 +1,35 @@
|
||||
function New-GPOZaurrReportHTML {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Generates an HTML report based on Group Policy information.
|
||||
|
||||
.DESCRIPTION
|
||||
The New-GPOZaurrReportHTML function generates an HTML report based on the Group Policy information provided. It includes detailed sections for general computer information, CPU and RAM details, operating system information, and disk information.
|
||||
|
||||
.PARAMETER Support
|
||||
Specifies the Group Policy support information to be included in the report.
|
||||
|
||||
.PARAMETER Path
|
||||
Specifies the path where the HTML report will be saved. If not provided, a temporary file will be created.
|
||||
|
||||
.PARAMETER Online
|
||||
Indicates whether to generate an online report.
|
||||
|
||||
.PARAMETER Open
|
||||
Indicates whether to open the generated report after creation.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrReportHTML -Support $GPOInfo -Path "C:\Reports\GPOReport.html"
|
||||
Generates an HTML report based on the Group Policy information in $GPOInfo and saves it to the specified path.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrReportHTML -Support $GPOInfo -Online
|
||||
Generates an online HTML report based on the Group Policy information in $GPOInfo.
|
||||
|
||||
.EXAMPLE
|
||||
New-GPOZaurrReportHTML -Support $GPOInfo -Path "C:\Reports\GPOReport.html" -Open
|
||||
Generates an HTML report based on the Group Policy information in $GPOInfo, saves it to the specified path, and opens the report after creation.
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Collections.IDictionary] $Support,
|
||||
|
||||
@@ -1,4 +1,32 @@
|
||||
function New-HTMLReportAll {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Generates an HTML report based on specified parameters.
|
||||
|
||||
.DESCRIPTION
|
||||
This function generates an HTML report with customizable content based on the provided parameters. It supports generating standard reports and can be used for various reporting purposes.
|
||||
|
||||
.PARAMETER FilePath
|
||||
Specifies the file path where the HTML report will be saved.
|
||||
|
||||
.PARAMETER Online
|
||||
Indicates whether the report should be generated online.
|
||||
|
||||
.PARAMETER HideHTML
|
||||
Hides the HTML content of the report if specified.
|
||||
|
||||
.PARAMETER Type
|
||||
Specifies the type of report to generate.
|
||||
|
||||
.EXAMPLE
|
||||
New-HTMLReportAll -FilePath "C:\Reports\Report.html" -Online -Type "Summary"
|
||||
Generates an HTML report with a summary of data and saves it to the specified file path.
|
||||
|
||||
.EXAMPLE
|
||||
New-HTMLReportAll -FilePath "C:\Reports\FullReport.html" -Type "Detailed"
|
||||
Generates a detailed HTML report and saves it to the specified file path.
|
||||
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string] $FilePath,
|
||||
|
||||
@@ -1,4 +1,34 @@
|
||||
function New-HTMLReportWithSplit {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Creates an HTML report with the option to split it into multiple files for easier viewing.
|
||||
|
||||
.DESCRIPTION
|
||||
This function generates an HTML report based on the provided parameters. It also allows splitting the report into multiple files for better organization and readability.
|
||||
|
||||
.PARAMETER FilePath
|
||||
Specifies the path where the HTML report will be saved.
|
||||
|
||||
.PARAMETER Online
|
||||
Indicates whether the report should be generated for online viewing.
|
||||
|
||||
.PARAMETER HideHTML
|
||||
Hides the HTML report file after generation.
|
||||
|
||||
.PARAMETER CurrentReport
|
||||
Specifies the type of the current report to generate.
|
||||
|
||||
.EXAMPLE
|
||||
New-HTMLReportWithSplit -FilePath "C:\Reports\GPO_Report.html" -Online -HideHTML -CurrentReport "Security"
|
||||
|
||||
Generates an HTML report for the "Security" report type and saves it to the specified file path. The report is optimized for online viewing and the HTML file is hidden after generation.
|
||||
|
||||
.EXAMPLE
|
||||
New-HTMLReportWithSplit -FilePath "C:\Reports\All_Reports.html" -CurrentReport "All"
|
||||
|
||||
Generates an HTML report for all available report types and saves it to the specified file path.
|
||||
|
||||
#>
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[string] $FilePath,
|
||||
@@ -19,7 +49,7 @@
|
||||
# or if current report is given and it matches the current report type which works for split reprots
|
||||
if ($Script:GPOConfiguration[$T].Enabled -eq $true -and ((-not $CurrentReport) -or ($CurrentReport -and $CurrentReport -eq $T))) {
|
||||
Write-Color -Text '[i]', '[HTML ] ', "Generating HTML report ($FilePath) for $T with split reports" -Color Yellow, DarkGray, Yellow
|
||||
New-HTML -Author 'Przemysław Kłys' -TitleText 'GPOZaurr Report' {
|
||||
New-HTML -Author 'Przemysław Kłys @ Evotec' -TitleText 'GPOZaurr Report' {
|
||||
New-HTMLTabStyle -BorderRadius 0px -TextTransform capitalize -BackgroundColorActive SlateGrey
|
||||
New-HTMLSectionStyle -BorderRadius 0px -HeaderBackGroundColor Grey -RemoveShadow
|
||||
New-HTMLPanelStyle -BorderRadius 0px
|
||||
|
||||
@@ -1,4 +1,33 @@
|
||||
function Remove-PrivPermission {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Removes a specified permission from a Group Policy Object (GPO).
|
||||
|
||||
.DESCRIPTION
|
||||
This function removes a specified permission from a GPO based on the provided Principal and PrincipalType. It supports removing permissions by DistinguishedName or SID. It also provides the option to include specific permission types.
|
||||
|
||||
.PARAMETER Principal
|
||||
Specifies the principal for which the permission needs to be removed.
|
||||
|
||||
.PARAMETER PrincipalType
|
||||
Specifies the type of the principal. Valid values are 'DistinguishedName', 'Name', or 'Sid'.
|
||||
|
||||
.PARAMETER GPOPermission
|
||||
Specifies the GPO permission object to remove.
|
||||
|
||||
.PARAMETER IncludePermissionType
|
||||
Specifies the permission type to include in the removal process.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-PrivPermission -Principal "CN=User1,OU=Users,DC=Contoso,DC=com" -PrincipalType "DistinguishedName" -GPOPermission $PermissionObject -IncludePermissionType "Read"
|
||||
|
||||
This example removes the "Read" permission for the user with the specified DistinguishedName from the GPO.
|
||||
|
||||
.EXAMPLE
|
||||
Remove-PrivPermission -Principal "S-1-5-21-3623811015-3361044348-30300820-1013" -PrincipalType "Sid" -GPOPermission $PermissionObject -IncludePermissionType "Write"
|
||||
|
||||
This example removes the "Write" permission for the user with the specified SID from the GPO.
|
||||
#>
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[string] $Principal,
|
||||
|
||||
@@ -1,4 +1,16 @@
|
||||
function Reset-GPOZaurrStatus {
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Resets the status of GPO configurations.
|
||||
|
||||
.DESCRIPTION
|
||||
This function resets the status of GPO configurations by enabling the default types and disabling all other types.
|
||||
|
||||
.EXAMPLE
|
||||
Reset-GPOZaurrStatus
|
||||
Resets the status of GPO configurations to default.
|
||||
|
||||
#>
|
||||
param(
|
||||
|
||||
)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user