mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-07-26 20:00:09 +00:00
Compare commits
79 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 97a189eda5 | |||
| 0759d1cb85 | |||
| 424e9d2f5c | |||
| 794f6997b8 | |||
| 175b6dede2 | |||
| 91bace0a05 | |||
| 7d829ac78d | |||
| caa9585906 | |||
| d0d6427b38 | |||
| 7c5622f682 | |||
| 12e183b45c | |||
| e52dc71857 | |||
| 9041f4cdbc | |||
| 6f503f735f | |||
| 27830e9f8a | |||
| d8c63ce949 | |||
| 33b2854d63 | |||
| acb51d4444 | |||
| 3bc9bb5f9c | |||
| 58d94edac0 | |||
| d76ae5cd1d | |||
| a11d563704 | |||
| 34c55c8482 | |||
| c6fdfccc61 | |||
| e512c0b0de | |||
| 7afd104b7b | |||
| 60511fa602 | |||
| 9b3924cc00 | |||
| 0bf093351f | |||
| 2d164750f1 | |||
| b8d440f547 | |||
| f25ace130c | |||
| 8b17f9e3a2 | |||
| b97cf1fd9d | |||
| 416b3f0273 | |||
| d3c31e9651 | |||
| 8b963c6b82 | |||
| 989d3ba9f0 | |||
| f3e2d3cc11 | |||
| a7b8b5f6ea | |||
| 7f2adbbb13 | |||
| a82e460406 | |||
| a0e990bf2a | |||
| ddc5630244 | |||
| d377e92fb5 | |||
| b8c3f1e8f8 | |||
| a827afab39 | |||
| 61bb568c94 | |||
| 3f4d8c9907 | |||
| f6466c2ca7 | |||
| 609d93118b | |||
| 193ddd6ff9 | |||
| 889ce5f9ab | |||
| ac224b41b7 | |||
| caaf541e91 | |||
| c856484932 | |||
| 9c3ea2bbe7 | |||
| 5071c0da07 | |||
| fd7c7e1b30 | |||
| 1e3a7a78c8 | |||
| d3f0e04f35 | |||
| fe080aece9 | |||
| 95b814f2f9 | |||
| 59dfa34ba9 | |||
| 9ecf092bd5 | |||
| e917092ac9 | |||
| 047576ff70 | |||
| 5d3370d546 | |||
| e514deca08 | |||
| c99c33d0fa | |||
| f841f41de0 | |||
| fb6931c5e1 | |||
| 9a43c466b7 | |||
| afd99d8e67 | |||
| edd6dbdfa5 | |||
| 9e837d2218 | |||
| 9030233e18 | |||
| d02396f591 | |||
| efb1ddf056 |
@@ -2,4 +2,4 @@
|
||||
|
||||
# Remove GPOS
|
||||
$BackupPath = "$Env:UserProfile\Desktop\GPO"
|
||||
Remove-GPOZaurr -Type Empty, Unlinked -BackupPath $BackupPath -BackupDated -LimitProcessing 2 -Verbose
|
||||
Remove-GPOZaurr -Type Empty, Unlinked -BackupPath $BackupPath -BackupDated -LimitProcessing 2 -Verbose -WhatIf
|
||||
@@ -1,7 +1,7 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
$GPOS = Get-GPOZaurr
|
||||
$GPOS | Format-Table -AutoSize
|
||||
$GPOS | Format-Table -AutoSize *
|
||||
|
||||
$GPOS[0] | Format-List
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# this allows you to process X amount of orphaned folders/files (good for testing)
|
||||
Remove-GPOZaurrOrphanedSysvolFolders -Verbose -WhatIf -LimitProcessing 2
|
||||
Remove-GPOZaurrOrphanedSysvolFolders -Verbose -WhatIf -LimitProcessing 2 -IncludeDomains 'ad.evotec.xyz'
|
||||
|
||||
# this runs for whole SYSVOL and checks things against GPOS
|
||||
Remove-GPOZaurrOrphanedSysvolFolders -Verbose -WhatIf
|
||||
Remove-GPOZaurrOrphanedSysvolFolders -Verbose -IncludeDomains 'ad.evotec.xyz' -BackupPath $Env:UserProfile\Desktop\MyBackup1 #-WhatIf
|
||||
@@ -1,3 +1,3 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
Remove-GPOZaurrLegacyFiles -Verbose -WhatIf
|
||||
Remove-GPOZaurrLegacyFiles -Verbose -BackupPath $Env:USERPROFILE\Desktop\BackupADM1 -BackupDated -RemoveEmptyFolders #-WhatIf #-LimitProcessing 2 -WhatIf
|
||||
@@ -1,22 +0,0 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# Use Save-GPOZaurrFiles -GPOPath $ENV:USERPROFILE\Desktop\GPOExport
|
||||
|
||||
$OutputNoTranslation = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportTest' -NoTranslation
|
||||
$OutputNoTranslation | Format-Table *
|
||||
|
||||
New-HTML {
|
||||
foreach ($GPOCategory in $OutputNoTranslation.Keys) {
|
||||
New-HTMLTab -Name $GPOCategory {
|
||||
if ($Output["$GPOCategory"] -is [System.Collections.IDictionary]) {
|
||||
foreach ($GpoSettings in $OutputNoTranslation["$GPOCategory"].Keys) {
|
||||
New-HTMLTab -Name $GpoSettings {
|
||||
New-HTMLTable -DataTable $OutputNoTranslation[$GPOCategory][$GpoSettings] -ScrollX -DisablePaging -AllProperties -Title $Key
|
||||
}
|
||||
}
|
||||
} else {
|
||||
New-HTMLTable -DataTable $OutputNoTranslation[$GPOCategory] -ScrollX -DisablePaging -AllProperties -Title $Key
|
||||
}
|
||||
}
|
||||
}
|
||||
} -Online -ShowHTML -FilePath $Env:UserProfile\Desktop\OutputFromFindGPO-NoTranslationFromDisk.html
|
||||
@@ -1,22 +0,0 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# Use Save-GPOZaurrFiles -GPOPath $ENV:USERPROFILE\Desktop\GPOExport
|
||||
|
||||
$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportTest' # -NoTranslation
|
||||
$Output | Format-Table *
|
||||
|
||||
New-HTML {
|
||||
foreach ($GPOCategory in $Output.Keys) {
|
||||
New-HTMLTab -Name $GPOCategory {
|
||||
if ($Output["$GPOCategory"] -is [System.Collections.IDictionary]) {
|
||||
foreach ($GpoSettings in $Output["$GPOCategory"].Keys) {
|
||||
New-HTMLTab -Name $GpoSettings {
|
||||
New-HTMLTable -DataTable $Output[$GPOCategory][$GpoSettings] -ScrollX -DisablePaging -AllProperties -Title $Key
|
||||
}
|
||||
}
|
||||
} else {
|
||||
New-HTMLTable -DataTable $Output[$GPOCategory] -ScrollX -DisablePaging -AllProperties -Title $Key
|
||||
}
|
||||
}
|
||||
}
|
||||
} -Online -ShowHTML -FilePath $Env:UserProfile\Desktop\OutputFromFindGPO-FromDisk.html
|
||||
@@ -1,19 +0,0 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
$Output = Invoke-GPOZaurr -NoTranslation
|
||||
|
||||
New-HTML {
|
||||
foreach ($GPOCategory in $Output.Keys) {
|
||||
New-HTMLTab -Name $GPOCategory {
|
||||
if ($Output["$GPOCategory"] -is [System.Collections.IDictionary]) {
|
||||
foreach ($GpoSettings in $Output["$GPOCategory"].Keys) {
|
||||
New-HTMLTab -Name $GpoSettings {
|
||||
New-HTMLTable -DataTable $Output[$GPOCategory][$GpoSettings] -ScrollX -DisablePaging -AllProperties -Title $Key
|
||||
}
|
||||
}
|
||||
} else {
|
||||
New-HTMLTable -DataTable $Output[$GPOCategory] -ScrollX -DisablePaging -AllProperties -Title $Key
|
||||
}
|
||||
}
|
||||
}
|
||||
} -Online -ShowHTML -FilePath $Env:UserProfile\Desktop\OutputFromFindGPO-NoTranslation.html
|
||||
@@ -1,19 +0,0 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
$Output = Invoke-GPOZaurr #-NoTranslation
|
||||
|
||||
New-HTML {
|
||||
foreach ($GPOCategory in $Output.Keys) {
|
||||
New-HTMLTab -Name $GPOCategory {
|
||||
if ($Output["$GPOCategory"] -is [System.Collections.IDictionary]) {
|
||||
foreach ($GpoSettings in $Output["$GPOCategory"].Keys) {
|
||||
New-HTMLTab -Name $GpoSettings {
|
||||
New-HTMLTable -DataTable $Output[$GPOCategory][$GpoSettings] -ScrollX -DisablePaging -AllProperties -Title $Key
|
||||
}
|
||||
}
|
||||
} else {
|
||||
New-HTMLTable -DataTable $Output[$GPOCategory] -ScrollX -DisablePaging -AllProperties -Title $Key
|
||||
}
|
||||
}
|
||||
}
|
||||
} -Online -ShowHTML -FilePath $Env:UserProfile\Desktop\OutputFromFindGPO.html
|
||||
@@ -0,0 +1,12 @@
|
||||
#Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# Asses GPO based on exported data
|
||||
$Output = Invoke-GPOZaurr -GPOPath $Env:USERPROFILE\Desktop\GPOExport -Verbose
|
||||
#$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportTest' -Verbose
|
||||
$Output | Format-Table *
|
||||
|
||||
# Export to Excel
|
||||
foreach ($Key in $Output.Reports.Keys) {
|
||||
$Output.Reports[$Key] | ConvertTo-Excel -FilePath $Env:USERPROFILE\Desktop\EFGPOAnalysis.xlsx -ExcelWorkSheetName $Key -AutoFilter -AutoFit -FreezeTopRowFirstColumn
|
||||
}
|
||||
Start-Process "$Env:USERPROFILE\Desktop\EFGPOAnalysis.xlsx"
|
||||
@@ -0,0 +1,18 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
$Output = Invoke-GPOZaurr
|
||||
$Output | Format-Table
|
||||
|
||||
# Report to Excel of translated reports
|
||||
foreach ($Key in $Output.Reports.Keys) {
|
||||
$Output.Reports[$Key] | ConvertTo-Excel -FilePath $Env:USERPROFILE\Desktop\GPOAnalysis.xlsx -ExcelWorkSheetName $Key -AutoFilter -AutoFit -FreezeTopRowFirstColumn
|
||||
}
|
||||
|
||||
# Report to HTML of translated reports
|
||||
New-HTML {
|
||||
foreach ($Key in $Output.Reports.Keys) {
|
||||
New-HTMLTab -Name $Key {
|
||||
New-HTMLTable -DataTable $Output.Reports[$Key] -Filtering
|
||||
}
|
||||
}
|
||||
} -FilePath $Env:USERPROFILE\Desktop\GPOAnalysis.html -ShowHTML -Online
|
||||
@@ -0,0 +1,8 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# 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-GPOZaurr -SingleObject
|
||||
$Output | Format-Table
|
||||
$Output.Reports.RegistrySettings | Format-Table *
|
||||
$Output.Reports.RegistrySettings[0].Settings | Format-Table *
|
||||
@@ -0,0 +1,13 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# Use Save-GPOZaurrFiles -GPOPath $ENV:USERPROFILE\Desktop\GPOExportAudit
|
||||
$Output = Invoke-GPOZaurr -GPOPath $ENV:USERPROFILE\Desktop\GPOExportAudit -Verbose #-SkipCleanup #-Type PoliciesPrinters, Policies
|
||||
$Output | Format-Table *
|
||||
|
||||
$Output.Reports | Format-Table
|
||||
|
||||
# Export to Excel
|
||||
foreach ($Key in $Output.Reports.Keys) {
|
||||
$Output.Reports[$Key] | ConvertTo-Excel -FilePath $Env:USERPROFILE\Desktop\GPOAnalysis.xlsx -ExcelWorkSheetName $Key -AutoFilter -AutoFit -FreezeTopRowFirstColumn
|
||||
}
|
||||
Start-Process "$Env:USERPROFILE\Desktop\GPOAnalysis.xlsx"
|
||||
@@ -1,25 +0,0 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# Use Save-GPOZaurrFiles -GPOPath $ENV:USERPROFILE\Desktop\GPOExport
|
||||
|
||||
$OutputTranslation = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExport'
|
||||
$OutputTranslation | Format-Table
|
||||
$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExport' -NoTranslation
|
||||
$Output | Format-Table *
|
||||
|
||||
#$Output.LugsSettings.LocalUsersAndGroups | Format-List *
|
||||
|
||||
$GPOEntry = $Output.LugsSettings.LocalUsersAndGroups[0]
|
||||
|
||||
$CreateGPO = @{}
|
||||
foreach ($User in $GPOEntry.User) {
|
||||
# $User | Format-Table
|
||||
# $User.Properties | Format-Table
|
||||
}
|
||||
|
||||
|
||||
foreach ($Group in $GPOEntry.Group) {
|
||||
#$Group | Format-Table
|
||||
$Group.Properties | Format-Table
|
||||
$Group.Properties.Members | Format-Table
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# Use Save-GPOZaurrFiles -GPOPath $ENV:USERPROFILE\Desktop\GPOExport
|
||||
|
||||
$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportTest' -NoTranslation
|
||||
$Output | Format-Table *
|
||||
@@ -1,11 +0,0 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# This is purely for building GPO Dictionary, mostly for development needs to help asses what is there
|
||||
|
||||
$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportTest' -NoTranslation
|
||||
#$Output | Format-Table *
|
||||
|
||||
$LookingFor = $Output | Select-GPOTranslation -Category 'SecuritySettings' -Settings 'UserRightsAssignment'
|
||||
$LookingFor | Format-Table
|
||||
$LookingFor.Types | Format-Table
|
||||
#$LookingFor.Data | Format-Table
|
||||
@@ -0,0 +1,4 @@
|
||||
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
|
||||
@@ -0,0 +1,6 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
$Policies = Get-GPOZaurrFilesPolicyDefinitions -Signature
|
||||
$Policies | Format-Table
|
||||
#$Policies.FilesToDelete | Format-Table *
|
||||
$Policies['ad.evotec.xyz'] | Format-Table *
|
||||
@@ -0,0 +1,7 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# Report on empty folders
|
||||
Get-GPOZaurrFolders -FolderType Empty | Format-Table *
|
||||
|
||||
# ! NOT READY FOR EMPTY
|
||||
#Remove-GPOZaurrFolders -FolderType Empty -Verbose -BackupPath $Env:USERPROFILE\Desktop\SomeBackup1 -WhatIf
|
||||
@@ -0,0 +1,7 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# Report on NTFRS folders
|
||||
Get-GPOZaurrFolders -FolderType NTFRS | Format-Table *
|
||||
|
||||
# Remove NTFRS (broken replication folders)
|
||||
Remove-GPOZaurrFolders -FolderType NTFRS -Verbose -BackupPath $Env:USERPROFILE\Desktop\SomeBackup -WhatIf
|
||||
@@ -0,0 +1,10 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
# Cleanup based on https://techcommunity.microsoft.com/t5/ask-the-directory-services-team/manually-clearing-the-conflictanddeleted-folder-in-dfsr/ba-p/395711
|
||||
|
||||
# Get dfsr information
|
||||
$DFSR = Get-GPOZaurrSysvolDFSR
|
||||
$DFSR | Format-Table
|
||||
|
||||
# Cleanup DFSR Conflict Path
|
||||
Clear-GPOZaurrSysvolDFSR -WhatIf
|
||||
+5
-5
@@ -4,10 +4,10 @@
|
||||
CompanyName = 'Evotec'
|
||||
CompatiblePSEditions = 'Desktop'
|
||||
Copyright = '(c) 2011 - 2020 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 easy fixing for issues that you may expect finding in them.'
|
||||
FunctionsToExport = 'Add-GPOPermission', 'Add-GPOZaurrPermission', 'Backup-GPOZaurr', 'Get-GPOZaurr', 'Get-GPOZaurrAD', 'Get-GPOZaurrBackupInformation', 'Get-GPOZaurrFiles', 'Get-GPOZaurrLegacyFiles', 'Get-GPOZaurrLink', 'Get-GPOZaurrLinkSummary', 'Get-GPOZaurrOwner', 'Get-GPOZaurrPassword', 'Get-GPOZaurrPermission', 'Get-GPOZaurrPermissionConsistency', 'Get-GPOZaurrSysvol', 'Get-WMIFilter', 'Get-GPOZaurrWMI', 'Invoke-GPOZaurr', 'Invoke-GPOZaurrPermission', 'New-GPOZaurrWMI', 'Remove-GPOPermission', 'Remove-GPOZaurr', 'Remove-GPOZaurrLegacyFiles', 'Remove-GPOZaurrOrphanedSysvolFolders', 'Remove-GPOZaurrPermission', 'Remove-GPOZaurrWMI', 'Repair-GPOZaurrPermissionConsistency', 'Restore-GPOZaurr', 'Save-GPOZaurrFiles', 'Select-GPOTranslation', 'Set-GPOOwner', 'Set-GPOZaurrOwner'
|
||||
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', 'Get-GPOZaurr', 'Get-GPOZaurrAD', 'Get-GPOZaurrBackupInformation', 'Get-GPOZaurrFiles', 'Get-GPOZaurrFilesPolicyDefinitions', 'Get-GPOZaurrFolders', 'Get-GPOZaurrLegacyFiles', 'Get-GPOZaurrLink', 'Get-GPOZaurrLinkSummary', 'Get-GPOZaurrOwner', 'Get-GPOZaurrPassword', 'Get-GPOZaurrPermission', 'Get-GPOZaurrPermissionConsistency', 'Get-GPOZaurrSysvol', 'Get-GPOZaurrSysvolDFSR', 'Get-GPOZaurrWMI', 'Invoke-GPOZaurr', 'Invoke-GPOZaurrPermission', 'New-GPOZaurrWMI', 'Remove-GPOPermission', 'Remove-GPOZaurr', 'Remove-GPOZaurrFolders', 'Remove-GPOZaurrLegacyFiles', 'Remove-GPOZaurrOrphanedSysvolFolders', 'Remove-GPOZaurrPermission', 'Remove-GPOZaurrWMI', 'Repair-GPOZaurrPermissionConsistency', 'Restore-GPOZaurr', 'Save-GPOZaurrFiles', 'Set-GPOOwner', 'Set-GPOZaurrOwner'
|
||||
GUID = 'f7d4c9e4-0298-4f51-ad77-e8e3febebbde'
|
||||
ModuleVersion = '0.0.46'
|
||||
ModuleVersion = '0.0.51'
|
||||
PowerShellVersion = '5.1'
|
||||
PrivateData = @{
|
||||
PSData = @{
|
||||
@@ -17,11 +17,11 @@
|
||||
}
|
||||
}
|
||||
RequiredModules = @{
|
||||
ModuleVersion = '0.0.155'
|
||||
ModuleVersion = '0.0.165'
|
||||
ModuleName = 'PSSharedGoods'
|
||||
Guid = 'ee272aa8-baaa-4edf-9f45-b6d6f7d844fe'
|
||||
}, @{
|
||||
ModuleVersion = '0.0.58'
|
||||
ModuleVersion = '0.0.65'
|
||||
ModuleName = 'ADEssentials'
|
||||
Guid = '9fc9fd61-7f11-4f4b-a527-084086f1905f'
|
||||
}, 'ActiveDirectory', 'GroupPolicy', 'CimCmdlets', 'Microsoft.PowerShell.Management', 'Microsoft.PowerShell.Utility'
|
||||
|
||||
@@ -1,31 +0,0 @@
|
||||
# TODO: #2 Identical to ConvertTo-EventLog - decide what to do later on
|
||||
|
||||
function ConvertTo-AccountPolicies {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
Type = $GPOEntry.Type
|
||||
Policy = $GPOEntry.Name
|
||||
|
||||
}
|
||||
if ($GPOEntry.SettingBoolean) {
|
||||
$CreateGPO['Setting'] = if ($GPOEntry.SettingBoolean -eq 'true') { 'Enabled' } elseif ($GPOEntry.SettingBoolean -eq 'false') { 'Disabled' } else { $null };
|
||||
#try { [bool]::Parse($GPOEntry.SettingBoolean) } catch { $null };
|
||||
} elseif ($GPOEntry.SettingNumber) {
|
||||
$CreateGPO['Setting'] = $GPOEntry.SettingNumber
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
function ConvertTo-EventLog {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
Type = $GPOEntry.Type
|
||||
Policy = $GPOEntry.Name
|
||||
|
||||
}
|
||||
if ($GPOEntry.SettingBoolean) {
|
||||
$CreateGPO['Setting'] = if ($GPOEntry.SettingBoolean -eq 'true') { 'Enabled' } elseif ($GPOEntry.SettingBoolean -eq 'false') { 'Disabled' } else { $null };
|
||||
#try { [bool]::Parse($GPOEntry.SettingBoolean) } catch { $null };
|
||||
} elseif ($GPOEntry.SettingNumber) {
|
||||
$CreateGPO['Setting'] = $GPOEntry.SettingNumber
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
function ConvertTo-LocalUserAndGroups {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
foreach ($User in $GPOEntry.User) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
Changed = [DateTime] $User.Changed
|
||||
GPOSettingOrder = $User.GPOSettingOrder
|
||||
UserAction = $Script:Actions["$($User.Properties.action)"] #: U
|
||||
UserNewName = $User.Properties.newName #:
|
||||
UserFullName = $User.Properties.fullName #:
|
||||
UserDescription = $User.Properties.description #:
|
||||
UserCpassword = $User.Properties.cpassword #:
|
||||
UserChangeLogon = $User.Properties.changeLogon #: 0
|
||||
UserNoChange = $User.Properties.noChange #: 0
|
||||
UserNeverExpires = $User.Properties.neverExpires #: 0
|
||||
UserAcctDisabled = $User.Properties.acctDisabled #: 0
|
||||
UserAubAuthority = $User.Properties.subAuthority #: RID_ADMIN
|
||||
UserUserName = $User.Properties.userName #: Administrator (built-in)
|
||||
UserMembers = $User.Properties.Members #:
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
foreach ($Group in $GPOEntry.Group) {
|
||||
# We're mostly interested in Members
|
||||
[Array] $Members = foreach ($Member in $Group.Properties.Members.Member) {
|
||||
[ordered] @{
|
||||
MemberName = $Member.Name
|
||||
MemberAction = $Member.Action
|
||||
MemberSID = $Member.SID
|
||||
}
|
||||
}
|
||||
# if we have no members we create dummy object to make sure we can use foreach below
|
||||
if ($Members.Count -eq 0) {
|
||||
$Members = @(
|
||||
[ordered] @{
|
||||
MemberName = $null
|
||||
MemberAction = $null
|
||||
MemberSID = $null
|
||||
}
|
||||
)
|
||||
}
|
||||
foreach ($Member in $Members) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
Changed = [DateTime] $Group.Changed
|
||||
GPOSettingOrder = $Group.GPOSettingOrder
|
||||
GroupUid = $Group.uid #: {8F435B0A-CD15-464E-85F3-B6A55B9E816A}: {8F435B0A-CD15-464E-85F3-B6A55B9E816A}
|
||||
GroupUserContext = $Group.userContext #: 0: 0
|
||||
GroupRemovePolicy = $Group.removePolicy #: 1: 1
|
||||
#Properties = $Group.Properties #: Properties: Properties
|
||||
Filters = $Group.Filters #::
|
||||
|
||||
GroupAction = $Script:Actions["$($Group.Properties.action)"] #: U
|
||||
GroupNewName = $Group.Properties.newName #:
|
||||
GroupDescription = $Group.Properties.description #:
|
||||
GroupDeleteAllUsers = $Group.Properties.deleteAllUsers #: 0
|
||||
GroupDeleteAllGroups = $Group.Properties.deleteAllGroups #: 0
|
||||
GroupRemoveAccounts = $Group.Properties.removeAccounts #: 1
|
||||
GroupSid = $Group.Properties.groupSid #: S - 1 - 5 - 32 - 544
|
||||
GroupName = $Group.Properties.groupName #: Administrators (built -in )
|
||||
}
|
||||
# Merging GPO with Member
|
||||
$CreateGPO = $CreateGPO + $Member
|
||||
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
function ConvertTo-Policies {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
PolicyName = $GPOEntry.Name
|
||||
PolicyState = $GPOEntry.State
|
||||
PolicyCategory = $GPOEntry.Category
|
||||
PolicySupported = $GPOEntry.Supported
|
||||
PolicyExplain = $GPOEntry.Explain
|
||||
PolicyText = $GPOEntry.Text
|
||||
PolicyCheckBox = $GPOEntry.CheckBox
|
||||
PolicyDropDownList = $GPOEntry.DropDownList
|
||||
PolicyEditText = $GPOEntry.EditText
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
function ConvertTo-RegistryAutologon {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
AutoAdminLogon = $null
|
||||
DefaultDomainName = $null
|
||||
DefaultUserName = $null
|
||||
DefaultPassword = $null
|
||||
}
|
||||
|
||||
foreach ($Registry in $GPOEntry.Registry) {
|
||||
if ($Registry.Properties.Key -eq 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon') {
|
||||
if ($Registry.Properties.Name -eq 'AutoAdminLogon') {
|
||||
$CreateGPO['AutoAdminLogon'] = [bool] $Registry.Properties.value
|
||||
$CreateGPO['DateChangedAutoAdminLogon'] = [DateTime] $Registry.changed
|
||||
} elseif ($Registry.Properties.Name -eq 'DefaultDomainName') {
|
||||
$CreateGPO['DefaultDomainName'] = $Registry.Properties.value
|
||||
$CreateGPO['DateChangedDefaultDomainName'] = [DateTime] $Registry.changed
|
||||
} elseif ($Registry.Properties.Name -eq 'DefaultUserName') {
|
||||
$CreateGPO['DefaultUserName'] = $Registry.Properties.value
|
||||
$CreateGPO['DateChangedDefaultUserName'] = [DateTime] $Registry.changed
|
||||
} elseif ($Registry.Properties.Name -eq 'DefaultPassword') {
|
||||
$CreateGPO['DefaultPassword'] = $Registry.Properties.value
|
||||
$CreateGPO['DateChangedDefaultPassword'] = [DateTime] $Registry.changed
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($null -ne $CreateGPO['AutoAdminLogon'] -or
|
||||
$null -ne $CreateGPO['DefaultDomainName'] -or
|
||||
$null -ne $CreateGPO['DefaultUserName'] -or
|
||||
$null -ne $CreateGPO['DefaultPassword']
|
||||
) {
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
function ConvertTo-RegistrySettings {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
foreach ($Registry in $GPOEntry.Registry) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
Changed = [DateTime] $Registry.changed
|
||||
GPOSettingOrder = $Registry.GPOSettingOrder
|
||||
Hive = $Registry.Properties.hive #: HKEY_LOCAL_MACHINE
|
||||
Key = $Registry.Properties.key #: SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
|
||||
Name = $Registry.Properties.name #: AutoAdminLogon
|
||||
Type = $Registry.Properties.type #: REG_SZ
|
||||
Value = $Registry.Properties.value #
|
||||
Filters = $Registry.Filters
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
function ConvertTo-RegistrySettingsCollection {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
foreach ($Collection in $GPOEntry.Collection) {
|
||||
$OutputDictionaries = foreach ($Registry in $Collection.Registry) {
|
||||
[ordered] @{
|
||||
#"$($Registry.Name)FieldName" = $Registry.Name
|
||||
#"$($Registry.Name)FieldStatus" = $Registry.Status
|
||||
"$($Registry.Name)BypassErrors" = try { [bool]::Parse($Registry.BypassErrors) } catch { $null };
|
||||
"$($Registry.Name)Changed" = [DateTime] $Registry.Changed
|
||||
"$($Registry.Name)UID" = $Registry.UID
|
||||
"$($Registry.Name)GPOSettingOrder" = $Registry.GPOSettingOrder
|
||||
"$($Registry.Name)Action" = $Registry.Properties.action
|
||||
"$($Registry.Name)DisplayDecimal" = $Registry.Properties.displayDecimal
|
||||
"$($Registry.Name)Default" = $Registry.Properties.default
|
||||
"$($Registry.Name)Hive" = $Registry.Properties.hive
|
||||
"$($Registry.Name)Name" = $Registry.Properties.name
|
||||
"$($Registry.Name)Type" = $Registry.Properties.type
|
||||
"$($Registry.Name)Value" = $Registry.Properties.value
|
||||
"$($Registry.Name)Values" = $Registry.Properties.Values
|
||||
}
|
||||
}
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
}
|
||||
foreach ($Dictionary in $OutputDictionaries) {
|
||||
$CreateGPO = $CreateGPO + $Dictionary
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
function ConvertTo-Scripts {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
Command = $GPOEntry.Command
|
||||
Parameters = $GPOEntry.Parameters
|
||||
Type = $GPOEntry.Type
|
||||
Order = $GPOEntry.Order
|
||||
RunOrder = $GPOEntry.RunOrder
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
function ConvertTo-SecurityOptions {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
KeyName = $GPOEntry.KeyName
|
||||
KeyDisplayName = $GPOEntry.Display.Name
|
||||
KeyDisplayUnits = $GPOEntry.Display.Units
|
||||
KeyDisplayBoolean = try { [bool]::Parse($GPOEntry.Display.DisplayBoolean) } catch { $null };
|
||||
KeyDisplayString = $GPOEntry.Display.DisplayString
|
||||
SystemAccessPolicyName = $GPOEntry.SystemAccessPolicyName
|
||||
SettingString = $GPOEntry.SettingString
|
||||
SettingNumber = $GPOEntry.SettingNumber
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
function ConvertTo-SoftwareInstallation {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
Identifier = $GPOEntry.Identifier #: { 10495e9e-79c1-4a32-b278-a24cd495437f }
|
||||
Name = $GPOEntry.Name #: Local Administrator Password Solution (2)
|
||||
Path = $GPOEntry.Path #: \\area1.local\SYSVOL\area1.local\Policies\ { 5F5042A0-008F-45E3-8657-79C87BD002E3 }\LAPS.x64.msi
|
||||
MajorVersion = $GPOEntry.MajorVersion #: 6
|
||||
MinorVersion = $GPOEntry.MinorVersion #: 2
|
||||
LanguageId = $GPOEntry.LanguageId #: 1033
|
||||
Architecture = $GPOEntry.Architecture #: 9
|
||||
IgnoreLanguage = if ($GPOEntry.IgnoreLanguage -eq 'true') { $true } else { $false } #: false
|
||||
Allowx86Onia64 = if ($GPOEntry.Allowx86Onia64 -eq 'true') { $true } else { $false } #: true
|
||||
SupportURL = $GPOEntry.SupportURL #:
|
||||
AutoInstall = if ($GPOEntry.AutoInstall -eq 'true') { $true } else { $false } #: true
|
||||
DisplayInARP = if ($GPOEntry.DisplayInARP -eq 'true') { $true } else { $false } #: true
|
||||
IncludeCOM = if ($GPOEntry.IncludeCOM -eq 'true') { $true } else { $false } #: true
|
||||
SecurityDescriptor = $GPOEntry.SecurityDescriptor #: SecurityDescriptor
|
||||
DeploymentType = $GPOEntry.DeploymentType #: Assign
|
||||
ProductId = $GPOEntry.ProductId #: { ea8cb806-c109 - 4700 - 96b4-f1f268e5036c }
|
||||
ScriptPath = $GPOEntry.ScriptPath #: \\area1.local\SysVol\area1.local\Policies\ { 5F5042A0-008F-45E3-8657-79C87BD002E3 }\Machine\Applications\ { EAC9B821-FB4D - 457A-806F-E5B528D1E41A }.aas
|
||||
DeploymentCount = $GPOEntry.DeploymentCount #: 0
|
||||
InstallationUILevel = $GPOEntry.InstallationUILevel #: Maximum
|
||||
Upgrades = if ($GPOEntry.Upgrades.Mandatory -eq 'true') { $true } else { $false } #: Upgrades
|
||||
UninstallUnmanaged = if ($GPOEntry.UninstallUnmanaged -eq 'true') { $true } else { $false } #: false
|
||||
LossOfScopeAction = $GPOEntry.LossOfScopeAction #: Unmanage
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
function ConvertTo-SystemServices {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
ServiceName = $GPOEntry.Name
|
||||
ServiceStartUpMode = $GPOEntry.StartUpMode
|
||||
SecurityAuditingPresent = try { [bool]::Parse($GPOEntry.SecurityDescriptor.AuditingPresent.'#text') } catch { $null };
|
||||
SecurityPermissionsPresent = try { [bool]::Parse($GPOEntry.SecurityDescriptor.PermissionsPresent.'#text') } catch { $null };
|
||||
SecurityDescriptor = $GPOEntry.SecurityDescriptor
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
function ConvertTo-SystemServicesNT {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $GPOList
|
||||
)
|
||||
foreach ($GPOEntry in $GPOList) {
|
||||
foreach ($Service in $GPOEntry.NTService) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPOEntry.DisplayName #: WO_SEC_NTLM_Auth_Level
|
||||
DomainName = $GPOEntry.DomainName #: area1.local
|
||||
GUID = $GPOEntry.GUID #: 364B095E-C7BF-4CC1-9BFA-393BD38975E5
|
||||
GpoType = $GPOEntry.GpoType #: Computer
|
||||
GpoCategory = $GPOEntry.GpoCategory #: SecuritySettings
|
||||
GpoSettings = $GPOEntry.GpoSettings #: SecurityOptions
|
||||
Changed = [DateTime] $Service.Changed
|
||||
GPOSettingOrder = $Service.GPOSettingOrder
|
||||
#ServiceName = $Service.Name
|
||||
ServiceName = $Service.Properties.serviceName #: AppIDSvc: AppIDSvc
|
||||
ServiceStartupType = $Service.Properties.startupType #: NOCHANGE: NOCHANGE
|
||||
ServiceAction = $Service.Properties.serviceAction #: START: START
|
||||
Timeout = $Service.Properties.timeout #: 50: 50
|
||||
FirstFailure = $Service.Properties.firstFailure #: REBOOT: REBOOT
|
||||
SecondFailure = $Service.Properties.secondFailure #: REBOOT: REBOOT
|
||||
ThirdFailure = $Service.Properties.thirdFailure #: REBOOT: REBOOT
|
||||
ResetFailCountDelay = $Service.Properties.resetFailCountDelay #: 0: 0
|
||||
RestartComputerDelay = $Service.Properties.restartComputerDelay #: 60000: 60000
|
||||
Filter = $Service.Filter
|
||||
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
function ConvertTo-XMLAccountPolicy {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
)
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
ClearTextPassword = 'Not Set'
|
||||
LockoutBadCount = 'Not Set'
|
||||
LockoutDuration = 'Not Set'
|
||||
MaximumPasswordAge = 'Not Set'
|
||||
MinimumPasswordAge = 'Not Set'
|
||||
MinimumPasswordLength = 'Not Set'
|
||||
PasswordComplexity = 'Not Set'
|
||||
PasswordHistorySize = 'Not Set'
|
||||
ResetLockoutCount = 'Not Set'
|
||||
MaxClockSkew = 'Not Set'
|
||||
MaxRenewAge = 'Not Set'
|
||||
MaxServiceAge = 'Not Set'
|
||||
MaxTicketAge = 'Not Set'
|
||||
TicketValidateClient = 'Not Set'
|
||||
}
|
||||
foreach ($GPOEntry in $GPO.DataSet) {
|
||||
if ($GPOEntry.SettingBoolean) {
|
||||
$CreateGPO[$($GPOEntry.Name)] = if ($GPOEntry.SettingBoolean -eq 'true') { 'Enabled' } elseif ($GPOEntry.SettingBoolean -eq 'false') { 'Disabled' } else { 'Not set' };
|
||||
} elseif ($GPOEntry.SettingNumber) {
|
||||
$CreateGPO[$($GPOEntry.Name)] = [int] $GPOEntry.SettingNumber
|
||||
}
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
function ConvertTo-XMLAudit {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
[switch] $FullObject
|
||||
)
|
||||
$SettingType = @{
|
||||
'0' = 'No Auditing'
|
||||
'1' = 'Success'
|
||||
'2' = 'Failure'
|
||||
'3' = 'Success, Failure'
|
||||
}
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
AuditAccountLogon = 'Not configured'
|
||||
AuditAccountManage = 'Not configured'
|
||||
AuditDSAccess = 'Not configured'
|
||||
AuditLogonEvents = 'Not configured'
|
||||
AuditObjectAccess = 'Not configured'
|
||||
AuditPolicyChange = 'Not configured'
|
||||
AuditPrivilegeUse = 'Not configured'
|
||||
AuditProcessTracking = 'Not configured'
|
||||
AuditSystemEvents = 'Not configured'
|
||||
# Advanced Policies
|
||||
AuditAccountLockout = 'Not configured'
|
||||
AuditApplicationGenerated = 'Not configured'
|
||||
AuditApplicationGroupManagement = 'Not configured'
|
||||
AuditAuditPolicyChange = 'Not configured'
|
||||
AuditAuthenticationPolicyChange = 'Not configured'
|
||||
AuditAuthorizationPolicyChange = 'Not configured'
|
||||
AuditCentralAccessPolicyStaging = 'Not configured'
|
||||
AuditCertificationServices = 'Not configured'
|
||||
AuditComputerAccountManagement = 'Not configured'
|
||||
AuditCredentialValidation = 'Not configured'
|
||||
AuditDetailedDirectoryServiceReplication = 'Not configured'
|
||||
AuditDetailedFileShare = 'Not configured'
|
||||
AuditDirectoryServiceAccess = 'Not configured'
|
||||
AuditDirectoryServiceChanges = 'Not configured'
|
||||
AuditDirectoryServiceReplication = 'Not configured'
|
||||
AuditDistributionGroupManagement = 'Not configured'
|
||||
AuditDPAPIActivity = 'Not configured'
|
||||
AuditFileShare = 'Not configured'
|
||||
AuditFileSystem = 'Not configured'
|
||||
AuditFilteringPlatformConnection = 'Not configured'
|
||||
AuditFilteringPlatformPacketDrop = 'Not configured'
|
||||
AuditFilteringPlatformPolicyChange = 'Not configured'
|
||||
AuditGroupMembership = 'Not configured'
|
||||
AuditHandleManipulation = 'Not configured'
|
||||
AuditIPsecDriver = 'Not configured'
|
||||
AuditIPsecExtendedMode = 'Not configured'
|
||||
AuditIPsecMainMode = 'Not configured'
|
||||
AuditIPsecQuickMode = 'Not configured'
|
||||
AuditKerberosAuthenticationService = 'Not configured'
|
||||
AuditKerberosServiceTicketOperations = 'Not configured'
|
||||
AuditKernelObject = 'Not configured'
|
||||
AuditLogoff = 'Not configured'
|
||||
AuditLogon = 'Not configured'
|
||||
AuditMPSSVCRuleLevelPolicyChange = 'Not configured'
|
||||
AuditNetworkPolicyServer = 'Not configured'
|
||||
AuditNonSensitivePrivilegeUse = 'Not configured'
|
||||
AuditOtherAccountLogonEvents = 'Not configured'
|
||||
AuditOtherAccountManagementEvents = 'Not configured'
|
||||
AuditOtherLogonLogoffEvents = 'Not configured'
|
||||
AuditOtherObjectAccessEvents = 'Not configured'
|
||||
AuditOtherPolicyChangeEvents = 'Not configured'
|
||||
AuditOtherPrivilegeUseEvents = 'Not configured'
|
||||
AuditOtherSystemEvents = 'Not configured'
|
||||
AuditPNPActivity = 'Not configured'
|
||||
AuditProcessCreation = 'Not configured'
|
||||
AuditProcessTermination = 'Not configured'
|
||||
AuditRegistry = 'Not configured'
|
||||
AuditRemovableStorage = 'Not configured'
|
||||
AuditRPCEvents = 'Not configured'
|
||||
AuditSAM = 'Not configured'
|
||||
AuditSecurityGroupManagement = 'Not configured'
|
||||
AuditSecurityStateChange = 'Not configured'
|
||||
AuditSecuritySystemExtension = 'Not configured'
|
||||
AuditSensitivePrivilegeUse = 'Not configured'
|
||||
AuditSpecialLogon = 'Not configured'
|
||||
AuditSystemIntegrity = 'Not configured'
|
||||
AuditUserDeviceClaims = 'Not configured'
|
||||
AuditUserAccountManagement = 'Not configured'
|
||||
}
|
||||
foreach ($GPOEntry in $GPO.DataSet) {
|
||||
if ($GPOEntry.PolicyTarget) {
|
||||
# Category = 'AuditSettings', Settings = 'AuditSetting'
|
||||
$Category = $GPOEntry.SubcategoryName -replace ' ', '' -replace '-', '' -replace '/', ''
|
||||
if ($CreateGPO["$($Category)"]) {
|
||||
$CreateGPO["$($Category)"] = $SettingType["$($GPOEntry.SettingValue)"]
|
||||
}
|
||||
} else {
|
||||
# Category = 'SecuritySettings', Settings = 'Audit'
|
||||
$SuccessAttempts = try { [bool]::Parse($GPOEntry.SuccessAttempts) } catch { $null };
|
||||
$FailureAttempts = try { [bool]::Parse($GPOEntry.FailureAttempts) } catch { $null };
|
||||
if ($SuccessAttempts -and $FailureAttempts) {
|
||||
$Setting = 'Success, Failure'
|
||||
} elseif ($SuccessAttempts) {
|
||||
$Setting = 'Success'
|
||||
} elseif ($FailureAttempts) {
|
||||
$Setting = 'Failure'
|
||||
} else {
|
||||
$Setting = 'Not configured'
|
||||
}
|
||||
$CreateGPO["$($GPOEntry.Name)"] = $Setting
|
||||
}
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
function ConvertTo-XMLDriveMapSettings {
|
||||
[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 ($Entry in $GPO.DataSet.Drive) {
|
||||
[PSCustomObject] @{
|
||||
Changed = [DateTime] $Entry.changed
|
||||
#uid = $Entry.uid
|
||||
GPOSettingOrder = $Entry.GPOSettingOrder
|
||||
Filter = $Entry.Filter
|
||||
|
||||
Name = $Entry.Name
|
||||
Status = $Entry.status
|
||||
Action = $Script:Actions["$($Entry.Properties.action)"]
|
||||
ThisDrive = $Entry.Properties.thisDrive
|
||||
AllDrives = $Entry.Properties.allDrives
|
||||
UserName = $Entry.Properties.userName
|
||||
Path = $Entry.Properties.path
|
||||
Label = $Entry.Properties.label
|
||||
Persistent = if ($Entry.Properties.persistent -eq '1') { $true } elseif ($Entry.Properties.persistent -eq '0') { $false } else { $Entry.Properties.persistent };
|
||||
UseLetter = if ($Entry.Properties.useLetter -eq '1') { $true } elseif ($Entry.Properties.useLetter -eq '0') { $false } else { $Entry.Properties.useLetter };
|
||||
Letter = $Entry.Properties.letter
|
||||
}
|
||||
}
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($Entry in $GPO.DataSet.Drive) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
Changed = [DateTime] $Entry.changed
|
||||
#uid = $Entry.uid
|
||||
GPOSettingOrder = $Entry.GPOSettingOrder
|
||||
Filter = $Entry.Filter
|
||||
|
||||
Name = $Entry.Name
|
||||
Status = $Entry.status
|
||||
Action = $Script:Actions["$($Entry.Properties.action)"]
|
||||
ThisDrive = $Entry.Properties.thisDrive
|
||||
AllDrives = $Entry.Properties.allDrives
|
||||
UserName = $Entry.Properties.userName
|
||||
Path = $Entry.Properties.path
|
||||
Label = $Entry.Properties.label
|
||||
Persistent = if ($Entry.Properties.persistent -eq '1') { $true } elseif ($Entry.Properties.persistent -eq '0') { $false } else { $Entry.Properties.persistent };
|
||||
UseLetter = if ($Entry.Properties.useLetter -eq '1') { $true } elseif ($Entry.Properties.useLetter -eq '0') { $false } else { $Entry.Properties.useLetter };
|
||||
Letter = $Entry.Properties.letter
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
function ConvertTo-XMLEventLog {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
)
|
||||
$RetionPeriod = @{
|
||||
'0' = 'Overwrite events as needed'
|
||||
'1' = 'Overwrite events by days'
|
||||
'2' = 'Do not overwrite events (Clear logs manually)'
|
||||
}
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
ApplicationAuditLogRetentionPeriod = $null
|
||||
ApplicationMaximumLogSize = $null
|
||||
ApplicationRestrictGuestAccess = $null
|
||||
ApplicationRetentionDays = $null
|
||||
SystemAuditLogRetentionPeriod = $null
|
||||
SystemMaximumLogSize = $null
|
||||
SystemRestrictGuestAccess = $null
|
||||
SystemRetentionDays = $null
|
||||
SecurityAuditLogRetentionPeriod = $null
|
||||
SecurityMaximumLogSize = $null
|
||||
SecurityRestrictGuestAccess = $null
|
||||
SecurityRetentionDays = $null
|
||||
}
|
||||
foreach ($GPOEntry in $GPO.DataSet) {
|
||||
if ($GPOEntry.SettingBoolean) {
|
||||
$CreateGPO["$($GPOEntry.Log)$($GPOEntry.Name)"] = if ($GPOEntry.SettingBoolean -eq 'true') { 'Enabled' } elseif ($GPOEntry.SettingBoolean -eq 'false') { 'Disabled' } else { 'Not set' };
|
||||
} elseif ($GPOEntry.SettingNumber) {
|
||||
if ($GPOEntry.Name -eq 'AuditLogRetentionPeriod') {
|
||||
if ($GPOEntry.SettingNumber) {
|
||||
$CreateGPO["$($GPOEntry.Log)$($GPOEntry.Name)"] = $RetionPeriod[$($GPOEntry.SettingNumber)]
|
||||
} else {
|
||||
# Won't happen?
|
||||
$CreateGPO["$($GPOEntry.Log)$($GPOEntry.Name)"] = $GPOEntry.SettingNumber
|
||||
}
|
||||
} else {
|
||||
$CreateGPO["$($GPOEntry.Log)$($GPOEntry.Name)"] = $GPOEntry.SettingNumber
|
||||
}
|
||||
}
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
function ConvertTo-XMLGenericPolicy {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
[string[]] $Category
|
||||
)
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
}
|
||||
$UsedNames = [System.Collections.Generic.List[string]]::new()
|
||||
|
||||
[Array] $Policies = foreach ($Cat in $Category) {
|
||||
$GPO.DataSet | Where-Object { $_.Category -like $Cat }
|
||||
}
|
||||
#if ($GPO.DataSet.Category -like $Category) {
|
||||
if ($Policies.Count -gt 0) {
|
||||
foreach ($Policy in $Policies) {
|
||||
#if ($Policy.Category -notlike $Category) {
|
||||
# We check again for Category because one GPO can have multiple categories
|
||||
# First check checks GPO globally,
|
||||
# continue
|
||||
#}
|
||||
$Name = Format-ToTitleCase -Text $Policy.Name -RemoveWhiteSpace -RemoveChar ',', '-', "'", '\(', '\)', ':'
|
||||
$CreateGPO[$Name] = $Policy.State
|
||||
|
||||
foreach ($Setting in @('DropDownList', 'Numeric', 'EditText', 'Text', 'CheckBox', 'ListBox')) {
|
||||
if ($Policy.$Setting) {
|
||||
foreach ($Value in $Policy.$Setting) {
|
||||
if ($Value.Name) {
|
||||
$SubName = Format-ToTitleCase -Text $Value.Name -RemoveWhiteSpace -RemoveChar ',', '-', "'", '\(', '\)', ':'
|
||||
$SubName = -join ($Name, $SubName)
|
||||
if ($SubName -notin $UsedNames) {
|
||||
$UsedNames.Add($SubName)
|
||||
} else {
|
||||
$TimesUsed = $UsedNames | Group-Object | Where-Object { $_.Name -eq $SubName }
|
||||
$NumberToUse = $TimesUsed.Count + 1
|
||||
# We add same name 2nd and 3rd time to make sure we count properly
|
||||
$UsedNames.Add($SubName)
|
||||
# We now build property name based on amnount of times
|
||||
$SubName = -join ($SubName, "$NumberToUse")
|
||||
}
|
||||
if ($Value.Value -is [string]) {
|
||||
$CreateGPO["$SubName"] = $Value.Value
|
||||
} elseif ($Value.Value -is [System.Xml.XmlElement]) {
|
||||
|
||||
<#
|
||||
if ($null -eq $Value.Value.Name) {
|
||||
# Shouldn't happen but lets see
|
||||
Write-Verbose $Value
|
||||
} else {
|
||||
$CreateGPO["$SubName"] = $Value.Value.Name
|
||||
}
|
||||
|
||||
#>
|
||||
if ($Value.Value.Element) {
|
||||
$CreateGPO["$SubName"] = $Value.Value.Element.Data -join '; '
|
||||
} elseif ($null -eq $Value.Value.Name) {
|
||||
# Shouldn't happen but lets see
|
||||
Write-Verbose "Tracking $Value"
|
||||
} else {
|
||||
$CreateGPO["$SubName"] = $Value.Value.Name
|
||||
}
|
||||
|
||||
} elseif ($Value.State) {
|
||||
$CreateGPO["$SubName"] = $Value.State
|
||||
} elseif ($null -eq $Value.Value) {
|
||||
# This is most likely Setting 'Text
|
||||
# Do nothing, usually it's just a text to display
|
||||
#Write-Verbose "Skipping value for display because it's empty. Name: $($Value.Name)"
|
||||
} else {
|
||||
# shouldn't happen
|
||||
Write-Verbose $Value
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
#}
|
||||
}
|
||||
}
|
||||
|
||||
<# ListBox - $Value
|
||||
Name : Items to run at logon
|
||||
State : Enabled
|
||||
ExplicitValue : false
|
||||
Additive : false
|
||||
ValuePrefix :
|
||||
Value : Value
|
||||
|
||||
ListBox - $Value.Value
|
||||
|
||||
Element
|
||||
-------
|
||||
Element
|
||||
|
||||
ListBox - $Value.Value.Element
|
||||
|
||||
Data
|
||||
----
|
||||
C:\Program Files (x86)\NetPhone Client\NetPhone Client.exe
|
||||
|
||||
#>
|
||||
@@ -0,0 +1,126 @@
|
||||
function ConvertTo-XMLLocalGroups {
|
||||
[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
|
||||
}
|
||||
if (-not $GPO.DataSet.Group) {
|
||||
continue
|
||||
}
|
||||
[Array] $CreateGPO['Settings'] = foreach ($Group in $GPO.DataSet.Group) {
|
||||
# We're mostly interested in Members
|
||||
[Array] $Members = foreach ($Member in $Group.Properties.Members.Member) {
|
||||
[ordered] @{
|
||||
MemberName = $Member.Name
|
||||
MemberAction = $Member.Action
|
||||
MemberSID = $Member.SID
|
||||
}
|
||||
}
|
||||
# if we have no members we create dummy object to make sure we can use foreach below
|
||||
if ($Members.Count -eq 0) {
|
||||
$Members = @(
|
||||
[ordered] @{
|
||||
MemberName = $null
|
||||
MemberAction = $null
|
||||
MemberSID = $null
|
||||
}
|
||||
)
|
||||
}
|
||||
foreach ($Member in $Members) {
|
||||
$GroupObject = [ordered]@{
|
||||
Changed = [DateTime] $Group.Changed
|
||||
GPOSettingOrder = $Group.GPOSettingOrder
|
||||
Name = $Group.name
|
||||
Action = $Script:Actions["$($Group.Properties.action)"]
|
||||
GroupName = $Group.Properties.groupName #: Administrators (built -in )
|
||||
NewName = $Group.Properties.newName #:
|
||||
Description = $Group.Properties.description #:
|
||||
DeleteAllUsers = if ($Group.Properties.deleteAllUsers -eq '1') { 'Enabled' } elseif ($Group.Properties.deleteAllUsers -eq '0') { 'Disabled' } else { $Group.Properties.deleteAllUsers };
|
||||
DeleteAllGroups = if ($Group.Properties.deleteAllGroups -eq '1') { 'Enabled' } elseif ($Group.Properties.deleteAllGroups -eq '0') { 'Disabled' } else { $Group.Properties.deleteAllGroups };
|
||||
RemoveAccounts = if ($Group.Properties.removeAccounts -eq '1') { 'Enabled' } elseif ($Group.Properties.removeAccounts -eq '0') { 'Disabled' } else { $Group.Properties.removeAccounts };
|
||||
GroupSid = $Group.Properties.groupSid #: S - 1 - 5 - 32 - 544
|
||||
}
|
||||
$Last = [ordered] @{
|
||||
#Uid = $Group.uid #: {8F435B0A-CD15-464E-85F3-B6A55B9E816A}: {8F435B0A-CD15-464E-85F3-B6A55B9E816A}
|
||||
RunInLoggedOnUserSecurityContext = if ($Group.userContext -eq '1') { 'Enabled' } elseif ($Group.userContext -eq '0') { 'Disabled' } else { $Group.userContext };
|
||||
RemoveThisItemWhenItIsNoLongerApplied = if ($Group.removePolicy -eq '1') { 'Enabled' } elseif ($Group.removePolicy -eq '0') { 'Disabled' } else { $Group.removePolicy };
|
||||
Filters = $Group.Filters #::
|
||||
}
|
||||
# Merging GPO with Member
|
||||
$GroupObject = $GroupObject + $Member + $Last
|
||||
[PSCustomObject] $GroupObject
|
||||
}
|
||||
}
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($Group in $GPO.DataSet.Group) {
|
||||
# We're mostly interested in Members
|
||||
[Array] $Members = foreach ($Member in $Group.Properties.Members.Member) {
|
||||
[ordered] @{
|
||||
MemberName = $Member.Name
|
||||
MemberAction = $Member.Action
|
||||
MemberSID = $Member.SID
|
||||
}
|
||||
}
|
||||
# if we have no members we create dummy object to make sure we can use foreach below
|
||||
if ($Members.Count -eq 0) {
|
||||
$Members = @(
|
||||
[ordered] @{
|
||||
MemberName = $null
|
||||
MemberAction = $null
|
||||
MemberSID = $null
|
||||
}
|
||||
)
|
||||
}
|
||||
foreach ($Member in $Members) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPO.GpoCategory #: SecuritySettings
|
||||
#GpoSettings = $GPO.GpoSettings #: SecurityOptions
|
||||
Changed = [DateTime] $Group.Changed
|
||||
GPOSettingOrder = $Group.GPOSettingOrder
|
||||
Name = $Group.name
|
||||
Action = $Script:Actions["$($Group.Properties.action)"]
|
||||
GroupName = $Group.Properties.groupName #: Administrators (built -in )
|
||||
NewName = $Group.Properties.newName #:
|
||||
Description = $Group.Properties.description #:
|
||||
DeleteAllUsers = if ($Group.Properties.deleteAllUsers -eq '1') { 'Enabled' } elseif ($Group.Properties.deleteAllUsers -eq '0') { 'Disabled' } else { $Group.Properties.deleteAllUsers };
|
||||
DeleteAllGroups = if ($Group.Properties.deleteAllGroups -eq '1') { 'Enabled' } elseif ($Group.Properties.deleteAllGroups -eq '0') { 'Disabled' } else { $Group.Properties.deleteAllGroups };
|
||||
RemoveAccounts = if ($Group.Properties.removeAccounts -eq '1') { 'Enabled' } elseif ($Group.Properties.removeAccounts -eq '0') { 'Disabled' } else { $Group.Properties.removeAccounts };
|
||||
GroupSid = $Group.Properties.groupSid #: S - 1 - 5 - 32 - 544
|
||||
}
|
||||
$Last = [ordered] @{
|
||||
# Uid = $Group.uid #: {8F435B0A-CD15-464E-85F3-B6A55B9E816A}: {8F435B0A-CD15-464E-85F3-B6A55B9E816A}
|
||||
RunInLoggedOnUserSecurityContext = if ($Group.userContext -eq '1') { 'Enabled' } elseif ($Group.userContext -eq '0') { 'Disabled' } else { $Group.userContext };
|
||||
RemoveThisItemWhenItIsNoLongerApplied = if ($Group.removePolicy -eq '1') { 'Enabled' } elseif ($Group.removePolicy -eq '0') { 'Disabled' } else { $Group.removePolicy };
|
||||
Filters = $Group.Filters #::
|
||||
}
|
||||
# Merging GPO with Member
|
||||
$CreateGPO = $CreateGPO + $Member + $Last
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
function ConvertTo-XMLLocalUser {
|
||||
[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
|
||||
}
|
||||
if (-not $GPO.DataSet.User) {
|
||||
continue
|
||||
}
|
||||
[Array] $CreateGPO['Settings'] = foreach ($User in $GPO.DataSet.User) {
|
||||
[PSCustomObject] @{
|
||||
Changed = [DateTime] $User.Changed
|
||||
GPOSettingOrder = $User.GPOSettingOrder
|
||||
Action = $Script:Actions["$($User.Properties.action)"]
|
||||
UserName = $User.Properties.userName
|
||||
NewName = $User.Properties.newName
|
||||
FullName = $User.Properties.fullName
|
||||
Description = $User.Properties.description
|
||||
Password = $User.Properties.cpassword
|
||||
MustChangePasswordAtNextLogon = if ($User.Properties.changeLogon -eq '1') { $true } elseif ($User.Properties.changeLogon -eq '0') { $false } else { $User.Properties.changeLogon };
|
||||
CannotChangePassword = if ($User.Properties.noChange -eq '1') { $true } elseif ($User.Properties.noChange -eq '0') { $false } else { $User.Properties.noChange };
|
||||
PasswordNeverExpires = if ($User.Properties.neverExpires -eq '1') { $true } elseif ($User.Properties.neverExpires -eq '0') { $false } else { $User.Properties.neverExpires };
|
||||
AccountIsDisabled = if ($User.Properties.acctDisabled -eq '1') { $true } elseif ($User.Properties.acctDisabled -eq '0') { $false } else { $User.Properties.acctDisabled };
|
||||
AccountExpires = try { [DateTime] $User.Properties.expires } catch { $User.Properties.expires };
|
||||
SubAuthority = $User.Properties.subAuthority
|
||||
}
|
||||
}
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($User in $GPO.DataSet.User) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPO.GpoCategory #: SecuritySettings
|
||||
#GpoSettings = $GPO.GpoSettings #: SecurityOptions
|
||||
Changed = [DateTime] $User.Changed
|
||||
GPOSettingOrder = $User.GPOSettingOrder
|
||||
Action = $Script:Actions["$($User.Properties.action)"]
|
||||
UserName = $User.Properties.userName
|
||||
NewName = $User.Properties.newName
|
||||
FullName = $User.Properties.fullName
|
||||
Description = $User.Properties.description
|
||||
Password = $User.Properties.cpassword
|
||||
MustChangePasswordAtNextLogon = if ($User.Properties.changeLogon -eq '1') { $true } elseif ($User.Properties.changeLogon -eq '0') { $false } else { $User.Properties.changeLogon };
|
||||
CannotChangePassword = if ($User.Properties.noChange -eq '1') { $true } elseif ($User.Properties.noChange -eq '0') { $false } else { $User.Properties.noChange };
|
||||
PasswordNeverExpires = if ($User.Properties.neverExpires -eq '1') { $true } elseif ($User.Properties.neverExpires -eq '0') { $false } else { $User.Properties.neverExpires };
|
||||
AccountIsDisabled = if ($User.Properties.acctDisabled -eq '1') { $true } elseif ($User.Properties.acctDisabled -eq '0') { $false } else { $User.Properties.acctDisabled };
|
||||
AccountExpires = try { [DateTime] $User.Properties.expires } catch { $User.Properties.expires };
|
||||
SubAuthority = $User.Properties.subAuthority
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
function ConvertTo-XMLPolicies {
|
||||
[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 ($Policy in $GPO.DataSet) {
|
||||
[PSCustomObject] @{
|
||||
PolicyName = $Policy.Name
|
||||
PolicyState = $Policy.State
|
||||
PolicyCategory = $Policy.Category
|
||||
PolicySupported = $Policy.Supported
|
||||
PolicyExplain = $Policy.Explain
|
||||
PolicyText = $Policy.Text
|
||||
PolicyCheckBox = $Policy.CheckBox
|
||||
PolicyDropDownList = $Policy.DropDownList
|
||||
PolicyEditText = $Policy.EditText
|
||||
}
|
||||
}
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($Policy in $GPO.DataSet) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
PolicyName = $Policy.Name
|
||||
PolicyState = $Policy.State
|
||||
PolicyCategory = $Policy.Category
|
||||
PolicySupported = $Policy.Supported
|
||||
PolicyExplain = $Policy.Explain
|
||||
PolicyText = $Policy.Text
|
||||
PolicyCheckBox = $Policy.CheckBox
|
||||
PolicyDropDownList = $Policy.DropDownList
|
||||
PolicyEditText = $Policy.EditText
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
function ConvertTo-XMLPrinter {
|
||||
[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 ($Type in @('SharedPrinter', 'PortPrinter', 'LocalPrinter')) {
|
||||
foreach ($Entry in $GPO.DataSet.$Type) {
|
||||
if ($Entry) {
|
||||
ConvertTo-XMLPrinterInternal -GPO $GPO -Entry $Entry -Type $Type -Limited
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($GPO.GpoCategory -eq 'PrinterConnectionSettings') {
|
||||
foreach ($Entry in $GPO.DataSet) {
|
||||
ConvertTo-XMLPrinterInternal -GPO $GPO -Entry $Entry -Type 'PrinterConnections' -Limited
|
||||
}
|
||||
}
|
||||
)
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($Type in @('SharedPrinter', 'PortPrinter', 'LocalPrinter')) {
|
||||
foreach ($Entry in $GPO.DataSet.$Type) {
|
||||
if ($Entry) {
|
||||
ConvertTo-XMLPrinterInternal -GPO $GPO -Entry $Entry -Type $Type
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($GPO.GpoCategory -eq 'PrinterConnectionSettings') {
|
||||
foreach ($Entry in $GPO.DataSet) {
|
||||
ConvertTo-XMLPrinterInternal -GPO $GPO -Entry $Entry -Type 'PrinterConnections'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
function ConvertTo-XMLPrinterInternal {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
$Entry,
|
||||
$Type,
|
||||
[switch] $Limited
|
||||
)
|
||||
if ($Limited) {
|
||||
$CreateGPO = [ordered]@{
|
||||
Changed = try { [DateTime] $Entry.changed } catch { $Entry.Changed };
|
||||
#uid = $Entry.uid
|
||||
BypassErrors = if ($Entry.bypassErrors -eq '1') { $true } else { $false };
|
||||
GPOSettingOrder = $Entry.GPOSettingOrder
|
||||
Filter = $Entry.Filter
|
||||
type = $Type
|
||||
Action = $null #$Script:Actions["$($Entry.Properties.action)"]
|
||||
Comment = $Entry.Properties.comment
|
||||
Path = if ($Entry.Properties.path) { $Entry.Properties.Path } elseif ($Entry.Path) { $Entry.Path } else { '' }
|
||||
Location = $Entry.Properties.location
|
||||
|
||||
HostName = $Entry.Properties.ipAddress #: 10.42.20.204
|
||||
LocalName = $Entry.Properties.localName #: CZ02PRT00017
|
||||
UseDNS = if ($Entry.Properties.useDNS -eq '1') { $true } elseif ($Entry.Properties.useDNS -eq '0') { $false } else { $Entry.Properties.useDNS };
|
||||
UseIPv6 = if ($Entry.Properties.useIPv6 -eq '1') { $true } elseif ($Entry.Properties.useIPv6 -eq '0') { $false } else { $Entry.Properties.useIPv6 };
|
||||
Default = if ($Entry.Properties.default -eq '1') { $true } elseif ($Entry.Properties.default -eq '0') { $false } else { $Entry.Properties.default };
|
||||
SkipLocal = if ($Entry.Properties.skipLocal -eq '1') { $true } elseif ($Entry.Properties.skipLocal -eq '0') { $false } else { $Entry.Properties.skipLocal };
|
||||
DeleteAllShared = if ($Entry.Properties.deleteAll -eq '1') { $true } elseif ($Entry.Properties.deleteAll -eq '0') { $false } else { $Entry.Properties.deleteAll };
|
||||
Persistent = if ($Entry.Properties.persistent -eq '1') { $true } elseif ($Entry.Properties.persistent -eq '0') { $false } else { $Entry.Properties.persistent };
|
||||
DeleteMaps = if ($Entry.Properties.deleteMaps -eq '1') { $true } elseif ($Entry.Properties.deleteMaps -eq '0') { $false } else { $Entry.Properties.deleteMaps };
|
||||
LPRSettingsQueueName = $Entry.Properties.lprQueue #:
|
||||
|
||||
Protocol = $Entry.Properties.protocol #: PROTOCOL_RAWTCP_TYPE
|
||||
PortNumber = if ($Entry.Properties.portNumber) { $Entry.Properties.portNumber } else { $Entry.Properties.port }
|
||||
DoubleSpool = if ($Entry.Properties.doubleSpool -eq '1') { $true } elseif ($Entry.Properties.doubleSpool -eq '0') { $false } else { $Entry.Properties.doubleSpool };
|
||||
|
||||
SNMPEnabled = if ($Entry.Properties.snmpEnabled -eq '1') { $true } elseif ($Entry.Properties.snmpEnabled -eq '0') { $false } else { $Entry.Properties.snmpEnabled };
|
||||
SNMPCommunityName = $Entry.Properties.snmpCommunity #: public
|
||||
SNMPDeviceIndex = $Entry.Properties.snmpDevIndex #: 1
|
||||
}
|
||||
if ($Entry.Properties.Action) {
|
||||
$CreateGPO['Action'] = $Script:Actions["$($Entry.Properties.action)"]
|
||||
} else {
|
||||
$CreateGPO['Action'] = 'Deploy'
|
||||
}
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
GpoCategory = $GPO.GpoCategory
|
||||
GpoSettings = $GPO.GpoSettings
|
||||
Changed = try { [DateTime] $Entry.changed } catch { $Entry.Changed };
|
||||
#uid = $Entry.uid
|
||||
BypassErrors = if ($Entry.bypassErrors -eq '1') { $true } else { $false };
|
||||
GPOSettingOrder = $Entry.GPOSettingOrder
|
||||
Filter = $Entry.Filter
|
||||
type = $Type
|
||||
Action = $null #$Script:Actions["$($Entry.Properties.action)"]
|
||||
Comment = $Entry.Properties.comment
|
||||
Path = if ($Entry.Properties.path) { $Entry.Properties.Path } elseif ($Entry.Path) { $Entry.Path } else { '' }
|
||||
Location = $Entry.Properties.location
|
||||
|
||||
HostName = $Entry.Properties.ipAddress #: 10.42.20.204
|
||||
LocalName = $Entry.Properties.localName #: CZ02PRT00017
|
||||
UseDNS = if ($Entry.Properties.useDNS -eq '1') { $true } elseif ($Entry.Properties.useDNS -eq '0') { $false } else { $Entry.Properties.useDNS };
|
||||
UseIPv6 = if ($Entry.Properties.useIPv6 -eq '1') { $true } elseif ($Entry.Properties.useIPv6 -eq '0') { $false } else { $Entry.Properties.useIPv6 };
|
||||
Default = if ($Entry.Properties.default -eq '1') { $true } elseif ($Entry.Properties.default -eq '0') { $false } else { $Entry.Properties.default };
|
||||
SkipLocal = if ($Entry.Properties.skipLocal -eq '1') { $true } elseif ($Entry.Properties.skipLocal -eq '0') { $false } else { $Entry.Properties.skipLocal };
|
||||
DeleteAllShared = if ($Entry.Properties.deleteAll -eq '1') { $true } elseif ($Entry.Properties.deleteAll -eq '0') { $false } else { $Entry.Properties.deleteAll };
|
||||
Persistent = if ($Entry.Properties.persistent -eq '1') { $true } elseif ($Entry.Properties.persistent -eq '0') { $false } else { $Entry.Properties.persistent };
|
||||
DeleteMaps = if ($Entry.Properties.deleteMaps -eq '1') { $true } elseif ($Entry.Properties.deleteMaps -eq '0') { $false } else { $Entry.Properties.deleteMaps };
|
||||
LPRSettingsQueueName = $Entry.Properties.lprQueue #:
|
||||
|
||||
Protocol = $Entry.Properties.protocol #: PROTOCOL_RAWTCP_TYPE
|
||||
PortNumber = if ($Entry.Properties.portNumber) { $Entry.Properties.portNumber } else { $Entry.Properties.port }
|
||||
DoubleSpool = if ($Entry.Properties.doubleSpool -eq '1') { $true } elseif ($Entry.Properties.doubleSpool -eq '0') { $false } else { $Entry.Properties.doubleSpool };
|
||||
|
||||
SNMPEnabled = if ($Entry.Properties.snmpEnabled -eq '1') { $true } elseif ($Entry.Properties.snmpEnabled -eq '0') { $false } else { $Entry.Properties.snmpEnabled };
|
||||
SNMPCommunityName = $Entry.Properties.snmpCommunity #: public
|
||||
SNMPDeviceIndex = $Entry.Properties.snmpDevIndex #: 1
|
||||
}
|
||||
if ($Entry.Properties.Action) {
|
||||
$CreateGPO['Action'] = $Script:Actions["$($Entry.Properties.action)"]
|
||||
} else {
|
||||
$CreateGPO['Action'] = 'Deploy'
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
function ConvertTo-XMLRegistryAutologon {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
)
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
AutoAdminLogon = $null
|
||||
DefaultDomainName = $null
|
||||
DefaultUserName = $null
|
||||
DefaultPassword = $null
|
||||
DateChangedAutoAdminLogon = $null
|
||||
DateChangedDefaultDomainName = $null
|
||||
DateChangedDefaultUserName = $null
|
||||
DateChangedDefaultPassword = $null
|
||||
}
|
||||
foreach ($Registry in $GPO.DataSet.Registry) {
|
||||
if ($Registry.Properties.Key -eq 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon') {
|
||||
if ($Registry.Properties.Name -eq 'AutoAdminLogon') {
|
||||
$CreateGPO['AutoAdminLogon'] = [bool] $Registry.Properties.value
|
||||
$CreateGPO['DateChangedAutoAdminLogon'] = [DateTime] $Registry.changed
|
||||
} elseif ($Registry.Properties.Name -eq 'DefaultDomainName') {
|
||||
$CreateGPO['DefaultDomainName'] = $Registry.Properties.value
|
||||
$CreateGPO['DateChangedDefaultDomainName'] = [DateTime] $Registry.changed
|
||||
} elseif ($Registry.Properties.Name -eq 'DefaultUserName') {
|
||||
$CreateGPO['DefaultUserName'] = $Registry.Properties.value
|
||||
$CreateGPO['DateChangedDefaultUserName'] = [DateTime] $Registry.changed
|
||||
} elseif ($Registry.Properties.Name -eq 'DefaultPassword') {
|
||||
$CreateGPO['DefaultPassword'] = $Registry.Properties.value
|
||||
$CreateGPO['DateChangedDefaultPassword'] = [DateTime] $Registry.changed
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($null -ne $CreateGPO['AutoAdminLogon'] -or
|
||||
$null -ne $CreateGPO['DefaultDomainName'] -or
|
||||
$null -ne $CreateGPO['DefaultUserName'] -or
|
||||
$null -ne $CreateGPO['DefaultPassword']
|
||||
) {
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount
|
||||
$CreateGPO['Links'] = $GPOEntry.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
function ConvertTo-XMLRegistryAutologonOnReport {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
)
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
AutoAdminLogon = $null
|
||||
DefaultDomainName = $null
|
||||
DefaultUserName = $null
|
||||
DefaultPassword = $null
|
||||
DateChangedAutoAdminLogon = $null
|
||||
DateChangedDefaultDomainName = $null
|
||||
DateChangedDefaultUserName = $null
|
||||
DateChangedDefaultPassword = $null
|
||||
}
|
||||
foreach ($Registry in $GPO.Settings) {
|
||||
if ($Registry.Key -eq 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon') {
|
||||
if ($Registry.Name -eq 'AutoAdminLogon') {
|
||||
$CreateGPO['AutoAdminLogon'] = [bool] $Registry.value
|
||||
$CreateGPO['DateChangedAutoAdminLogon'] = [DateTime] $Registry.changed
|
||||
} elseif ($Registry.Name -eq 'DefaultDomainName') {
|
||||
$CreateGPO['DefaultDomainName'] = $Registry.value
|
||||
$CreateGPO['DateChangedDefaultDomainName'] = [DateTime] $Registry.changed
|
||||
} elseif ($Registry.Name -eq 'DefaultUserName') {
|
||||
$CreateGPO['DefaultUserName'] = $Registry.value
|
||||
$CreateGPO['DateChangedDefaultUserName'] = [DateTime] $Registry.changed
|
||||
} elseif ($Registry.Name -eq 'DefaultPassword') {
|
||||
$CreateGPO['DefaultPassword'] = $Registry.value
|
||||
$CreateGPO['DateChangedDefaultPassword'] = [DateTime] $Registry.changed
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($null -ne $CreateGPO['AutoAdminLogon'] -or
|
||||
$null -ne $CreateGPO['DefaultDomainName'] -or
|
||||
$null -ne $CreateGPO['DefaultUserName'] -or
|
||||
$null -ne $CreateGPO['DefaultPassword']
|
||||
) {
|
||||
$CreateGPO['Linked'] = $GPOEntry.Linked #: True
|
||||
$CreateGPO['LinksCount'] = $GPOEntry.LinksCount #: 1
|
||||
$CreateGPO['Links'] = $GPOEntry.Links #: area1.local
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
function ConvertTo-XMLRegistrySettings {
|
||||
[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'] = Get-XMLNestedRegistry -GPO $GPO -DataSet $GPO.DataSet
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
Get-XMLNestedRegistry -GPO $GPO -DataSet $GPO.DataSet
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
function ConvertTo-XMLScripts {
|
||||
[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) {
|
||||
[PSCustomObject] @{
|
||||
Type = $GPO.DataSet.Type
|
||||
Command = $GPO.DataSet.Command
|
||||
Parameters = $GPO.DataSet.Parameters
|
||||
Order = $GPO.DataSet.Order
|
||||
RunOrder = $GPO.DataSet.RunOrder
|
||||
}
|
||||
}
|
||||
$CreateGPO['DataCount'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($Script in $GPO.DataSet) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
Type = $Script.Type
|
||||
Command = $Script.Command
|
||||
Parameters = $Script.Parameters
|
||||
Order = $Script.Order
|
||||
RunOrder = $Script.RunOrder
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
function ConvertTo-XMLSecurityOptions {
|
||||
[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 ($Entry in $GPO.DataSet) {
|
||||
$Object = [ordered] @{}
|
||||
$Object['KeyName'] = $Entry.KeyName
|
||||
$Object['KeyDisplayName'] = $Entry.Display.Name
|
||||
$Object['KeyDisplayUnits'] = $Entry.Display.Units
|
||||
$Object['KeyDisplayBoolean'] = try { [bool]::Parse($Entry.Display.DisplayBoolean) } catch { $null };
|
||||
$Object['KeyDisplayString'] = $Entry.Display.DisplayString
|
||||
$Object['SystemAccessPolicyName'] = $Entry.SystemAccessPolicyName
|
||||
if ($Entry.SettingString) {
|
||||
$Object['KeyValue'] = $Entry.SettingString
|
||||
} else {
|
||||
$Object['KeyValue'] = $Entry.SettingNumber
|
||||
}
|
||||
[PSCustomObject] $Object
|
||||
}
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($Entry in $GPO.DataSet) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
}
|
||||
$CreateGPO['KeyName'] = $Entry.KeyName
|
||||
$CreateGPO['KeyDisplayName'] = $Entry.Display.Name
|
||||
$CreateGPO['KeyDisplayUnits'] = $Entry.Display.Units
|
||||
$CreateGPO['KeyDisplayBoolean'] = try { [bool]::Parse($Entry.Display.DisplayBoolean) } catch { $null };
|
||||
$CreateGPO['KeyDisplayString'] = $Entry.Display.DisplayString
|
||||
$CreateGPO['SystemAccessPolicyName'] = $Entry.SystemAccessPolicyName
|
||||
if ($Entry.SettingString) {
|
||||
$CreateGPO['KeyValue'] = $Entry.SettingString
|
||||
} else {
|
||||
$CreateGPO['KeyValue'] = $Entry.SettingNumber
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
function ConvertTo-XMLSoftwareInstallation {
|
||||
[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 ($MsiInstallerr in $GPO.DataSet) {
|
||||
[PSCustomObject] @{
|
||||
Identifier = $MsiInstallerr.Identifier #: { 10495e9e-79c1-4a32-b278-a24cd495437f }
|
||||
Name = $MsiInstallerr.Name #: Local Administrator Password Solution (2)
|
||||
Path = $MsiInstallerr.Path #: \\area1.local\SYSVOL\area1.local\Policies\ { 5F5042A0-008F-45E3-8657-79C87BD002E3 }\LAPS.x64.msi
|
||||
MajorVersion = $MsiInstallerr.MajorVersion #: 6
|
||||
MinorVersion = $MsiInstallerr.MinorVersion #: 2
|
||||
LanguageId = $MsiInstallerr.LanguageId #: 1033
|
||||
Architecture = $MsiInstallerr.Architecture #: 9
|
||||
IgnoreLanguage = if ($MsiInstallerr.IgnoreLanguage -eq 'true') { $true } else { $false } #: false
|
||||
Allowx86Onia64 = if ($MsiInstallerr.Allowx86Onia64 -eq 'true') { $true } else { $false } #: true
|
||||
SupportURL = $MsiInstallerr.SupportURL #:
|
||||
AutoInstall = if ($MsiInstallerr.AutoInstall -eq 'true') { $true } else { $false } #: true
|
||||
DisplayInARP = if ($MsiInstallerr.DisplayInARP -eq 'true') { $true } else { $false } #: true
|
||||
IncludeCOM = if ($MsiInstallerr.IncludeCOM -eq 'true') { $true } else { $false } #: true
|
||||
SecurityDescriptor = $MsiInstallerr.SecurityDescriptor #: SecurityDescriptor
|
||||
DeploymentType = $MsiInstallerr.DeploymentType #: Assign
|
||||
ProductId = $MsiInstallerr.ProductId #: { ea8cb806-c109 - 4700 - 96b4-f1f268e5036c }
|
||||
ScriptPath = $MsiInstallerr.ScriptPath #: \\area1.local\SysVol\area1.local\Policies\ { 5F5042A0-008F-45E3-8657-79C87BD002E3 }\Machine\Applications\ { EAC9B821-FB4D - 457A-806F-E5B528D1E41A }.aas
|
||||
DeploymentCount = $MsiInstallerr.DeploymentCount #: 0
|
||||
InstallationUILevel = $MsiInstallerr.InstallationUILevel #: Maximum
|
||||
Upgrades = if ($MsiInstallerr.Upgrades.Mandatory -eq 'true') { $true } else { $false } #: Upgrades
|
||||
UninstallUnmanaged = if ($MsiInstallerr.UninstallUnmanaged -eq 'true') { $true } else { $false } #: false
|
||||
LossOfScopeAction = $MsiInstallerr.LossOfScopeAction #: Unmanage
|
||||
}
|
||||
}
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($MsiInstallerr in $GPO.DataSet) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
Identifier = $MsiInstallerr.Identifier #: { 10495e9e-79c1-4a32-b278-a24cd495437f }
|
||||
Name = $MsiInstallerr.Name #: Local Administrator Password Solution (2)
|
||||
Path = $MsiInstallerr.Path #: \\area1.local\SYSVOL\area1.local\Policies\ { 5F5042A0-008F-45E3-8657-79C87BD002E3 }\LAPS.x64.msi
|
||||
MajorVersion = $MsiInstallerr.MajorVersion #: 6
|
||||
MinorVersion = $MsiInstallerr.MinorVersion #: 2
|
||||
LanguageId = $MsiInstallerr.LanguageId #: 1033
|
||||
Architecture = $MsiInstallerr.Architecture #: 9
|
||||
IgnoreLanguage = if ($MsiInstallerr.IgnoreLanguage -eq 'true') { $true } else { $false } #: false
|
||||
Allowx86Onia64 = if ($MsiInstallerr.Allowx86Onia64 -eq 'true') { $true } else { $false } #: true
|
||||
SupportURL = $MsiInstallerr.SupportURL #:
|
||||
AutoInstall = if ($MsiInstallerr.AutoInstall -eq 'true') { $true } else { $false } #: true
|
||||
DisplayInARP = if ($MsiInstallerr.DisplayInARP -eq 'true') { $true } else { $false } #: true
|
||||
IncludeCOM = if ($MsiInstallerr.IncludeCOM -eq 'true') { $true } else { $false } #: true
|
||||
SecurityDescriptor = $MsiInstallerr.SecurityDescriptor #: SecurityDescriptor
|
||||
DeploymentType = $MsiInstallerr.DeploymentType #: Assign
|
||||
ProductId = $MsiInstallerr.ProductId #: { ea8cb806-c109 - 4700 - 96b4-f1f268e5036c }
|
||||
ScriptPath = $MsiInstallerr.ScriptPath #: \\area1.local\SysVol\area1.local\Policies\ { 5F5042A0-008F-45E3-8657-79C87BD002E3 }\Machine\Applications\ { EAC9B821-FB4D - 457A-806F-E5B528D1E41A }.aas
|
||||
DeploymentCount = $MsiInstallerr.DeploymentCount #: 0
|
||||
InstallationUILevel = $MsiInstallerr.InstallationUILevel #: Maximum
|
||||
Upgrades = if ($MsiInstallerr.Upgrades.Mandatory -eq 'true') { $true } else { $false } #: Upgrades
|
||||
UninstallUnmanaged = if ($MsiInstallerr.UninstallUnmanaged -eq 'true') { $true } else { $false } #: false
|
||||
LossOfScopeAction = $MsiInstallerr.LossOfScopeAction #: Unmanage
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
function ConvertTo-XMLSystemServices {
|
||||
[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 ($GPOEntry in $GPO.DataSet) {
|
||||
[PSCustomObject] @{
|
||||
ServiceName = $GPOEntry.Name
|
||||
ServiceStartUpMode = $GPOEntry.StartUpMode
|
||||
SecurityAuditingPresent = try { [bool]::Parse($GPOEntry.SecurityDescriptor.AuditingPresent.'#text') } catch { $null };
|
||||
SecurityPermissionsPresent = try { [bool]::Parse($GPOEntry.SecurityDescriptor.PermissionsPresent.'#text') } catch { $null };
|
||||
SecurityDescriptor = $GPOEntry.SecurityDescriptor
|
||||
}
|
||||
}
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($GPOEntry in $GPO.DataSet) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
ServiceName = $GPOEntry.Name
|
||||
ServiceStartUpMode = $GPOEntry.StartUpMode
|
||||
SecurityAuditingPresent = try { [bool]::Parse($GPOEntry.SecurityDescriptor.AuditingPresent.'#text') } catch { $null };
|
||||
SecurityPermissionsPresent = try { [bool]::Parse($GPOEntry.SecurityDescriptor.PermissionsPresent.'#text') } catch { $null };
|
||||
SecurityDescriptor = $GPOEntry.SecurityDescriptor
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
function ConvertTo-XMLSystemServicesNT {
|
||||
[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 ($Service in $GPO.DataSet.NTService) {
|
||||
[PSCustomObject] @{
|
||||
GPOSettingOrder = $Service.GPOSettingOrder
|
||||
#ServiceName = $Service.Name
|
||||
ServiceName = $Service.Properties.serviceName #: AppIDSvc: AppIDSvc
|
||||
ServiceStartupType = $Service.Properties.startupType #: NOCHANGE: NOCHANGE
|
||||
ServiceAction = $Service.Properties.serviceAction #: START: START
|
||||
Timeout = $Service.Properties.timeout #: 50: 50
|
||||
FirstFailure = $Service.Properties.firstFailure #: REBOOT: REBOOT
|
||||
SecondFailure = $Service.Properties.secondFailure #: REBOOT: REBOOT
|
||||
ThirdFailure = $Service.Properties.thirdFailure #: REBOOT: REBOOT
|
||||
ResetFailCountDelay = $Service.Properties.resetFailCountDelay #: 0: 0
|
||||
RestartComputerDelay = $Service.Properties.restartComputerDelay #: 60000: 60000
|
||||
Filter = $Service.Filter
|
||||
AccountName = $Service.Properties.accountName
|
||||
AllowServiceToInteractWithTheDesktop = if ($Service.Properties.interact -eq 1) { 'Yes' } elseif ($Service.Properties.interact -eq 0) { 'No' } else { $null }
|
||||
RunThisProgram = $Service.Properties.program
|
||||
CommandLineParameters = $Service.Properties.args
|
||||
AppendFailCountToEndOfCommandLine = if ($Service.Properties.append -eq 1) { 'Yes' } elseif ($Service.Properties.append -eq 0) { 'No' } else { $null }
|
||||
}
|
||||
}
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($Service in $GPO.DataSet.NTService) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
GPOSettingOrder = $Service.GPOSettingOrder
|
||||
#ServiceName = $Service.Name
|
||||
ServiceName = $Service.Properties.serviceName #: AppIDSvc: AppIDSvc
|
||||
ServiceStartupType = $Service.Properties.startupType #: NOCHANGE: NOCHANGE
|
||||
ServiceAction = $Service.Properties.serviceAction #: START: START
|
||||
Timeout = $Service.Properties.timeout #: 50: 50
|
||||
FirstFailure = $Service.Properties.firstFailure #: REBOOT: REBOOT
|
||||
SecondFailure = $Service.Properties.secondFailure #: REBOOT: REBOOT
|
||||
ThirdFailure = $Service.Properties.thirdFailure #: REBOOT: REBOOT
|
||||
ResetFailCountDelay = $Service.Properties.resetFailCountDelay #: 0: 0
|
||||
RestartComputerDelay = $Service.Properties.restartComputerDelay #: 60000: 60000
|
||||
Filter = $Service.Filter
|
||||
AccountName = $Service.Properties.accountName
|
||||
AllowServiceToInteractWithTheDesktop = if ($Service.Properties.interact -eq 1) { 'Yes' } elseif ($Service.Properties.interact -eq 0) { 'No' } else { $null }
|
||||
RunThisProgram = $Service.Properties.program
|
||||
CommandLineParameters = $Service.Properties.args
|
||||
AppendFailCountToEndOfCommandLine = if ($Service.Properties.append -eq 1) { 'Yes' } elseif ($Service.Properties.append -eq 0) { 'No' } else { $null }
|
||||
<#$
|
||||
|
||||
startupType : NOCHANGE
|
||||
serviceName : AudioEndpointBuilder
|
||||
timeout : 30
|
||||
accountName : LocalSystem
|
||||
interact : 1
|
||||
thirdFailure : RUNCMD
|
||||
resetFailCountDelay : 0
|
||||
program : fgdfg
|
||||
args : dg
|
||||
append : 1
|
||||
|
||||
Service name AudioEndpointBuilder
|
||||
Action No change
|
||||
Startup type: No change
|
||||
Wait timeout if service is locked: 30 seconds
|
||||
Service AccountLog on service as: LocalSystem
|
||||
Allow service to interact with the desktop: Yes
|
||||
|
||||
First failure: No change
|
||||
Second failure: No change
|
||||
Subsequent failures: Run a program
|
||||
Reset fail count after: 0 days
|
||||
Run this program: fgdfg
|
||||
Command line parameters: dg
|
||||
Append fail count to end of command line: Yes
|
||||
|
||||
#>
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,243 @@
|
||||
function ConvertTo-XMLTaskScheduler {
|
||||
[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 ($Entry in $GPO.DataSet.Drive) {
|
||||
[PSCustomObject] @{
|
||||
Changed = [DateTime] $Entry.changed
|
||||
#uid = $Entry.uid
|
||||
GPOSettingOrder = $Entry.GPOSettingOrder
|
||||
Filter = $Entry.Filter
|
||||
|
||||
Name = $Entry.Name
|
||||
Action = $Script:Actions["$($Entry.Properties.action)"]
|
||||
ThisDrive = $Entry.Properties.thisDrive
|
||||
AllDrives = $Entry.Properties.allDrives
|
||||
UserName = $Entry.Properties.userName
|
||||
Path = $Entry.Properties.path
|
||||
Label = $Entry.Properties.label
|
||||
Persistent = if ($Entry.Properties.persistent -eq '1') { $true } elseif ($Entry.Properties.persistent -eq '0') { $false } else { $Entry.Properties.persistent };
|
||||
UseLetter = if ($Entry.Properties.useLetter -eq '1') { $true } elseif ($Entry.Properties.useLetter -eq '0') { $false } else { $Entry.Properties.useLetter };
|
||||
Letter = $Entry.Properties.letter
|
||||
}
|
||||
}
|
||||
$CreateGPO['Count'] = $CreateGPO['Settings'].Count
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
} else {
|
||||
foreach ($Type in @('TaskV2', 'Task', 'ImmediateTaskV2', 'ImmediateTask')) {
|
||||
foreach ($Entry in $GPO.DataSet.$Type) {
|
||||
$ListActions = foreach ($LoopAction in $Entry.Properties.Task.Actions) {
|
||||
|
||||
foreach ($InternalAction in $LoopAction.Exec) {
|
||||
$Action = [ordered] @{
|
||||
ActionType = 'Execute'
|
||||
Command = $InternalAction.Command # : cmd
|
||||
Arguments = $InternalAction.Arguments # : / c wevtutil qe security / rd:true / f:text / c:1 / q:"*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and (EventID=4727 or EventID=4759 or EventID=4754 or EventID=4731)]]" >group-creation.txt
|
||||
WorkingDirectory = $InternalAction.WorkingDirectory# : % windir % \temp
|
||||
Server = $Null
|
||||
Subject = $Null
|
||||
To = $Null
|
||||
From = $Null
|
||||
Body = $Null
|
||||
Attachments = $Null
|
||||
}
|
||||
$Action
|
||||
}
|
||||
foreach ($InternalAction in $LoopAction.SendEmail) {
|
||||
$Action = [ordered] @{
|
||||
ActionType = 'SendEmail'
|
||||
Command = $null
|
||||
Arguments = $null # : / c wevtutil qe security / rd:true / f:text / c:1 / q:"*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and (EventID=4727 or EventID=4759 or EventID=4754 or EventID=4731)]]" >group-creation.txt
|
||||
WorkingDirectory = $null # : % windir % \temp
|
||||
Server = $InternalAction.Server # : smtp-de
|
||||
Subject = $InternalAction.Subject # : AD Group creation
|
||||
To = $InternalAction.To # : gm6b@eurofins.de,RalphThomasAussem@eurofins.de,karlthomaseggert@eurofins.de
|
||||
From = $InternalAction.From # : %computername%@eurofins.local
|
||||
Body = $InternalAction.Body # : A new security group has been created. Check attachment for further details.
|
||||
Attachments = $InternalAction.Attachments.File -join '; ' # : Attachments
|
||||
}
|
||||
$Action
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
<#
|
||||
[DBG]: PS C:\Support\GitHub\GpoZaurr> $Entry.Properties.Task.Triggers.EventTrigger
|
||||
|
||||
Enabled Subscription
|
||||
------- ------------
|
||||
true <QueryList><Query Id="0" Path="Security"><Select Path="Security">*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=4727]]</Select></Query></QueryList>
|
||||
true <QueryList><Query Id="0" Path="Security"><Select Path="Security">*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=4731]]</Select></Query></QueryList>
|
||||
true <QueryList><Query Id="0" Path="Security"><Select Path="Security">*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=4754]]</Select></Query></QueryList>
|
||||
false <QueryList><Query Id="0" Path="Security"><Select Path="Security">*[System[Provider[@Name='Microsoft-Windows-Security-Auditing'] and EventID=4759]]</Select></Query></QueryList>
|
||||
#>
|
||||
if ($ListActions.Count -eq 0) {
|
||||
$ListActions = @(
|
||||
|
||||
if ($Entry.Properties.appName) {
|
||||
# This supports Scheduled Task (legacy)
|
||||
$Action = [ordered] @{
|
||||
ActionType = $Script:Actions["$($Entry.Properties.action)"]
|
||||
Command = $Entry.Properties.appName
|
||||
Arguments = $Entry.Properties.args #
|
||||
WorkingDirectory = $Entry.Properties.startIn # : % windir % \temp
|
||||
Server = $null # : smtp-de
|
||||
Subject = $null # : AD Group creation
|
||||
To = $null
|
||||
From = $null
|
||||
Body = $null
|
||||
Attachments = $null
|
||||
}
|
||||
$Action
|
||||
} else {
|
||||
|
||||
$Action = [ordered] @{
|
||||
ActionType = $Script:Actions["$($Entry.Properties.action)"]
|
||||
Command = $null
|
||||
Arguments = $null #
|
||||
WorkingDirectory = $null # : % windir % \temp
|
||||
Server = $null # : smtp-de
|
||||
Subject = $null # : AD Group creation
|
||||
To = $null
|
||||
From = $null
|
||||
Body = $null
|
||||
Attachments = $null
|
||||
}
|
||||
$Action
|
||||
}
|
||||
)
|
||||
}
|
||||
foreach ($Action in $ListActions) {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
Type = $Type
|
||||
Changed = [DateTime] $Entry.changed
|
||||
GPOSettingOrder = $Entry.GPOSettingOrder
|
||||
userContext = ''
|
||||
|
||||
Name = $Entry.Name
|
||||
Status = $Entry.status
|
||||
Action = $Script:Actions["$($Entry.Properties.action)"]
|
||||
|
||||
|
||||
runAs = $Entry.Properties.runAs #: NT AUTHORITY\System
|
||||
#logonType = $Entry.Properties.logonType #: InteractiveToken
|
||||
#Task = $Entry.Properties.Task #: Task
|
||||
|
||||
Comment = $Entry.Properties.comment
|
||||
}
|
||||
if ($Entry.Properties.startOnlyIfIdle) {
|
||||
# Old legacy task
|
||||
$Middle = [ordered] @{
|
||||
AllowStartOnDemand = $null #: true
|
||||
DisallowStartIfOnBatteries = $Entry.Properties.noStartIfOnBatteries #: false
|
||||
StopIfGoingOnBatteries = $Entry.Properties.stopIfGoingOnBatteries #: false
|
||||
AllowHardTerminate = $null #: true
|
||||
Enabled = $Entry.Properties.enabled #: true
|
||||
Hidden = $null #: false
|
||||
MultipleInstancesPolicy = $null #: IgnoreNew
|
||||
Priority = $null #: 7
|
||||
ExecutionTimeLimit = $null #: PT1H
|
||||
#IdleSettings = $Entry.Properties.Task.Settings.IdleSettings #: IdleSettings
|
||||
|
||||
IdleDuration = $Entry.Properties.deadlineMinutes # : PT5M
|
||||
IdleWaitTimeout = $null # : PT1H
|
||||
IdleStopOnIdleEnd = $Entry.Properties.stopOnIdleEnd # : false
|
||||
IdleRestartOnIdle = $Entry.Properties.startOnlyIfIdle # : false
|
||||
|
||||
RegistrationInfoAuthor = $null
|
||||
RegistrationInfoDescription = $null
|
||||
deleteWhenDone = $Entry.Properties.deleteWhenDone
|
||||
|
||||
<#
|
||||
action : U
|
||||
name : Task Name
|
||||
appName : Run command
|
||||
args : args for command
|
||||
startIn : start me in
|
||||
comment : Oops i did it again
|
||||
enabled : 1
|
||||
deleteWhenDone : 1
|
||||
maxRunTime : 259200000
|
||||
startOnlyIfIdle : 1
|
||||
idleMinutes : 10
|
||||
deadlineMinutes : 60
|
||||
stopOnIdleEnd : 1
|
||||
noStartIfOnBatteries : 1
|
||||
stopIfGoingOnBatteries : 1
|
||||
systemRequired : 0
|
||||
Triggers : Triggers
|
||||
#>
|
||||
}
|
||||
} else {
|
||||
$Middle = [ordered] @{
|
||||
AllowStartOnDemand = $Entry.Properties.Task.Settings.AllowStartOnDemand #: true
|
||||
DisallowStartIfOnBatteries = $Entry.Properties.Task.Settings.DisallowStartIfOnBatteries #: false
|
||||
StopIfGoingOnBatteries = $Entry.Properties.Task.Settings.StopIfGoingOnBatteries #: false
|
||||
AllowHardTerminate = $Entry.Properties.Task.Settings.AllowHardTerminate #: true
|
||||
Enabled = $Entry.Properties.Task.Settings.Enabled #: true
|
||||
Hidden = $Entry.Properties.Task.Settings.Hidden #: false
|
||||
MultipleInstancesPolicy = $Entry.Properties.Task.Settings.MultipleInstancesPolicy #: IgnoreNew
|
||||
Priority = $Entry.Properties.Task.Settings.Priority #: 7
|
||||
ExecutionTimeLimit = $Entry.Properties.Task.Settings.ExecutionTimeLimit #: PT1H
|
||||
#IdleSettings = $Entry.Properties.Task.Settings.IdleSettings #: IdleSettings
|
||||
|
||||
IdleDuration = $Entry.Properties.Task.Settings.IdleSettings.Duration # : PT5M
|
||||
IdleWaitTimeout = $Entry.Properties.Task.Settings.IdleSettings.WaitTimeout # : PT1H
|
||||
IdleStopOnIdleEnd = $Entry.Properties.Task.Settings.IdleSettings.StopOnIdleEnd # : false
|
||||
IdleRestartOnIdle = $Entry.Properties.Task.Settings.IdleSettings.RestartOnIdle # : false
|
||||
|
||||
RegistrationInfoAuthor = $Entry.Properties.Task.RegistrationInfo.Author
|
||||
RegistrationInfoDescription = $Entry.Properties.Task.RegistrationInfo.Description
|
||||
|
||||
deleteWhenDone = $Entry.Properties.deleteWhenDone
|
||||
}
|
||||
}
|
||||
$End = [ordered] @{
|
||||
id = $Entry.Properties.Principals.Principal.id # : Author
|
||||
UserId = $Entry.Properties.Principals.Principal.UserId # : NT AUTHORITY\System
|
||||
LogonType = $Entry.Properties.Principals.Principal.LogonType # : InteractiveToken
|
||||
RunLevel = $Entry.Properties.Principals.Principal.RunLevel # : HighestAvailable
|
||||
|
||||
#Persistent = if ($Entry.Properties.persistent -eq '1') { $true } elseif ($Entry.Properties.persistent -eq '0') { $false } else { $Entry.Properties.persistent };
|
||||
#UseLetter = if ($Entry.Properties.useLetter -eq '1') { $true } elseif ($Entry.Properties.useLetter -eq '0') { $false } else { $Entry.Properties.useLetter };
|
||||
#Letter = $Entry.Properties.letter
|
||||
}
|
||||
$CreateGPO = $CreateGPO + $Middle + $End + $Action
|
||||
$Last = [ordered] @{
|
||||
#Uid = $Group.uid #: {8F435B0A-CD15-464E-85F3-B6A55B9E816A}: {8F435B0A-CD15-464E-85F3-B6A55B9E816A}
|
||||
RunInLoggedOnUserSecurityContext = if ($Entry.userContext -eq '1') { 'Enabled' } elseif ($Entry.userContext -eq '0') { 'Disabled' } else { $Entry.userContext };
|
||||
RemoveThisItemWhenItIsNoLongerApplied = if ($Entry.removePolicy -eq '1') { 'Enabled' } elseif ($Entry.removePolicy -eq '0') { 'Disabled' } else { $Entry.removePolicy };
|
||||
Filters = $Group.Filters #::
|
||||
}
|
||||
$CreateGPO = $CreateGPO + $Last
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
function Find-MissingProperties {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[Array] $Objects,
|
||||
[string[]] $PossibleProperties
|
||||
)
|
||||
$AllProperties = Select-Properties -AllProperties -Objects $Objects
|
||||
$MissingProperties = $AllProperties | Where-Object { $_ -notin 'DisplayName', 'DomainName', 'GUID', 'Linked', 'LinksCount', 'Links', 'GPOType', 'GPOCategory', 'GPOSettings' }
|
||||
[Array] $ConsiderAdding = foreach ($Property in $MissingProperties) {
|
||||
if ($Property -notin $PossibleProperties) {
|
||||
$Property
|
||||
}
|
||||
}
|
||||
$ConsiderAdding
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
function Get-GPOCategories {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
[System.Xml.XmlElement[]] $GPOOutput,
|
||||
[string] $Splitter,
|
||||
[switch] $FullObjects,
|
||||
[System.Collections.IDictionary] $CachedCategories
|
||||
)
|
||||
if (-not $CachedCategories) {
|
||||
$CachedCategories = [ordered] @{}
|
||||
}
|
||||
$LinksInformation = Get-LinksFromXML -GPOOutput $GPOOutput -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($GpoType in @('User', 'Computer')) {
|
||||
if ($GPOOutput.$GpoType.ExtensionData.Extension) {
|
||||
foreach ($ExtensionType in $GPOOutput.$GpoType.ExtensionData.Extension) {
|
||||
# It's possible that one of the ExtensionType records has value null. Weird but happend.
|
||||
if ($ExtensionType) {
|
||||
$GPOSettingTypeSplit = ($ExtensionType.type -split ':')
|
||||
try {
|
||||
$KeysToLoop = $ExtensionType | Get-Member -MemberType Properties -ErrorAction Stop | Where-Object { $_.Name -notin 'type', $GPOSettingTypeSplit[0] -and $_.Name -notin @('Blocked') }
|
||||
} catch {
|
||||
Write-Warning "Get-XMLStandard - things went sideways $($_.Exception.Message)"
|
||||
continue
|
||||
}
|
||||
|
||||
foreach ($GpoSettings in $KeysToLoop.Name) {
|
||||
$Template = [ordered] @{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.Guid
|
||||
GpoType = $GpoType
|
||||
GpoCategory = $GPOSettingTypeSplit[1]
|
||||
GpoSettings = $GpoSettings
|
||||
}
|
||||
$Template['Linked'] = $LinksInformation.Linked
|
||||
$Template['LinksCount'] = $LinksInformation.LinksCount
|
||||
$Template['Links'] = $LinksInformation.Links
|
||||
$Template['IncludeComments'] = [bool]::Parse($GPOOutput.IncludeComments)
|
||||
$Template['CreatedTime'] = [DateTime] $GPOOutput.CreatedTime
|
||||
$Template['ModifiedTime'] = [DateTime] $GPOOutput.ModifiedTime
|
||||
$Template['ReadTime'] = [DateTime] $GPOOutput.ReadTime
|
||||
$Template['SecurityDescriptor'] = $GPOOutput.SecurityDescriptor
|
||||
$Template['FilterDataAvailable'] = [bool]::Parse($GPOOutput.FilterDataAvailable)
|
||||
$Template['DataSet'] = $ExtensionType.$GpoSettings
|
||||
$ConvertedObject = [PSCustomObject] $Template
|
||||
|
||||
if (-not $CachedCategories["$($Template.GpoCategory)"]) {
|
||||
$CachedCategories["$($Template.GpoCategory)"] = [ordered] @{}
|
||||
}
|
||||
if (-not $CachedCategories["$($Template.GpoCategory)"]["$($Template.GpoSettings)"]) {
|
||||
$CachedCategories["$($Template.GpoCategory)"]["$($Template.GpoSettings)"] = [System.Collections.Generic.List[PSCustomObject]]::new()
|
||||
}
|
||||
$CachedCategories["$($Template.GpoCategory)"]["$($Template.GpoSettings)"].Add($ConvertedObject)
|
||||
# return GPOCategory
|
||||
$ConvertedObject
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+36
-20
@@ -5,15 +5,33 @@
|
||||
[Microsoft.GroupPolicy.Gpo] $GPO,
|
||||
[switch] $PermissionsOnly,
|
||||
[switch] $OwnerOnly,
|
||||
[System.Collections.IDictionary] $ADAdministrativeGroups
|
||||
[System.Collections.IDictionary] $ADAdministrativeGroups,
|
||||
[string] $Splitter = [System.Environment]::NewLine
|
||||
)
|
||||
if ($XMLContent.GPO.LinksTo) {
|
||||
$Linked = $true
|
||||
$LinksCount = ([Array] $XMLContent.GPO.LinksTo).Count
|
||||
$LinkSplit = ([Array] $XMLContent.GPO.LinksTo).Where( { $_.Enabled -eq $true }, 'Split')
|
||||
[Array] $LinksEnabled = $LinkSplit[0]
|
||||
[Array] $LinksDisabled = $LinkSplit[1]
|
||||
$LinksEnabledCount = $LinksEnabled.Count
|
||||
$LinksDisabledCount = $LinksDisabled.Count
|
||||
$LinksTotalCount = ([Array] $XMLContent.GPO.LinksTo).Count
|
||||
if ($LinksEnabledCount -eq 0) {
|
||||
$Linked = $false
|
||||
} else {
|
||||
$Linked = $true
|
||||
}
|
||||
} else {
|
||||
$Linked = $false
|
||||
$LinksCount = 0
|
||||
$LinksEnabledCount = 0
|
||||
$LinksDisabledCount = 0
|
||||
$LinksTotalCount = 0
|
||||
}
|
||||
if ($null -eq $XMLContent.GPO.Computer.ExtensionData -and $null -eq $XMLContent.GPO.User.ExtensionData) {
|
||||
$Empty = $true
|
||||
} else {
|
||||
$Empty = $false
|
||||
}
|
||||
|
||||
|
||||
# Find proper values for enabled/disabled user/computer settings
|
||||
if ($XMLContent.GPO.Computer.Enabled -eq 'False') {
|
||||
@@ -98,8 +116,11 @@
|
||||
'DisplayName' = $XMLContent.GPO.Name
|
||||
'DomainName' = $XMLContent.GPO.Identifier.Domain.'#text'
|
||||
'GUID' = $XMLContent.GPO.Identifier.Identifier.InnerText -replace '{' -replace '}'
|
||||
'Empty' = $Empty
|
||||
'Linked' = $Linked
|
||||
'LinksCount' = $LinksCount
|
||||
'LinksCount' = $LinksTotalCount
|
||||
'LinksEnabledCount' = $LinksEnabledCount
|
||||
'LinksDisabledCount' = $LinksDisabledCount
|
||||
'Enabled' = $Enabled
|
||||
'ComputerEnabled' = $ComputerEnabled
|
||||
'UserEnabled' = $UserEnabled
|
||||
@@ -111,14 +132,11 @@
|
||||
'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
|
||||
|
||||
ComputerPolicies = $XMLContent.GPO.Computer.ExtensionData.Name -join ", "
|
||||
UserPolicies = $XMLContent.GPO.User.ExtensionData.Name -join ", "
|
||||
|
||||
'ComputerPolicies' = $XMLContent.GPO.Computer.ExtensionData.Name -join ", "
|
||||
'UserPolicies' = $XMLContent.GPO.User.ExtensionData.Name -join ", "
|
||||
'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
|
||||
@@ -147,7 +165,14 @@
|
||||
}
|
||||
)
|
||||
'Auditing' = if ($XMLContent.GPO.SecurityDescriptor.AuditingPresent.'#text' -eq 'true') { $true } else { $false }
|
||||
'Links' = $XMLContent.GPO.LinksTo | ForEach-Object -Process {
|
||||
'Links' = @(
|
||||
$XMLContent.GPO.LinksTo | ForEach-Object -Process {
|
||||
if ($_) {
|
||||
$_.SOMPath
|
||||
}
|
||||
}
|
||||
) -join $Splitter
|
||||
'LinksObjects' = $XMLContent.GPO.LinksTo | ForEach-Object -Process {
|
||||
if ($_) {
|
||||
[PSCustomObject] @{
|
||||
CanonicalName = $_.SOMPath
|
||||
@@ -156,15 +181,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
<#
|
||||
SOMName SOMPath Enabled NoOverride
|
||||
------- ------- ------- ----------
|
||||
ad ad.evotec.xyz true false
|
||||
#>
|
||||
|
||||
#| Select-Object -ExpandProperty SOMPath
|
||||
|
||||
}
|
||||
}
|
||||
#break
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
function Get-XMLNestedRegistry {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
[System.Xml.XmlElement[]] $DataSet,
|
||||
[string] $Collection,
|
||||
[switch] $Limited
|
||||
)
|
||||
if ($DataSet.Properties) {
|
||||
$Registry = $DataSet
|
||||
foreach ($Registry in $DataSet) {
|
||||
if ($Registry.Properties) {
|
||||
if ($Limited) {
|
||||
[PSCustomObject] @{
|
||||
Collection = $Collection
|
||||
Description = $Registry.descr
|
||||
Changed = try { [DateTime] $Registry.changed } catch { $Registry.changed };
|
||||
GPOSettingOrder = [int] $Registry.GPOSettingOrder
|
||||
Action = $Script:Actions[$Registry.Properties.action]
|
||||
DisplayDecimal = if ($Registry.Properties.displayDecimal -eq '1') { $true } else { $false };
|
||||
Default = if ($Registry.Properties.default -eq '1') { $true } else { $false };
|
||||
Hive = $Registry.Properties.hive #: HKEY_LOCAL_MACHINE
|
||||
Key = $Registry.Properties.key #: SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
|
||||
Name = $Registry.Properties.name #: AutoAdminLogon
|
||||
Type = $Registry.Properties.type #: REG_SZ
|
||||
Value = $Registry.Properties.value #
|
||||
Filters = $Registry.Filters
|
||||
BypassErrors = if ($Registry.bypassErrors -eq '1') { $true } else { $false };
|
||||
}
|
||||
} else {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
Collection = $Collection
|
||||
Description = $Registry.descr
|
||||
Changed = try { [DateTime] $Registry.changed } catch { $Registry.changed };
|
||||
GPOSettingOrder = [int] $Registry.GPOSettingOrder
|
||||
Action = $Script:Actions[$Registry.Properties.action]
|
||||
DisplayDecimal = if ($Registry.Properties.displayDecimal -eq '1') { $true } else { $false };
|
||||
Default = if ($Registry.Properties.default -eq '1') { $true } else { $false };
|
||||
Hive = $Registry.Properties.hive #: HKEY_LOCAL_MACHINE
|
||||
Key = $Registry.Properties.key #: SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
|
||||
Name = $Registry.Properties.name #: AutoAdminLogon
|
||||
Type = $Registry.Properties.type #: REG_SZ
|
||||
Value = $Registry.Properties.value #
|
||||
Filters = $Registry.Filters
|
||||
BypassErrors = if ($Registry.bypassErrors -eq '1') { $true } else { $false };
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($Name in @('Registry', 'Collection')) {
|
||||
foreach ($Registry in $DataSet.$Name) {
|
||||
if ($Registry.Properties) {
|
||||
if ($Limited) {
|
||||
[PSCustomObject] @{
|
||||
Collection = $Collection
|
||||
Description = $Registry.descr
|
||||
Changed = try { [DateTime] $Registry.changed } catch { $Registry.changed };
|
||||
GPOSettingOrder = [int] $Registry.GPOSettingOrder
|
||||
Action = $Script:Actions[$Registry.Properties.action]
|
||||
DisplayDecimal = if ($Registry.Properties.displayDecimal -eq '1') { $true } else { $false };
|
||||
Default = if ($Registry.Properties.default -eq '1') { $true } else { $false };
|
||||
Hive = $Registry.Properties.hive #: HKEY_LOCAL_MACHINE
|
||||
Key = $Registry.Properties.key #: SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
|
||||
Name = $Registry.Properties.name #: AutoAdminLogon
|
||||
Type = $Registry.Properties.type #: REG_SZ
|
||||
Value = $Registry.Properties.value #
|
||||
Filters = $Registry.Filters
|
||||
BypassErrors = if ($Registry.bypassErrors -eq '1') { $true } else { $false };
|
||||
}
|
||||
} else {
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
Collection = $Collection
|
||||
Description = $Registry.descr
|
||||
Changed = try { [DateTime] $Registry.changed } catch { $Registry.changed };
|
||||
GPOSettingOrder = [int] $Registry.GPOSettingOrder
|
||||
Action = $Script:Actions[$Registry.Properties.action]
|
||||
DisplayDecimal = if ($Registry.Properties.displayDecimal -eq '1') { $true } else { $false }; ;
|
||||
Default = if ($Registry.Properties.default -eq '1') { $true } else { $false };
|
||||
Hive = $Registry.Properties.hive #: HKEY_LOCAL_MACHINE
|
||||
Key = $Registry.Properties.key #: SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon
|
||||
Name = $Registry.Properties.name #: AutoAdminLogon
|
||||
Type = $Registry.Properties.type #: REG_SZ
|
||||
Value = $Registry.Properties.value #
|
||||
Filters = $Registry.Filters
|
||||
BypassErrors = if ($Registry.bypassErrors -eq '1') { $true } else { $false };
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
} else {
|
||||
if ($Registry.Registry) {
|
||||
#if ($Registry.Name.Count -gt 1) {
|
||||
#Write-Verbose "Registry Name count more than 1"
|
||||
#}
|
||||
$TempCollection = $Collection
|
||||
if ($Collection) {
|
||||
$Collection = "$Collection/$($Registry.name)"
|
||||
} else {
|
||||
$Collection = $Registry.name
|
||||
}
|
||||
Get-XMLNestedRegistry -GPO $GPO -DataSet $Registry.Registry -Collection $Collection
|
||||
$Collection = $TempCollection
|
||||
}
|
||||
if ($Registry.Collection) {
|
||||
$TempCollection = $Collection
|
||||
#if ($Registry.Collection.Count -gt 1) {
|
||||
# Write-Verbose "Registry collection count more than 1"
|
||||
#}
|
||||
foreach ($MyCollection in $Registry.Collection) {
|
||||
if ($Collection) {
|
||||
#Write-Verbose "Collection1: $Collection - $($Registry.name) - $($MyCollection.name) - $($($MyCollection.name).Count)"
|
||||
$Collection = "$Collection/$($Registry.name)/$($MyCollection.name)"
|
||||
#Write-Verbose "Collection2: $Collection"
|
||||
} else {
|
||||
#Write-Verbose "Collection3: $Collection - $($Registry.name) - $($MyCollection.name)"
|
||||
$Collection = "$($Registry.name)/$($MyCollection.name)"
|
||||
#Write-Verbose "Collection4: $Collection"
|
||||
}
|
||||
|
||||
Get-XMLNestedRegistry -GPO $GPO -DataSet $MyCollection -Collection $Collection
|
||||
$Collection = $TempCollection
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
function Get-XMLStandard {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO,
|
||||
[System.Xml.XmlElement[]] $GPOOutput,
|
||||
[string] $Splitter,
|
||||
[switch] $FullObjects
|
||||
)
|
||||
$LinksInformation = Get-LinksFromXML -GPOOutput $GPOOutput -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($GpoType in @('User', 'Computer')) {
|
||||
if ($GPOOutput.$GpoType.ExtensionData.Extension) {
|
||||
foreach ($ExtensionType in $GPOOutput.$GpoType.ExtensionData.Extension) {
|
||||
$GPOSettingTypeSplit = ($ExtensionType.type -split ':')
|
||||
$KeysToLoop = $ExtensionType | Get-Member -MemberType Properties | Where-Object { $_.Name -notin 'type', $GPOSettingTypeSplit[0] }
|
||||
foreach ($GpoSettings in $KeysToLoop.Name) {
|
||||
foreach ($Key in $ExtensionType.$GpoSettings) {
|
||||
$Template = [ordered] @{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.Guid
|
||||
GpoType = $GpoType
|
||||
GpoCategory = $GPOSettingTypeSplit[1]
|
||||
GpoSettings = $GpoSettings
|
||||
}
|
||||
$Properties = ($Key | Get-Member -MemberType Properties).Name
|
||||
foreach ($Property in $Properties) {
|
||||
$Template["$Property"] = $Key.$Property
|
||||
}
|
||||
$Template['Linked'] = $LinksInformation.Linked
|
||||
$Template['LinksCount'] = $LinksInformation.LinksCount
|
||||
$Template['Links'] = $LinksInformation.Links
|
||||
[PSCustomObject] $Template
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
function Invoke-GPOTranslation {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[System.Collections.IDictionary] $InputData,
|
||||
[string] $Report,
|
||||
[string] $Category,
|
||||
[string] $Settings
|
||||
)
|
||||
if ($Category -and $Settings -and $InputData) {
|
||||
if ($Script:GPODitionary[$Report]['Code']) {
|
||||
$Script:GPOList = $InputData.$Category.$Settings
|
||||
return & $Script:GPODitionary[$Report]['Code']
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
function New-ADForestDrives {
|
||||
[cmdletbinding()]
|
||||
param(
|
||||
[string] $ForestName,
|
||||
[string] $ObjectDN
|
||||
)
|
||||
if (-not $Global:ADDrivesMapped) {
|
||||
if ($ForestName) {
|
||||
$Forest = Get-ADForest -Identity $ForestName
|
||||
} else {
|
||||
$Forest = Get-ADForest
|
||||
}
|
||||
if ($ObjectDN) {
|
||||
# This doesn't work because no Domain and no $Server
|
||||
$DNConverted = (ConvertFrom-Distinguishedname -DistinguishedName $ObjectDN -ToDC) -replace '=' -replace ','
|
||||
if (-not(Get-PSDrive -Name $DNConverted -ErrorAction SilentlyContinue)) {
|
||||
try {
|
||||
|
||||
if ($Server) {
|
||||
$null = New-PSDrive -Name $DNConverted -Root '' -PsProvider ActiveDirectory -Server $Server.Hostname[0] -Scope Global -WhatIf:$false
|
||||
Write-Verbose "New-ADForestDrives - Mapped drive $Domain / $($Server.Hostname[0])"
|
||||
} else {
|
||||
$null = New-PSDrive -Name $DNConverted -Root '' -PsProvider ActiveDirectory -Server $Domain -Scope Global -WhatIf:$false
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "New-ADForestDrives - Couldn't map new AD psdrive for $Domain / $($Server.Hostname[0])"
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach ($Domain in $Forest.Domains) {
|
||||
try {
|
||||
$Server = Get-ADDomainController -Discover -DomainName $Domain
|
||||
$DomainInformation = Get-ADDomain -Server $Server.Hostname[0]
|
||||
} catch {
|
||||
Write-Warning "New-ADForestDrives - Can't process domain $Domain - $($_.Exception.Message)"
|
||||
continue
|
||||
}
|
||||
$ObjectDN = $DomainInformation.DistinguishedName
|
||||
$DNConverted = (ConvertFrom-Distinguishedname -DistinguishedName $ObjectDN -ToDC) -replace '=' -replace ','
|
||||
if (-not(Get-PSDrive -Name $DNConverted -ErrorAction SilentlyContinue)) {
|
||||
try {
|
||||
if ($Server) {
|
||||
$null = New-PSDrive -Name $DNConverted -Root '' -PsProvider ActiveDirectory -Server $Server.Hostname[0] -Scope Global -WhatIf:$false
|
||||
Write-Verbose "New-ADForestDrives - Mapped drive $Domain / $Server"
|
||||
} else {
|
||||
$null = New-PSDrive -Name $DNConverted -Root '' -PsProvider ActiveDirectory -Server $Domain -Scope Global -WhatIf:$false
|
||||
}
|
||||
} catch {
|
||||
Write-Warning "New-ADForestDrives - Couldn't map new AD psdrive for $Domain / $Server $($_.Exception.Message)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$Global:ADDrivesMapped = $true
|
||||
}
|
||||
}
|
||||
@@ -1,95 +1,458 @@
|
||||
$Script:GPODitionary = [ordered] @{
|
||||
AccountPolicies = [ordered] @{
|
||||
Category = 'SecuritySettings'
|
||||
Settings = 'Account'
|
||||
GPOPath = 'Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Account Policies'
|
||||
Code = {
|
||||
ConvertTo-AccountPolicies -GPOList $GPOList
|
||||
AccountPolicies = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'SecuritySettings'
|
||||
Settings = 'Account'
|
||||
}
|
||||
)
|
||||
GPOPath = 'Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Account Policies'
|
||||
Code = {
|
||||
ConvertTo-XMLAccountPolicy -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLAccountPolicy -GPO $GPO
|
||||
}
|
||||
}
|
||||
Autologon = [ordered] @{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'RegistrySettings'
|
||||
Code = {
|
||||
ConvertTo-RegistryAutologon -GPOList $GPOList
|
||||
Audit = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'SecuritySettings'
|
||||
Settings = 'Audit'
|
||||
}
|
||||
@{
|
||||
Category = 'AuditSettings'
|
||||
Settings = 'AuditSetting'
|
||||
}
|
||||
)
|
||||
GPOPath = ''
|
||||
Code = {
|
||||
ConvertTo-XMLAudit -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLAudit -GPO $GPO
|
||||
}
|
||||
}
|
||||
EventLog = [ordered] @{
|
||||
Category = 'SecuritySettings'
|
||||
Settings = 'EventLog'
|
||||
#GPOPath = 'Computer Configuration -> Policies -> Windows Settings -> Security Settings -> Account Policies'
|
||||
Code = {
|
||||
ConvertTo-EventLog -GPOList $GPOList
|
||||
Autologon = [ordered] @{
|
||||
# We want to process this based on other report called RegistrySettings
|
||||
# This is because registry settings can be stored in Collections or nested within other registry settings
|
||||
# The original function ConvertTo-XMLRegistryAutologon was processing it in limited ordered and potentially would skip some entries.
|
||||
<#
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'RegistrySettings'
|
||||
}
|
||||
)
|
||||
#>
|
||||
ByReports = @(
|
||||
@{
|
||||
Report = 'RegistrySettings'
|
||||
}
|
||||
)
|
||||
<#
|
||||
Code = {
|
||||
ConvertTo-XMLRegistryAutologon -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLRegistryAutologon -GPO $GPO
|
||||
}
|
||||
#>
|
||||
CodeReport = {
|
||||
ConvertTo-XMLRegistryAutologonOnReport -GPO $GPO
|
||||
}
|
||||
}
|
||||
LocalUsersAndGroups = [ordered] @{
|
||||
Category = 'LugsSettings'
|
||||
Settings = 'LocalUsersAndGroups'
|
||||
Code = {
|
||||
ConvertTo-LocalUserAndGroups -GPOList $GPOList
|
||||
Biometrics = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
#ConvertTo-XMLBitlocker -GPO $GPO
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Windows Components/Biometrics*'
|
||||
}
|
||||
}
|
||||
Policies = @{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
Code = {
|
||||
ConvertTo-Policies -GPOList $GPOList
|
||||
Bitlocker = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
#ConvertTo-XMLBitlocker -GPO $GPO
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Windows Components/BitLocker Drive Encryption*'
|
||||
}
|
||||
}
|
||||
RegistrySettings = [ordered] @{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'RegistrySettings'
|
||||
Code = {
|
||||
ConvertTo-RegistrySettings -GPOList $GPOList
|
||||
CredentialsDelegation = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'System/Credentials Delegation*'
|
||||
}
|
||||
}
|
||||
RegistrySettingsCollection = [ordered] @{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'RegistrySettings'
|
||||
Code = {
|
||||
ConvertTo-RegistrySettingsCollection -GPOList $GPOList
|
||||
Desktop = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Desktop*'
|
||||
}
|
||||
}
|
||||
Scripts = [ordered] @{
|
||||
Category = 'Scripts'
|
||||
Settings = 'Script'
|
||||
Code = {
|
||||
ConvertTo-Scripts -GPOList $GPOList
|
||||
DnsClient = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Network/DNS Client*'
|
||||
}
|
||||
}
|
||||
SecurityOptions = [ordered] @{
|
||||
Category = 'SecuritySettings'
|
||||
Settings = 'SecurityOptions'
|
||||
Code = {
|
||||
ConvertTo-SecurityOptions -GPOList $GPOList
|
||||
DriveMapping = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'DriveMapSettings'
|
||||
Settings = 'DriveMapSettings'
|
||||
}
|
||||
)
|
||||
GPOPath = ''
|
||||
Code = {
|
||||
ConvertTo-XMLDriveMapSettings -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLDriveMapSettings -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
SoftwareInstallation = [ordered] @{
|
||||
Category = 'SoftwareInstallationSettings'
|
||||
Settings = 'MsiApplication'
|
||||
Code = {
|
||||
ConvertTo-SoftwareInstallation -GPOList $GPOList
|
||||
EventLog = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'SecuritySettings'
|
||||
Settings = 'EventLog'
|
||||
}
|
||||
)
|
||||
GPOPath = ''
|
||||
Code = {
|
||||
ConvertTo-XMLEventLog -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLEventLog -GPO $GPO
|
||||
}
|
||||
}
|
||||
SystemServices = [ordered] @{
|
||||
FileExplorer = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Windows Components/File Explorer*'
|
||||
}
|
||||
}
|
||||
GroupPolicy = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'System/Group Policy*'
|
||||
}
|
||||
}
|
||||
InternetExplorer = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Windows Components/Internet Explorer*'
|
||||
}
|
||||
}
|
||||
LAPS = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
#ConvertTo-XMLLaps -GPO $GPO
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'LAPS'
|
||||
}
|
||||
}
|
||||
Lithnet = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
#ConvertTo-XMLLithnetFilter -GPO $GPO
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Lithnet/Password Protection for Active Directory*'
|
||||
}
|
||||
}
|
||||
LocalUsers = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'LugsSettings'
|
||||
Settings = 'LocalUsersAndGroups'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLLocalUser -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLLocalUser -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
LocalGroups = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'LugsSettings'
|
||||
Settings = 'LocalUsersAndGroups'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLLocalGroups -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLLocalGroups -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
Logon = @{
|
||||
Types = @(
|
||||
@{ Category = 'RegistrySettings'; Settings = 'Policy' }
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'System/Logon*'
|
||||
}
|
||||
}
|
||||
MicrosoftOutlook2010 = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Microsoft Outlook 2010*'
|
||||
}
|
||||
}
|
||||
MicrosoftOutlook2016 = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Microsoft Outlook 2016*'
|
||||
}
|
||||
}
|
||||
Policies = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLPolicies -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLPolicies -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
Printers = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'PrintersSettings'
|
||||
Settings = 'Printers'
|
||||
}
|
||||
@{
|
||||
Category = 'PrinterConnectionSettings'
|
||||
Settings = 'PrinterConnection'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLPrinter -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLPrinter -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
PrintersPolicies = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Printers*', 'Control Panel/Printers*'
|
||||
}
|
||||
}
|
||||
RegistrySettings = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'RegistrySettings'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLRegistrySettings -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLRegistrySettings -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
RemoteDesktopServices = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Windows Components/Remote Desktop Services*'
|
||||
}
|
||||
}
|
||||
Scripts = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'Scripts'
|
||||
Settings = 'Script'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLScripts -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLScripts -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
SecurityOptions = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'SecuritySettings'
|
||||
Settings = 'SecurityOptions'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLSecurityOptions -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLSecurityOptions -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
SoftwareInstallation = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'SoftwareInstallationSettings'
|
||||
Settings = 'MsiApplication'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLSoftwareInstallation -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLSoftwareInstallation -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
SystemServices = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'SecuritySettings'
|
||||
Settings = 'SystemServices'
|
||||
}
|
||||
)
|
||||
Description = ''
|
||||
GPOPath = 'Computer Configuration -> Policies -> Windows Settings -> Security Settings -> System Services'
|
||||
Category = 'SecuritySettings'
|
||||
Settings = 'SystemServices'
|
||||
Code = {
|
||||
ConvertTo-SystemServices -GPOList $GPOList
|
||||
ConvertTo-XMLSystemServices -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLSystemServices -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
SystemServicesNT = [ordered] @{
|
||||
SystemServicesNT = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'ServiceSettings'
|
||||
Settings = 'NTServices'
|
||||
}
|
||||
)
|
||||
Description = ''
|
||||
GPOPath = 'Computer Configuration -> Preferences -> Control Pannel Settings -> Services'
|
||||
Category = 'ServiceSettings'
|
||||
Settings = 'NTServices'
|
||||
Code = {
|
||||
ConvertTo-SystemServicesNT -GPOList $GPOList
|
||||
ConvertTo-XMLSystemServicesNT -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLSystemServicesNT -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
TaskScheduler = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'ScheduledTasksSettings'
|
||||
Settings = 'ScheduledTasks'
|
||||
}
|
||||
)
|
||||
Description = ''
|
||||
GPOPath = ''
|
||||
Code = {
|
||||
ConvertTo-XMLTaskScheduler -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLTaskScheduler -GPO $GPO -SingleObject
|
||||
}
|
||||
}
|
||||
WindowsHelloForBusiness = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Windows Components/Windows Hello For Business*'
|
||||
}
|
||||
}
|
||||
WindowsRemoteManagement = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Windows Components/Windows Remote Management (WinRM)*'
|
||||
}
|
||||
}
|
||||
WindowsUpdate = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLGenericPolicy -GPO $GPO -Category 'Windows Components/Windows Update*', 'Windows Components/Delivery Optimization*'
|
||||
}
|
||||
}
|
||||
#LugsSettings = @{
|
||||
# LocalUsersAndGroups = $LugsSettingsLocalUsersAndGroups
|
||||
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
$Script:GPOPropetiesComputers = [ordered] @{
|
||||
'Account' = ''
|
||||
'Audit' = ''
|
||||
'AuditSetting' = ''
|
||||
'AutoEnrollmentSettings' = ''
|
||||
'Blocked' = ''
|
||||
'certSettingsTrustedPublishers' = ''
|
||||
'DataSourcesSettings' = ''
|
||||
'DomainProfile' = ''
|
||||
'Dot3SvcSetting' = ''
|
||||
'EFSRecoveryAgent' = ''
|
||||
'EFSSettings' = ''
|
||||
'EnvironmentVariables' = ''
|
||||
'EventLog' = ''
|
||||
'File' = ''
|
||||
'FilesSettings' = ''
|
||||
'Folders' = ''
|
||||
'General' = ''
|
||||
'Global' = ''
|
||||
'GlobalSettings' = ''
|
||||
'InboundFirewallRules' = ''
|
||||
'IntermediateCACertificate' = ''
|
||||
'InternetZoneRule' = ''
|
||||
'LocalUsersAndGroups' = ''
|
||||
'MsiApplication' = ''
|
||||
'NetworkOptions' = ''
|
||||
'NetworkShares' = ''
|
||||
'NTServices' = ''
|
||||
'OutboundFirewallRules' = ''
|
||||
'PathRule' = ''
|
||||
'Policy' = ''
|
||||
'PowerOptions' = ''
|
||||
'PrinterConnection' = ''
|
||||
'Printers' = ''
|
||||
'PrivateProfile' = ''
|
||||
'PublicProfile' = ''
|
||||
'Registry' = ''
|
||||
'RegistrySetting' = ''
|
||||
'RegistrySettings' = ''
|
||||
'RestrictedGroups' = ''
|
||||
'RootCertificate' = ''
|
||||
'RootCertificateSettings' = ''
|
||||
'ScheduledTasks' = ''
|
||||
'Script' = ''
|
||||
'SecurityOptions' = ''
|
||||
'ShortcutSettings' = ''
|
||||
'SystemServices' = ''
|
||||
'TrustedPublishersCertificate' = ''
|
||||
'type' = ''
|
||||
'UserRightsAssignment' = ''
|
||||
'WLanSvcSetting' = ''
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
$Script:GPOPropertiesUsers = [ordered] @{
|
||||
'AutoDetectConfigSettings' = ''
|
||||
'AutoEnrollmentSettings' = ''
|
||||
'AutomaticConfiguration' = ''
|
||||
'AutoSetupSetting' = ''
|
||||
'Blocked' = ''
|
||||
'BrowserTitle' = ''
|
||||
'CustomSetupSetting' = ''
|
||||
'DataSourcesSettings' = ''
|
||||
'DefinesConnectionSettings' = ''
|
||||
'DefinesEscOffSettings' = ''
|
||||
'DefinesEscOnSettings' = ''
|
||||
'DeleteChannels' = ''
|
||||
'DriveMapSettings' = ''
|
||||
'EscOffLocalSites' = ''
|
||||
'EscOffSecurityZoneAndPrivacy' = ''
|
||||
'EscOffTrustedSites' = ''
|
||||
'EscOnLocalSites' = ''
|
||||
'EscOnSecurityZoneAndPrivacy' = ''
|
||||
'EscOnTrustedSites' = ''
|
||||
'FavoriteURL' = ''
|
||||
'FilesSettings' = ''
|
||||
'Folder' = ''
|
||||
'FolderOptions' = ''
|
||||
'Folders' = ''
|
||||
'General' = ''
|
||||
'HomePage' = ''
|
||||
'ImportedContentRatings' = ''
|
||||
'InternetOptions' = ''
|
||||
'LocalUsersAndGroups' = ''
|
||||
'MsiApplication' = ''
|
||||
'NetworkOptions' = ''
|
||||
'PathRule' = ''
|
||||
'PlaceFavoritesAtTop' = ''
|
||||
'Policy' = ''
|
||||
'PowerOptions' = ''
|
||||
'PreferenceMode' = ''
|
||||
'PrinterConnection' = ''
|
||||
'Printers' = ''
|
||||
'Programs' = ''
|
||||
'ProxySettings' = ''
|
||||
'RegionalOptionsSettings' = ''
|
||||
'RegistrySetting' = ''
|
||||
'RegistrySettings' = ''
|
||||
'RestartSetupSetting' = ''
|
||||
'ScheduledTasks' = ''
|
||||
'Script' = ''
|
||||
'SearchBar' = ''
|
||||
'ShortcutSettings' = ''
|
||||
'StartMenuSettings' = ''
|
||||
'ToolsSetting' = ''
|
||||
'TrustedPublisherLockdown' = ''
|
||||
'type' = ''
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
param(
|
||||
[validateset('WellKnownAdministrative', 'Administrative', 'AuthenticatedUsers', 'Default')][string] $Type = 'Default',
|
||||
[Microsoft.GroupPolicy.GPPermissionType] $IncludePermissionType,
|
||||
[alias('Trustee')][Array] $Principal,
|
||||
[alias('Trustee')][string] $Principal,
|
||||
[alias('TrusteeType')][validateset('DistinguishedName', 'Name', 'Sid')][string] $PrincipalType = 'DistinguishedName',
|
||||
[validateSet('Allow', 'Deny')][string] $PermitType = 'Allow'
|
||||
)
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
function Clear-GPOZaurrSysvolDFSR {
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[alias('ForestName')][string] $Forest,
|
||||
[string[]] $ExcludeDomains,
|
||||
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation
|
||||
)
|
||||
# Based on https://techcommunity.microsoft.com/t5/ask-the-directory-services-team/manually-clearing-the-conflictanddeleted-folder-in-dfsr/ba-p/395711
|
||||
$StatusCodes = @{
|
||||
'0' = 'Success' # MONITOR_STATUS_SUCCESS
|
||||
'1' = 'Generic database error' #MONITOR_STATUS_GENERIC_DB_ERROR
|
||||
'2' = 'ID record not found' # MONITOR_STATUS_IDRECORD_NOT_FOUND
|
||||
'3' = 'Volume not found' # MONITOR_STATUS_VOLUME_NOT_FOUND
|
||||
'4' = 'Access denied' #MONITOR_STATUS_ACCESS_DENIED
|
||||
'5' = 'Generic error' #MONITOR_STATUS_GENERIC_ERROR
|
||||
}
|
||||
|
||||
#WMIC.EXE /namespace:\\root\microsoftdfs path dfsrreplicatedfolderconfig get replicatedfolderguid, replicatedfoldername
|
||||
#WMIC.EXE /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "replicatedfolderguid='<RF GUID>'" call cleanupconflictdirectory
|
||||
#WMIC.EXE /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo where "replicatedfolderguid='70bebd41-d5ae-4524-b7df-4eadb89e511e'" call cleanupconflictdirectory
|
||||
|
||||
# https://docs.microsoft.com/en-us/previous-versions/windows/desktop/dfsr/dfsrreplicatedfolderinfo
|
||||
$ForestInformation = Get-WinADForestDetails -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation
|
||||
foreach ($Domain in $ForestInformation.Domains) {
|
||||
Write-Verbose "Clear-GPOZaurrSysvolDFSR - Processing $Domain"
|
||||
$QueryServer = $ForestInformation['QueryServers']["$Domain"].HostName[0]
|
||||
$DFSR = Get-GPOZaurrSysvolDFSR -IncludeDomains $Domain -ExtendedForestInformation $ForestInformation
|
||||
$Executed = Invoke-CimMethod -InputObject $DFSR.DFSR -MethodName 'cleanupconflictdirectory' -CimSession $QueryServer
|
||||
if ($Executed) {
|
||||
[PSCustomObject] @{
|
||||
Status = $StatusCodes["$($Executed.ReturnValue)"]
|
||||
ComputerName = $Executed.PSComputerName
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@
|
||||
$DomainCN = ConvertFrom-DistinguishedName -DistinguishedName $_.DistinguishedName -ToDomainCN
|
||||
$GUID = $_.Name -replace '{' -replace '}'
|
||||
if (($GUID).Length -ne 36) {
|
||||
Write-Warning "Get-GPOZaurrAD - GPO GUID ($($($GUID -join ' '))) is incorrect. Skipping $($_.DisplayName) / Domain: $($DomainCN)"
|
||||
Write-Warning "Get-GPOZaurrAD - GPO GUID ($($($GUID.Replace("`n",' ')))) is incorrect. Skipping $($_.DisplayName) / Domain: $($DomainCN)"
|
||||
} else {
|
||||
$Output = [ordered]@{ }
|
||||
$Output['DisplayName'] = $_.DisplayName
|
||||
|
||||
@@ -3,12 +3,24 @@
|
||||
param(
|
||||
[ValidateSet('All', 'Netlogon', 'Sysvol')][string[]] $Type = 'All',
|
||||
[ValidateSet('None', 'MACTripleDES', 'MD5', 'RIPEMD160', 'SHA1', 'SHA256', 'SHA384', 'SHA512')][string] $HashAlgorithm = 'None',
|
||||
[switch] $Signature,
|
||||
[switch] $Limited,
|
||||
[switch] $AsHashTable,
|
||||
[switch] $Extended,
|
||||
[alias('ForestName')][string] $Forest,
|
||||
[string[]] $ExcludeDomains,
|
||||
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation
|
||||
)
|
||||
$GPOCache = @{}
|
||||
$ForestInformation = Get-WinADForestDetails -Extended -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation
|
||||
$GPOList = Get-GPOZaurrAD -ExtendedForestInformation $ForestInformation
|
||||
foreach ($GPO in $GPOList) {
|
||||
if (-not $GPOCache[$GPO.DomainName]) {
|
||||
$GPOCache[$GPO.DomainName] = @{}
|
||||
}
|
||||
$GPOCache[$($GPO.DomainName)][($GPO.GUID)] = $GPO
|
||||
}
|
||||
foreach ($Domain in $ForestInformation.Domains) {
|
||||
$Path = @(
|
||||
if ($Type -contains 'All') {
|
||||
@@ -21,8 +33,277 @@
|
||||
"\\$Domain\NETLOGON"
|
||||
}
|
||||
)
|
||||
Get-ChildItem -Path $Path -ErrorAction SilentlyContinue -Recurse -ErrorVariable err -File | ForEach-Object {
|
||||
Get-FileMetaData -File $_ -Signature -HashAlgorithm $HashAlgorithm
|
||||
# Order does matter
|
||||
$Folders = [ordered] @{
|
||||
"\\$Domain\SYSVOL\$Domain\policies\PolicyDefinitions" = @{
|
||||
Name = 'SYSVOL PolicyDefinitions'
|
||||
}
|
||||
"\\$Domain\SYSVOL\$Domain\policies" = @{
|
||||
Name = 'SYSVOL Policies'
|
||||
}
|
||||
"\\$Domain\SYSVOL\$Domain\scripts" = @{
|
||||
Name = 'NETLOGON Scripts'
|
||||
}
|
||||
"\\$Domain\SYSVOL\$Domain\StarterGPOs" = @{
|
||||
Name = 'SYSVOL GPO Starters'
|
||||
}
|
||||
"\\$Domain\NETLOGON" = @{
|
||||
Name = 'NETLOGON Scripts'
|
||||
}
|
||||
"\\$Domain\SYSVOL\$Domain\DfsrPrivate" = @{
|
||||
Name = 'DfsrPrivate'
|
||||
}
|
||||
"\\$Domain\SYSVOL\$Domain" = @{
|
||||
Name = 'SYSVOL Root'
|
||||
}
|
||||
}
|
||||
Get-ChildItem -Path $Path -ErrorAction SilentlyContinue -Recurse -ErrorVariable err -File -Force | ForEach-Object {
|
||||
# Lets reset values just to be sure those are empty
|
||||
$GPO = $null
|
||||
$BelongsToGPO = $false
|
||||
$GPODisplayName = $null
|
||||
$SuggestedAction = $null
|
||||
$SuggestedActionComment = $null
|
||||
$FileType = foreach ($Key in $Folders.Keys) {
|
||||
if ($_.FullName -like "$Key*") {
|
||||
$Folders[$Key]
|
||||
break
|
||||
}
|
||||
}
|
||||
if ($FileType.Name -eq 'SYSVOL Policies') {
|
||||
$FoundGUID = $_.FullName -match '[\da-zA-Z]{8}-([\da-zA-Z]{4}-){3}[\da-zA-Z]{12}'
|
||||
if ($FoundGUID) {
|
||||
$GPO = $GPOCache[$Domain][$matches[0]]
|
||||
if ($GPO) {
|
||||
$BelongsToGPO = $true
|
||||
$GPODisplayName = $GPO.DisplayName
|
||||
}
|
||||
}
|
||||
$Correct = @(
|
||||
[System.IO.Path]::Combine($GPO.Path, 'GPT.INI')
|
||||
[System.IO.Path]::Combine($GPO.Path, 'GPO.cmt')
|
||||
[System.IO.Path]::Combine($GPO.Path, 'Group Policy', 'GPE.ini')
|
||||
foreach ($TypeM in @('Machine', 'User')) {
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Registry.pol')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'comment.cmtx')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\Registry\Registry.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\Printers\Printers.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\ScheduledTasks\ScheduledTasks.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\Services\Services.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\Groups\Groups.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\RegionalOptions\RegionalOptions.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\FolderOptions\FolderOptions.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\Drives\Drives.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\InternetSettings\InternetSettings.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\Folders\Folders.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\PowerOptions\PowerOptions.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\Shortcuts\Shortcuts.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\Files\Files.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\EnvironmentVariables\EnvironmentVariables.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\NetworkOptions\NetworkOptions.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\DataSources\DataSources.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\NetworkShares\NetworkShares.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Preferences\StartMenuTaskbar\StartMenuTaskbar.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Applications\Microsoft\TBLayout.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Applications\Microsoft\DefaultApps.xml')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Applications\ADE.CFG')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Scripts\scripts.ini')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Scripts\psscripts.ini')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Documents & Settings\fdeploy.ini')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Documents & Settings\fdeploy1.ini')
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Documents & Settings\fdeploy2.ini')
|
||||
if ($_.Extension -eq '.aas') {
|
||||
[System.IO.Path]::Combine($GPO.Path, $TypeM, 'Applications', $_.Name)
|
||||
}
|
||||
}
|
||||
[System.IO.Path]::Combine($GPO.Path, 'Machine\Microsoft\Windows NT\SecEdit\GptTmpl.inf')
|
||||
[System.IO.Path]::Combine($GPO.Path, 'Machine\Microsoft\Windows NT\Audit\audit.csv')
|
||||
)
|
||||
if ($GPO) {
|
||||
if ($_.FullName -in $Correct) {
|
||||
$SuggestedAction = 'Skip assesment'
|
||||
$SuggestedActionComment = 'Correctly placed in SYSVOL'
|
||||
} elseif ($_.FullName -like '*_NTFRS_*') {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'Most likely replication error'
|
||||
} elseif ($_.Extension -eq '.adm') {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'Most likely legacy ADM files'
|
||||
}
|
||||
if (-not $SuggestedAction) {
|
||||
$FullPathAdmFiles = [System.IO.Path]::Combine($GPO.Path, 'Adm\admfiles.ini')
|
||||
if ($_.FullName -eq $FullPathAdmFiles) {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'Most likely legacy ADM files settings file'
|
||||
}
|
||||
}
|
||||
if (-not $SuggestedAction) {
|
||||
foreach ($Ext in @('*old*', '*bak*', '*bck', '.new')) {
|
||||
if ($_.Extension -like $Ext) {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'Most likely backup files'
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (-not $SuggestedAction) {
|
||||
<#
|
||||
$IEAK = @(
|
||||
'microsoft\IEAK\install.ins'
|
||||
'MICROSOFT\IEAK\BRANDING\cs\connect.ras'
|
||||
'microsoft\IEAK\BRANDING\cs\connect.set'
|
||||
'microsoft\IEAK\BRANDING\cs\cs.dat'
|
||||
'microsoft\IEAK\BRANDING\ADM\inetcorp.iem'
|
||||
'microsoft\IEAK\BRANDING\ADM\inetcorp.inf'
|
||||
'microsoft\IEAK\install.ins'
|
||||
'microsoft\IEAK\BRANDING\favs\Outlook.ico'
|
||||
'microsoft\IEAK\BRANDING\favs\Bio.ico'
|
||||
'MICROSOFT\IEAK\BRANDING\favs\$fi380.ico'
|
||||
'microsoft\IEAK\BRANDING\PROGRAMS\programs.inf'
|
||||
'MICROSOFT\IEAK\BRANDING\RATINGS\ratings.inf'
|
||||
'MICROSOFT\IEAK\BRANDING\RATINGS\ratrsop.inf'
|
||||
'microsoft\IEAK\BRANDING\ZONES\seczones.inf'
|
||||
'microsoft\IEAK\BRANDING\ZONES\seczrsop.inf'
|
||||
'microsoft\IEAK\BRANDING\ZONES\seczrsop.inf'
|
||||
)
|
||||
#>
|
||||
if ($_.FullName -like '*microsoft\IEAK*') {
|
||||
# https://docs.microsoft.com/en-us/internet-explorer/ie11-deploy-guide/missing-internet-explorer-maintenance-settings-for-ie11#:~:text=The%20Internet%20Explorer%20Maintenance%20(IEM,Internet%20Explorer%2010%20or%20newer.
|
||||
$SuggestedAction = 'GPO requires cleanup'
|
||||
$SuggestedActionComment = 'Internet Explorer Maintenance (IEM) is deprecated for IE 11'
|
||||
}
|
||||
}
|
||||
} else {
|
||||
<#
|
||||
$FullPathAdmFiles = [System.IO.Path]::Combine($GPO.Path, 'Adm\admfiles.ini')
|
||||
if ($_.FullName -in $Correct) {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'Most likely orphaned SYSVOL GPO'
|
||||
} elseif ($_.Extension -eq '.adm') {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'Most likely orphaned SYSVOL GPO (legacy ADM files)'
|
||||
} elseif ($_.FullName -eq $FullPathAdmFiles) {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'Most likely orphaned SYSVOL GPO (legacy ADM files)'
|
||||
}
|
||||
#>
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'Most likely orphaned SYSVOL GPO'
|
||||
}
|
||||
} elseif ($FileType.Name -eq 'NETLOGON Scripts') {
|
||||
foreach ($Ext in @('*old*', '*bak*', '*bck', '.new')) {
|
||||
if ($_.Extension -like $Ext) {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'Most likely backup files'
|
||||
break
|
||||
}
|
||||
}
|
||||
if (-not $SuggestedAction) {
|
||||
# We didn't find it in earlier check, lets go deeper
|
||||
if ($_.Extension.Length -gt 6 -and $_.Extension -notin @('.config', '.sites', '.ipsec')) {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'Extension longer then 5 chars'
|
||||
} elseif ($_.Extension -eq '') {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'No extension'
|
||||
}
|
||||
}
|
||||
if (-not $SuggestedAction) {
|
||||
foreach ($Name in @('*old*', '*bak*', '*bck*', '*Copy', '*backup*')) {
|
||||
if ($_.BaseName -like $Name) {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = "FileName contains backup related names ($Name)"
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (-not $SuggestedAction) {
|
||||
foreach ($FullName in @('*backup*', '*Delete*', '*Obsoleet*', '*Obsolete*', '*Archive*')) {
|
||||
if ($_.FullName -like $FullName) {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = "Fullname contains backup related names ($FullName)"
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
if (-not $SuggestedAction) {
|
||||
# We replace all letters leaving only numbers
|
||||
# We want to find if there is a date possibly
|
||||
$StrippedNumbers = $_.Name -replace "[^0-9]" , ''
|
||||
if ($StrippedNumbers.Length -gt 5) {
|
||||
$SuggestedAction = 'Consider deleting'
|
||||
$SuggestedActionComment = 'FileName contains over 5 numbers (date?)'
|
||||
}
|
||||
}
|
||||
} elseif ($FileType.Name -eq 'SYSVOL PolicyDefinitions') {
|
||||
if ($_.Extension -in @('.admx', '.adml')) {
|
||||
$SuggestedAction = 'Skip assesment'
|
||||
$SuggestedActionComment = 'Most likely ADMX templates'
|
||||
}
|
||||
} elseif ($FileType.Name -eq 'SYSVOL GPO Starters') {
|
||||
$FoundGUID = $_.FullName -match '[\da-zA-Z]{8}-([\da-zA-Z]{4}-){3}[\da-zA-Z]{12}'
|
||||
if ($FoundGUID) {
|
||||
$GUID = $matches[0]
|
||||
$TemporaryStarterPath = "\\$Domain\SYSVOL\$Domain\StarterGPOs\{$GUID}"
|
||||
$Correct = @(
|
||||
[System.IO.Path]::Combine($TemporaryStarterPath, 'StarterGPO.tmplx')
|
||||
[System.IO.Path]::Combine($TemporaryStarterPath, 'en-US', 'StarterGPO.tmpll')
|
||||
foreach ($TypeM in @('Machine', 'User')) {
|
||||
[System.IO.Path]::Combine($TemporaryStarterPath, $TypeM, 'Registry.pol')
|
||||
[System.IO.Path]::Combine($TemporaryStarterPath, $TypeM, 'comment.cmtx')
|
||||
}
|
||||
)
|
||||
if ($_.FullName -in $Correct) {
|
||||
$SuggestedAction = 'Skip assesment'
|
||||
$SuggestedActionComment = 'Correctly placed in SYSVOL'
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
if (-not $SuggestedAction) {
|
||||
$SuggestedAction = 'Requires verification'
|
||||
$SuggestedActionComment = 'Not able to auto asses'
|
||||
}
|
||||
if ($Limited) {
|
||||
$MetaData = [ordered] @{
|
||||
LocationType = $FileType.Name
|
||||
FullName = $_.FullName
|
||||
#Name = $_.Name
|
||||
Extension = $_.Extension
|
||||
SuggestedAction = $SuggestedAction
|
||||
SuggestedActionComment = $SuggestedActionComment
|
||||
BelongsToGPO = $BelongsToGPO
|
||||
GPODisplayName = $GPODisplayName
|
||||
Attributes = $_.Attributes
|
||||
CreationTime = $_.CreationTime
|
||||
LastAccessTime = $_.LastAccessTime
|
||||
LastWriteTime = $_.LastWriteTime
|
||||
}
|
||||
} else {
|
||||
$MetaData = Get-FileMetaData -File $_ -AsHashTable
|
||||
}
|
||||
if ($Signature) {
|
||||
$DigitalSignature = Get-AuthenticodeSignature -FilePath $_.Fullname
|
||||
$MetaData['SignatureStatus'] = $DigitalSignature.Status
|
||||
$MetaData['IsOSBinary'] = $DigitalSignature.IsOSBinary
|
||||
$MetaData['SignatureCertificateSubject'] = $DigitalSignature.SignerCertificate.Subject
|
||||
if ($Extended) {
|
||||
$MetaData['SignatureCertificateIssuer'] = $DigitalSignature.SignerCertificate.Issuer
|
||||
$MetaData['SignatureCertificateSerialNumber'] = $DigitalSignature.SignerCertificate.SerialNumber
|
||||
$MetaData['SignatureCertificateNotBefore'] = $DigitalSignature.SignerCertificate.NotBefore
|
||||
$MetaData['SignatureCertificateNotAfter'] = $DigitalSignature.SignerCertificate.NotAfter
|
||||
$MetaData['SignatureCertificateThumbprint'] = $DigitalSignature.SignerCertificate.Thumbprint
|
||||
}
|
||||
}
|
||||
if ($HashAlgorithm -ne 'None') {
|
||||
$MetaData['ChecksumSHA256'] = (Get-FileHash -LiteralPath $_.FullName -Algorithm $HashAlgorithm).Hash
|
||||
}
|
||||
if ($AsHashTable) {
|
||||
$MetaData
|
||||
} else {
|
||||
[PSCustomObject] $MetaData
|
||||
}
|
||||
}
|
||||
foreach ($e in $err) {
|
||||
Write-Warning "Get-GPOZaurrFiles - $($e.Exception.Message) ($($e.CategoryInfo.Reason))"
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
function Get-GPOZaurrFilesPolicyDefinitions {
|
||||
[cmdletbinding()]
|
||||
param(
|
||||
[alias('ForestName')][string] $Forest,
|
||||
[string[]] $ExcludeDomains,
|
||||
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation,
|
||||
|
||||
[switch] $Signature
|
||||
)
|
||||
$Output = [ordered] @{
|
||||
FilesToDelete = [System.Collections.Generic.List[Object]]::new()
|
||||
}
|
||||
$ForestInformation = Get-WinADForestDetails -Extended -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation
|
||||
$FilesCache = @{}
|
||||
foreach ($Domain in $ForestInformation.Domains) {
|
||||
$Output[$Domain] = [ordered] @{}
|
||||
$FilesCache[$Domain] = [ordered] @{}
|
||||
$Directories = Get-ChildItem -Path "\\$Domain\SYSVOL\$Domain\policies\PolicyDefinitions" -Directory -ErrorAction SilentlyContinue -ErrorVariable err
|
||||
[Array] $Languages = foreach ($Directory in $Directories) {
|
||||
if ($Directory.BaseName.Length -eq 5) {
|
||||
$Directory.BaseName
|
||||
}
|
||||
}
|
||||
$Files = Get-ChildItem -Path "\\$Domain\SYSVOL\$Domain\policies\PolicyDefinitions" -ErrorAction SilentlyContinue -ErrorVariable +err -File #| Select-Object Name, FullName, CreationTime, LastWriteTime, Attributes
|
||||
foreach ($File in $Files) {
|
||||
$FilesCache[$Domain][$($File.BaseName)] = [ordered] @{
|
||||
Name = $File.BaseName
|
||||
FullName = $File.FullName
|
||||
IsReadOnly = $File.IsReadOnly
|
||||
CreationTime = $File.CreationTime
|
||||
LastAccessTime = $File.LastAccessTime
|
||||
LastWriteTime = $File.LastWriteTime
|
||||
IsConsistent = $false
|
||||
}
|
||||
foreach ($Language in $Languages) {
|
||||
$FilesCache[$Domain][$($File.BaseName)][$Language] = $false
|
||||
}
|
||||
if ($Signature) {
|
||||
$DigitalSignature = Get-AuthenticodeSignature -FilePath $File.FullName
|
||||
$FilesCache[$Domain][$($File.BaseName)]['SignatureStatus'] = $DigitalSignature.Status
|
||||
$FilesCache[$Domain][$($File.BaseName)]['SignatureCertificateSubject'] = $DigitalSignature.SignerCertificate.Subject
|
||||
$FilesCache[$Domain][$($File.BaseName)]['SignatureCertificateIssuer'] = $DigitalSignature.SignerCertificate.Issuer
|
||||
$FilesCache[$Domain][$($File.BaseName)]['SignatureCertificateSerialNumber'] = $DigitalSignature.SignerCertificate.SerialNumber
|
||||
$FilesCache[$Domain][$($File.BaseName)]['SignatureCertificateNotBefore'] = $DigitalSignature.SignerCertificate.NotBefore
|
||||
$FilesCache[$Domain][$($File.BaseName)]['SignatureCertificateNotAfter'] = $DigitalSignature.SignerCertificate.NotAfter
|
||||
$FilesCache[$Domain][$($File.BaseName)]['SignatureCertificateThumbprint'] = $DigitalSignature.SignerCertificate.Thumbprint
|
||||
$FilesCache[$Domain][$($File.BaseName)]['IsOSBinary'] = $DigitalSignature.IsOSBinary
|
||||
}
|
||||
}
|
||||
foreach ($Directory in $Directories) {
|
||||
$FilesLanguage = Get-ChildItem -Path $Directory.FullName -ErrorAction SilentlyContinue -ErrorVariable +err
|
||||
foreach ($FileLanguage in $FilesLanguage) {
|
||||
if ($FileLanguage.Extension -eq '.adml') {
|
||||
if ($FilesCache[$Domain][$FileLanguage.BaseName]) {
|
||||
$FilesCache[$Domain][$FileLanguage.BaseName][$Directory.Name] = $true
|
||||
} else {
|
||||
#Write-Warning "Get-GPOZaurrFilesPolicyDefinitions - File $($FileLanguage.FullName) doesn't have a match."
|
||||
$Output.FilesToDelete.Add(
|
||||
[PSCustomobject] @{
|
||||
Name = $FileLanguage.BaseName
|
||||
FullName = $FileLanguage.FullName
|
||||
IsReadOnly = $FileLanguage.IsReadOnly
|
||||
CreationTime = $FileLanguage.CreationTime
|
||||
LastAccessTime = $FileLanguage.LastAccessTime
|
||||
LastWriteTime = $FileLanguage.LastWriteTime
|
||||
}
|
||||
)
|
||||
}
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach ($e in $err) {
|
||||
Write-Warning "Get-GPOZaurrLegacy - $($e.Exception.Message) ($($e.CategoryInfo.Reason))"
|
||||
}
|
||||
$ExcludeProperty = @(
|
||||
'Name', 'FullName', 'IsReadOnly', 'CreationTime', 'LastAccessTime', 'LastWriteTime', 'IsConsistent'
|
||||
'SignatureCertificateSubject', 'SignatureCertificateIssuer', 'SignatureCertificateSerialNumber', 'SignatureCertificateNotBefore'
|
||||
'SignatureCertificateNotAfter', 'SignatureCertificateThumbprint', 'SignatureStatus', 'IsOSBinary'
|
||||
)
|
||||
$Properties = Select-Properties -Objects $FilesCache[$Domain][0] -ExcludeProperty $ExcludeProperty
|
||||
$Output[$Domain] = foreach ($File in $FilesCache[$Domain].Keys) {
|
||||
$Values = foreach ($Property in $Properties) {
|
||||
$FilesCache[$Domain][$File][$Property]
|
||||
}
|
||||
if ($Values -notcontains $false) {
|
||||
$FilesCache[$Domain][$File]['IsConsistent'] = $true
|
||||
}
|
||||
[PSCustomObject] $FilesCache[$Domain][$File]
|
||||
}
|
||||
}
|
||||
$Output
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
function Get-GPOZaurrFolders {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[ValidateSet('All', 'Netlogon', 'Sysvol')][string[]] $Type = 'All',
|
||||
[ValidateSet('All', 'NTFRS', 'Empty')][string] $FolderType = 'All',
|
||||
[alias('ForestName')][string] $Forest,
|
||||
[string[]] $ExcludeDomains,
|
||||
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation,
|
||||
[switch] $AsHashTable
|
||||
)
|
||||
$ForestInformation = Get-WinADForestDetails -Extended -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation
|
||||
foreach ($Domain in $ForestInformation.Domains) {
|
||||
$Path = @(
|
||||
if ($Type -contains 'All') {
|
||||
"\\$Domain\SYSVOL\$Domain"
|
||||
}
|
||||
if ($Type -contains 'Sysvol') {
|
||||
"\\$Domain\SYSVOL\$Domain\policies"
|
||||
}
|
||||
if ($Type -contains 'NetLogon') {
|
||||
"\\$Domain\NETLOGON"
|
||||
}
|
||||
)
|
||||
# Order does matter
|
||||
$Folders = [ordered] @{
|
||||
"\\$Domain\SYSVOL\$Domain\policies\PolicyDefinitions" = @{
|
||||
Name = 'SYSVOL PolicyDefinitions'
|
||||
}
|
||||
"\\$Domain\SYSVOL\$Domain\policies" = @{
|
||||
Name = 'SYSVOL Policies'
|
||||
}
|
||||
"\\$Domain\SYSVOL\$Domain\scripts" = @{
|
||||
Name = 'NETLOGON Scripts'
|
||||
}
|
||||
"\\$Domain\SYSVOL\$Domain\StarterGPOs" = @{
|
||||
Name = 'SYSVOL GPO Starters'
|
||||
}
|
||||
"\\$Domain\NETLOGON" = @{
|
||||
Name = 'NETLOGON Scripts'
|
||||
}
|
||||
"\\$Domain\SYSVOL\$Domain\DfsrPrivate" = @{
|
||||
Name = 'DfsrPrivate'
|
||||
}
|
||||
"\\$Domain\SYSVOL\$Domain" = @{
|
||||
Name = 'SYSVOL Root'
|
||||
}
|
||||
}
|
||||
$Exclusions = @{
|
||||
DfsrPrivate = @{
|
||||
ConflictAndDeleted = $true
|
||||
Deleted = $true
|
||||
Installing = $true
|
||||
}
|
||||
'SYSVOL Policies' = @{
|
||||
User = $true
|
||||
Machine = $true
|
||||
}
|
||||
'NETLOGON Scripts' = @{
|
||||
|
||||
}
|
||||
'SYSVOL Root' = @{
|
||||
|
||||
}
|
||||
'SYSVOL GPO Starters' = @{
|
||||
|
||||
}
|
||||
'SYSVOL PolicyDefinitions' = @{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Get-ChildItem -Path $Path -ErrorAction SilentlyContinue -Recurse -ErrorVariable +err -Force -Directory | ForEach-Object {
|
||||
$FileType = foreach ($Key in $Folders.Keys) {
|
||||
if ($_.FullName -like "$Key*") {
|
||||
$Folders[$Key]
|
||||
break
|
||||
}
|
||||
}
|
||||
$RootFolder = $Folders["$($_.FullName)"]
|
||||
if ($RootFolder) {
|
||||
$IsRootFolder = $true
|
||||
} else {
|
||||
$IsRootFolder = $false
|
||||
}
|
||||
|
||||
$IsExcluded = $Exclusions["$($FileType.Name)"]["$($_.Name)"] -is [bool]
|
||||
if ($IsRootFolder -and $IsExcluded -eq $false) {
|
||||
$IsExcluded = $true
|
||||
}
|
||||
|
||||
$FullFolder = Test-Path -Path "$($_.FullName)\*"
|
||||
$BrokenReplicationRoot = $_.Name -like '*_NTFRS_*'
|
||||
$BrokenReplicationChild = $_.FullName -like '*_NTFRS_*' -and $_.Name -notlike '*_NTFRS_*'
|
||||
$BrokenReplication = $_.FullName -like '*_NTFRS_*'
|
||||
|
||||
$Object = [ordered] @{
|
||||
FolderType = $FileType.Name
|
||||
FullName = $_.FullName
|
||||
IsEmptyFolder = -not $FullFolder
|
||||
IsBrokenReplication = $BrokenReplication
|
||||
IsBrokenReplicationRoot = $BrokenReplicationRoot
|
||||
IsBrokenReplicationChild = $BrokenReplicationChild
|
||||
IsRootFolder = $IsRootFolder
|
||||
IsExcluded = $IsExcluded
|
||||
Name = $_.Name
|
||||
Root = $_.Root
|
||||
Parent = $_.Parent
|
||||
CreationTime = $_.CreationTime
|
||||
LastWriteTime = $_.LastWriteTime
|
||||
Attributes = $_.Attributes
|
||||
DomainName = $Domain
|
||||
}
|
||||
if (-not $Object.IsExcluded) {
|
||||
if ($FolderType -eq 'Empty' -and $Object.IsEmptyFolder -eq $true) {
|
||||
if ($AsHashTable) {
|
||||
$Object
|
||||
} else {
|
||||
[PSCustomObject] $Object
|
||||
}
|
||||
} elseif ($FolderType -eq 'NTFRS' -and $Object.IsBrokenReplicationRoot -eq $true) {
|
||||
if ($AsHashTable) {
|
||||
$Object
|
||||
} else {
|
||||
[PSCustomObject] $Object
|
||||
}
|
||||
} elseif ($FolderType -eq 'All') {
|
||||
if ($AsHashTable) {
|
||||
$Object
|
||||
} else {
|
||||
[PSCustomObject] $Object
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($e in $err) {
|
||||
Write-Warning "Get-GPOZaurrFolders - $($e.Exception.Message) ($($e.CategoryInfo.Reason))"
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,17 @@
|
||||
)
|
||||
$ForestInformation = Get-WinADForestDetails -Extended -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation
|
||||
foreach ($Domain in $ForestInformation.Domains) {
|
||||
Get-ChildItem -Path "\\$Domain\SYSVOL\$Domain\policies" -ErrorAction SilentlyContinue -Recurse -Include '*.adm' -ErrorVariable err | Select-Object Name, FullName, CreationTime, LastWriteTime, Attributes
|
||||
Get-ChildItem -Path "\\$Domain\SYSVOL\$Domain\policies" -ErrorAction SilentlyContinue -Recurse -Include '*.adm', 'admfiles.ini' -ErrorVariable err -Force | ForEach-Object {
|
||||
[PSCustomObject] @{
|
||||
Name = $_.Name
|
||||
FullName = $_.FullName
|
||||
CreationTime = $_.CreationTime
|
||||
LastWriteTime = $_.LastWriteTime
|
||||
Attributes = $_.Attributes
|
||||
DomainName = $Domain
|
||||
DirectoryName = $_.DirectoryName
|
||||
}
|
||||
}
|
||||
foreach ($e in $err) {
|
||||
Write-Warning "Get-GPOZaurrLegacy - $($e.Exception.Message) ($($e.CategoryInfo.Reason))"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
function Get-GPOZaurrSysvolDFSR {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[alias('ForestName')][string] $Forest,
|
||||
[string[]] $ExcludeDomains,
|
||||
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation,
|
||||
[string] $SearchDFSR = 'SYSVOL Share'
|
||||
)
|
||||
$ForestInformation = Get-WinADForestDetails -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation
|
||||
foreach ($Domain in $ForestInformation.Domains) {
|
||||
Write-Verbose "Get-GPOZaurrSysvolDFSR - Processing $Domain"
|
||||
$QueryServer = $ForestInformation['QueryServers']["$Domain"].HostName[0]
|
||||
|
||||
$DFSRConfig = Get-CimInstance -Namespace 'root\microsoftdfs' -Class 'dfsrreplicatedfolderconfig' -ComputerName $QueryServer | Where-Object { $_.ReplicatedFolderName -eq $SearchDFSR }
|
||||
$DFSR = Get-CimInstance -Namespace 'root\microsoftdfs' -Class 'dfsrreplicatedfolderinfo' -ComputerName $QueryServer | Where-Object { $_.ReplicatedFolderName -eq $SearchDFSR }
|
||||
if ($DFSR -and $DFSRConfig -and ($DFSR.ReplicatedFolderGuid -eq $DFSRConfig.ReplicatedFolderGuid)) {
|
||||
[PSCustomObject] @{
|
||||
ComputerName = $DFSR.PSComputerName
|
||||
DomainName = $Domain
|
||||
ConflictPath = $DFSRConfig.ConflictPath
|
||||
LastConflictCleanupTime = $DFSR.LastConflictCleanupTime
|
||||
CurrentConflictSizeInMb = $DFSR.CurrentConflictSizeInMb
|
||||
MaximumConflictSizeInMb = $DFSRConfig.ConflictSizeInMb
|
||||
LastErrorCode = $DFSR.LastErrorCode
|
||||
LastErrorMessageId = $DFSR.LastErrorMessageId
|
||||
LastTombstoneCleanupTime = $DFSR.LastTombstoneCleanupTime
|
||||
ReplicatedFolderGuid = $DFSR.ReplicatedFolderGuid
|
||||
DFSRConfig = $DFSRConfig
|
||||
DFSR = $DFSR
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,4 @@
|
||||
function Get-WMIFilter {
|
||||
param(
|
||||
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
function Get-GPOZaurrWMI {
|
||||
function Get-GPOZaurrWMI {
|
||||
[cmdletBinding()]
|
||||
Param(
|
||||
[Guid[]] $Guid,
|
||||
@@ -15,7 +8,7 @@ function Get-GPOZaurrWMI {
|
||||
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation
|
||||
)
|
||||
$wmiFilterAttr = "msWMI-Name", "msWMI-Parm1", "msWMI-Parm2", "msWMI-Author", "msWMI-ID", 'CanonicalName', 'Created', 'Modified'
|
||||
$wmiFilterAttr = 'msWMI-Name', 'msWMI-Parm1', 'msWMI-Parm2', 'msWMI-Author', 'msWMI-ID', 'CanonicalName', 'Created', 'Modified'
|
||||
|
||||
$ForestInformation = Get-WinADForestDetails -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation
|
||||
foreach ($Domain in $ForestInformation.Domains) {
|
||||
@@ -41,7 +34,7 @@ function Get-GPOZaurrWMI {
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
$ldapFilter = "(objectClass=msWMI-Som)"
|
||||
$ldapFilter = '(objectClass=msWMI-Som)'
|
||||
Get-ADObject -LDAPFilter $ldapFilter -Properties $wmiFilterAttr -Server $QueryServer
|
||||
} catch {
|
||||
Write-Warning "Get-GPOZaurrWMI - Error processing WMI for $Domain`: $($_.Error.Exception)"
|
||||
@@ -66,7 +59,7 @@ function Get-GPOZaurrWMI {
|
||||
#NameSpace = $WMI[$i + 5]
|
||||
#Query = $WMI[$i + 6]
|
||||
QueryCount = $Data.Count
|
||||
Query = $Data -join ","
|
||||
Query = $Data -join ','
|
||||
Author = $_.'msWMI-Author'
|
||||
ID = $_.'msWMI-ID'
|
||||
Created = $_.Created
|
||||
|
||||
+162
-121
@@ -12,34 +12,60 @@
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[string[]] $Type,
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[switch] $NoTranslation,
|
||||
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[string] $Splitter = [System.Environment]::NewLine,
|
||||
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[switch] $FullObjects,
|
||||
|
||||
[ValidateSet('HTML', 'Object')][string] $OutputType = 'Object'
|
||||
<#
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[ValidateSet('HTML', 'Object', 'Excel')][string[]] $OutputType = 'Object',
|
||||
|
||||
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[string] $OutputPath,
|
||||
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[switch] $Open,
|
||||
#>
|
||||
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[switch] $CategoriesOnly,
|
||||
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[switch] $SingleObject,
|
||||
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[switch] $SkipNormalize,
|
||||
|
||||
[Parameter(ParameterSetName = 'Default')]
|
||||
[Parameter(ParameterSetName = 'Local')]
|
||||
[switch] $SkipCleanup
|
||||
)
|
||||
if ($Type.Count -eq 0) {
|
||||
$Type = $Script:GPODitionary.Keys
|
||||
}
|
||||
if ($GPOPath) {
|
||||
if (Test-Path -LiteralPath $GPOPath) {
|
||||
<#
|
||||
$GPOListPath = [io.path]::Combine($GPOPath, "GPOList.xml")
|
||||
if ($GPOListPath) {
|
||||
$GPOs = Import-Clixml -Path $GPOListPath
|
||||
} else {
|
||||
|
||||
}
|
||||
#>
|
||||
$GPOFiles = Get-ChildItem -LiteralPath $GPOPath -Recurse -File
|
||||
$GPOFiles = Get-ChildItem -LiteralPath $GPOPath -Recurse -File -Filter *.xml
|
||||
[Array] $GPOs = foreach ($File in $GPOFiles) {
|
||||
if ($File.Name -ne 'GPOList.xml') {
|
||||
[xml] $GPORead = Get-Content -LiteralPath $File.FullName
|
||||
try {
|
||||
[xml] $GPORead = Get-Content -LiteralPath $File.FullName
|
||||
} catch {
|
||||
Write-Warning "Invoke-GPOZaurr - Couldn't process $($File.FullName) error: $($_.Exception.message)"
|
||||
continue
|
||||
}
|
||||
[PSCustomObject] @{
|
||||
DisplayName = $GPORead.GPO.Name
|
||||
DomainName = $GPORead.GPO.Identifier.Domain.'#text'
|
||||
@@ -49,127 +75,142 @@
|
||||
}
|
||||
}
|
||||
} else {
|
||||
Write-Warning "Find-GPO - $GPOPath doesn't exists."
|
||||
Write-Warning "Invoke-GPOZaurr - $GPOPath doesn't exists."
|
||||
return
|
||||
}
|
||||
} else {
|
||||
[Array] $GPOs = Get-GPOZaurrAD -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation
|
||||
}
|
||||
# This caches single reports.
|
||||
$TemporaryCachedSingleReports = [ordered] @{}
|
||||
$TemporaryCachedSingleReports['ReportsSingle'] = [ordered] @{}
|
||||
# This will be returned
|
||||
$Output = [ordered] @{}
|
||||
foreach ($T in $Type) {
|
||||
# $Output[$T] = [System.Collections.Generic.List[PSCustomObject]]::new()
|
||||
}
|
||||
foreach ($GPO in $GPOs) {
|
||||
$Output['Reports'] = [ordered] @{}
|
||||
$Output['CategoriesFull'] = [ordered] @{}
|
||||
|
||||
[Array] $GPOCategories = foreach ($GPO in $GPOs) {
|
||||
if ($GPOPath) {
|
||||
$GPOOutput = $GPO.GPOOutput
|
||||
} else {
|
||||
[xml] $GPOOutput = Get-GPOReport -Guid $GPO.GUID -Domain $GPO.DomainName -ReportType Xml
|
||||
}
|
||||
<#
|
||||
[PSCustomobject] @{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
ComputerEnabled = $GPOOutput.GPO.Computer.Enabled
|
||||
ComputerEmpty = if ($GPOOutput.GPO.Computer.ExtensionData) { $false } else { $true }
|
||||
ComputerPolicies = $GPOOutput.GPO.Computer.ExtensionData.Name -join ", "
|
||||
UserEnabled = $GPOOutput.GPO.User.Enabled
|
||||
UserEmpty = if ($GPOOutput.GPO.User.ExtensionData) { $false } else { $true }
|
||||
UserPolicies = $GPOOutput.GPO.User.ExtensionData.Name -join ", "
|
||||
}
|
||||
#>
|
||||
|
||||
|
||||
#$GPOStoredTypes = Get-XMLGPOTypes -GPOOutput $GPOOutput.GPO
|
||||
|
||||
[Array] $Data = Get-XMLStandard -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
if (-not $Output["$($D.GpoCategory)"]) {
|
||||
$Output["$($D.GpoCategory)"] = [ordered] @{}
|
||||
}
|
||||
if (-not $Output["$($D.GpoCategory)"]["$($D.GpoSettings)"]) {
|
||||
$Output["$($D.GpoCategory)"]["$($D.GpoSettings)"] = [System.Collections.Generic.List[PSCustomObject]]::new()
|
||||
}
|
||||
$Output["$($D.GpoCategory)"]["$($D.GpoSettings)"].Add($D)
|
||||
}
|
||||
<#
|
||||
continue
|
||||
|
||||
if ($Type -contains 'RegistrySettings') {
|
||||
[Array] $Data = Get-XMLRegistrySettings -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
$Output['RegistrySettings'].Add($D)
|
||||
}
|
||||
}
|
||||
if ($Type -contains 'RegistryPolicies') {
|
||||
[Array] $Data = Get-XMLRegistryPolicies -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
$Output['RegistryPolicies'].Add($D)
|
||||
}
|
||||
}
|
||||
if ($Type -contains 'LocalUsersAndGroups') {
|
||||
[Array] $Data = Get-XMLLocalUserGroups -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
$Output['LocalUsersAndGroups'].Add($D)
|
||||
}
|
||||
}
|
||||
if ($Type -contains 'AutoLogon') {
|
||||
[Array] $Data = Get-XMLAutologon -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
$Output['AutoLogon'].Add($D)
|
||||
}
|
||||
}
|
||||
if ($Type -contains 'Scripts') {
|
||||
[Array] $Data = Get-XMLScripts -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
$Output['Scripts'].Add($D)
|
||||
}
|
||||
}
|
||||
if ($Type -contains 'SoftwareInstallation') {
|
||||
[Array] $Data = Get-XMLSoftwareInstallation -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
$Output['SoftwareInstallation'].Add($D)
|
||||
}
|
||||
}
|
||||
if ($Type -contains 'SecurityOptions') {
|
||||
[Array] $Data = Get-XMLSecurityOptions -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
$Output['SecurityOptions'].Add($D)
|
||||
}
|
||||
}
|
||||
if ($Type -contains 'Account') {
|
||||
[Array] $Data = Get-XMLAccount -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
$Output['Account'].Add($D)
|
||||
}
|
||||
}
|
||||
if ($Type -contains 'SystemServices') {
|
||||
[Array] $Data = Get-XMLSystemServices -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects
|
||||
foreach ($D in $Data) {
|
||||
$Output['SystemServices'].Add($D)
|
||||
}
|
||||
}
|
||||
#>
|
||||
Get-GPOCategories -GPO $GPO -GPOOutput $GPOOutput.GPO -Splitter $Splitter -FullObjects:$FullObjects -CachedCategories $Output['CategoriesFull']
|
||||
}
|
||||
if ($NoTranslation) {
|
||||
$Output
|
||||
} else {
|
||||
$TranslatedOutput = [ordered] @{}
|
||||
$Output['Categories'] = $GPOCategories | Select-Object -Property * -ExcludeProperty DataSet
|
||||
if ($CategoriesOnly) {
|
||||
# Return Categories only
|
||||
return $Output['Categories']
|
||||
}
|
||||
# We check our dictionary for reports that are based on reports to make sure we run CodeSingle separatly
|
||||
[Array] $FindRequiredSingle = foreach ($Key in $Script:GPODitionary.Keys) {
|
||||
$Script:GPODitionary[$Key].ByReports.Report
|
||||
}
|
||||
# Build reports based on categories
|
||||
if ($Output['CategoriesFull'].Count -gt 0) {
|
||||
foreach ($Report in $Type) {
|
||||
$Category = $Script:GPODitionary[$Report]['Category']
|
||||
$Settings = $Script:GPODitionary[$Report]['Settings']
|
||||
|
||||
#if (-not $TranslatedOutput[$Report]) {
|
||||
# $TranslatedOutput[$Report] = [ordered] @{}
|
||||
#}
|
||||
#foreach ($Setting in $Settings) {
|
||||
# if (-not $TranslatedOutput[$Category][$Settings]) {
|
||||
# $TranslatedOutput[$Category][$Settings] = [ordered] @{}
|
||||
# }
|
||||
$TranslatedOutput[$Report] = Invoke-GPOTranslation -InputData $Output -Category $Category -Settings $Settings -Report $Report
|
||||
#}
|
||||
foreach ($CategoryType in $Script:GPODitionary[$Report].Types) {
|
||||
$Category = $CategoryType.Category
|
||||
$Settings = $CategoryType.Settings
|
||||
# Those are checks for making sure we have data to be even able to process it
|
||||
if (-not $Output['CategoriesFull'][$Category]) {
|
||||
continue
|
||||
}
|
||||
if (-not $Output['CategoriesFull'][$Category][$Settings]) {
|
||||
continue
|
||||
}
|
||||
# Translation
|
||||
$CategorizedGPO = $Output['CategoriesFull'][$Category][$Settings]
|
||||
foreach ($GPO in $CategorizedGPO) {
|
||||
if (-not $Output['Reports'][$Report]) {
|
||||
$Output['Reports'][$Report] = [System.Collections.Generic.List[PSCustomObject]]::new()
|
||||
}
|
||||
# Create temporary storage for "single gpo" reports
|
||||
# it's required if we want to base reports on other reports later on
|
||||
if (-not $TemporaryCachedSingleReports['ReportsSingle'][$Report]) {
|
||||
$TemporaryCachedSingleReports['ReportsSingle'][$Report] = [System.Collections.Generic.List[PSCustomObject]]::new()
|
||||
}
|
||||
# Make sure translated gpo is null
|
||||
$TranslatedGpo = $null
|
||||
if ($SingleObject -or ($Report -in $FindRequiredSingle)) {
|
||||
# We either create 1 GPO with multiple settings to return it as user requested it
|
||||
# Or we process it only because we need to base it for reports based on other reports
|
||||
if (-not $Script:GPODitionary[$Report]['CodeSingle']) {
|
||||
# sometimes code and code single are identical. To not define things two times, one can just skip it
|
||||
If ($Script:GPODitionary[$Report]['Code']) {
|
||||
$Script:GPODitionary[$Report]['CodeSingle'] = $Script:GPODitionary[$Report]['Code']
|
||||
}
|
||||
}
|
||||
if ($Script:GPODitionary[$Report]['CodeSingle']) {
|
||||
$TranslatedGpo = Invoke-Command -ScriptBlock $Script:GPODitionary[$Report]['CodeSingle']
|
||||
if ($Report -in $FindRequiredSingle) {
|
||||
foreach ($T in $TranslatedGpo) {
|
||||
$TemporaryCachedSingleReports['ReportsSingle'][$Report].Add($T)
|
||||
}
|
||||
}
|
||||
if ($SingleObject) {
|
||||
foreach ($T in $TranslatedGpo) {
|
||||
$Output['Reports'][$Report].Add($T)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (-not $SingleObject) {
|
||||
# We want each GPO to be listed multiple times if it makes sense for reporting
|
||||
# think drive mapping - showing 1 mapping of a drive per object even if there are 50 drive mappings within 1 gpo
|
||||
# this would result in 50 objects created
|
||||
if ($Script:GPODitionary[$Report]['Code']) {
|
||||
$TranslatedGpo = Invoke-Command -ScriptBlock $Script:GPODitionary[$Report]['Code']
|
||||
foreach ($T in $TranslatedGpo) {
|
||||
$Output['Reports'][$Report].Add($T)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$TranslatedOutput
|
||||
}
|
||||
# Those reports are based on other reports (for example already processed registry settings)
|
||||
# This is useful where going thru registry collections may not be efficient enough to try and read it directly again
|
||||
foreach ($Report in $Type) {
|
||||
foreach ($ReportType in $Script:GPODitionary[$Report].ByReports) {
|
||||
if (-not $Output['Reports'][$Report]) {
|
||||
$Output['Reports'][$Report] = [System.Collections.Generic.List[PSCustomObject]]::new()
|
||||
}
|
||||
$FindReport = $ReportType.Report
|
||||
foreach ($GPO in $TemporaryCachedSingleReports['ReportsSingle'][$FindReport]) {
|
||||
$TranslatedGpo = Invoke-Command -ScriptBlock $Script:GPODitionary[$Report]['CodeReport']
|
||||
foreach ($T in $TranslatedGpo) {
|
||||
$Output['Reports'][$Report].Add($T)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
# Normalize - meaning that before we return each GPO report we make sure that each entry has the same column names regardless which one is first.
|
||||
# Normally if you would have a GPO with just 2 entries for given subject (say LAPS), and then another GPO having 5 settings for the same type
|
||||
# and you would display them one after another - all entries would be shown using first object which has less properties then 2nd or 3rd object
|
||||
# to make sure all objects are having same (even empty) properties we "normalize" it
|
||||
if (-not $SkipNormalize) {
|
||||
foreach ($Report in [string[]] $Output['Reports'].Keys) {
|
||||
$Properties = $Output['Reports'][$Report] | Select-Properties -ExcludeProperty DisplayName, DomainName, GUID, GpoType, Linked, LinksCount, Links -AllProperties -WarningAction SilentlyContinue
|
||||
$DisplayProperties = @(
|
||||
'DisplayName', 'DomainName', 'GUID', 'GpoType'
|
||||
foreach ($Property in $Properties) {
|
||||
$Property
|
||||
}
|
||||
'Linked', 'LinksCount', 'Links'
|
||||
)
|
||||
$Output['Reports'][$Report] = $Output['Reports'][$Report] | Select-Object -Property $DisplayProperties
|
||||
}
|
||||
}
|
||||
|
||||
$Output['PoliciesTotal'] = $Output.Reports.Policies.PolicyCategory | Group-Object | Select-Object Name, Count | Sort-Object -Property Name #-Descending
|
||||
#$Output['PoliciesTotal'] = $Output.Reports.Policies.PolicyCategory | Group-Object | Select-Object Name, Count | Sort-Object -Property Count -Descending
|
||||
|
||||
if (-not $SkipCleanup) {
|
||||
Remove-EmptyValue -Hashtable $Output -Recursive
|
||||
}
|
||||
return $Output
|
||||
}
|
||||
|
||||
[scriptblock] $SourcesAutoCompleter = {
|
||||
@@ -177,4 +218,4 @@
|
||||
|
||||
$Script:GPODitionary.Keys | Sort-Object | Where-Object { $_ -like "*$wordToComplete*" }
|
||||
}
|
||||
Register-ArgumentCompleter -CommandName Find-GPO -ParameterName Type -ScriptBlock $SourcesAutoCompleter
|
||||
Register-ArgumentCompleter -CommandName Invoke-GPOZaurr -ParameterName Type -ScriptBlock $SourcesAutoCompleter
|
||||
@@ -0,0 +1,62 @@
|
||||
function Remove-GPOZaurrFolders {
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[string] $BackupPath,
|
||||
[switch] $BackupDated,
|
||||
[ValidateSet('All', 'Netlogon', 'Sysvol')][string[]] $Type = 'All',
|
||||
[Parameter(Mandatory)][ValidateSet('NTFRS', 'Empty')][string] $FolderType,
|
||||
[string[]] $FolderName,
|
||||
[int] $LimitProcessing = [int32]::MaxValue,
|
||||
[alias('ForestName')][string] $Forest,
|
||||
[string[]] $ExcludeDomains,
|
||||
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation
|
||||
)
|
||||
if ($BackupPath) {
|
||||
if ($BackupDated) {
|
||||
$BackupFinalPath = "$BackupPath\$((Get-Date).ToString('yyyy-MM-dd_HH_mm_ss'))"
|
||||
} else {
|
||||
$BackupFinalPath = $BackupPath
|
||||
}
|
||||
} else {
|
||||
$BackupFinalPath = ''
|
||||
}
|
||||
|
||||
Get-GPOZaurrFolders -Type $Type -FolderType $FolderType -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation | Where-Object {
|
||||
if ($FolderName) {
|
||||
foreach ($Folder in $FolderName) {
|
||||
if ($_.Name -eq $Folder) {
|
||||
$_
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$_
|
||||
}
|
||||
} | Select-Object | Select-Object -First $LimitProcessing | ForEach-Object {
|
||||
if ($BackupFinalPath) {
|
||||
$SYSVOLRoot = "\\$($_.DomainName)\SYSVOL\$($_.DomainName)\"
|
||||
$DestinationFile = ($_.FullName).Replace($SYSVOLRoot, '')
|
||||
#$DestinationMissingFolder = $DestinationFile.Replace($DestinationFile, '')
|
||||
$DestinationFilePath = [system.io.path]::Combine($BackupFinalPath, $DestinationFile)
|
||||
#$DestinationFolderPath = [system.io.path]::Combine($BackupFinalPath, $DestinationMissingFolder)
|
||||
|
||||
Write-Verbose "Remove-GPOZaurrFolders - Backing up $($_.FullName)"
|
||||
Try {
|
||||
Copy-Item -LiteralPath $_.FullName -Recurse -Destination $DestinationFilePath -ErrorAction Stop -Force
|
||||
$BackupWorked = $true
|
||||
} catch {
|
||||
Write-Warning "Remove-GPOZaurrFolders - Error backing up error: $($_.Exception.Message)"
|
||||
$BackupWorked = $false
|
||||
}
|
||||
|
||||
}
|
||||
if ($BackupWorked -or $BackupFinalPath -eq '') {
|
||||
try {
|
||||
Write-Verbose "Remove-GPOZaurrFolders - Removing $($_.FullName)"
|
||||
Remove-Item -Path $_.FullName -Force -Recurse
|
||||
} catch {
|
||||
Write-Warning "Remove-GPOZaurrFolders - Failed to remove directory $($_.FullName): $($_.Exception.Message)."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,24 @@
|
||||
function Remove-GPOZaurrLegacyFiles {
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[string] $BackupPath,
|
||||
[switch] $BackupDated,
|
||||
[switch] $RemoveEmptyFolders,
|
||||
[alias('ForestName')][string] $Forest,
|
||||
[string[]] $ExcludeDomains,
|
||||
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
||||
|
||||
[int] $LimitProcessing = [int32]::MaxValue
|
||||
)
|
||||
if ($BackupPath) {
|
||||
if ($BackupDated) {
|
||||
$BackupFinalPath = "$BackupPath\$((Get-Date).ToString('yyyy-MM-dd_HH_mm_ss'))"
|
||||
} else {
|
||||
$BackupFinalPath = $BackupPath
|
||||
}
|
||||
} else {
|
||||
$BackupFinalPath = ''
|
||||
}
|
||||
$Splat = @{
|
||||
Forest = $Forest
|
||||
IncludeDomains = $IncludeDomains
|
||||
@@ -14,12 +26,63 @@
|
||||
ExtendedForestInformation = $ExtendedForestInformation
|
||||
Verbose = $VerbosePreference
|
||||
}
|
||||
Get-GPOZaurrLegacyFiles @Splat | Select-Object -First $LimitProcessing | ForEach-Object {
|
||||
try {
|
||||
Remove-Item -Path $_.FullName -ErrorAction Stop
|
||||
} catch {
|
||||
$ErrorMessage = $_.Exception.Message
|
||||
Write-Warning "Remove-GPOZaurrLegacyFiles - Failed to remove file $($_.FullName): $($ErrorMessage)."
|
||||
[Array] $Deleted = Get-GPOZaurrLegacyFiles @Splat | Select-Object -First $LimitProcessing | ForEach-Object {
|
||||
Write-Verbose "Remove-GPOZaurrLegacyFiles - Processing $($_.FullName)"
|
||||
if ($BackupFinalPath) {
|
||||
$SYSVOLRoot = "\\$($_.DomainName)\SYSVOL\$($_.DomainName)\policies\"
|
||||
$DestinationFile = ($_.FullName).Replace($SYSVOLRoot, '')
|
||||
#$DestinationMissingFolder = $DestinationFile.Replace($DestinationFile, '')
|
||||
$DestinationFilePath = [system.io.path]::Combine($BackupFinalPath, $DestinationFile)
|
||||
#$DestinationFolderPath = [system.io.path]::Combine($BackupFinalPath, $DestinationMissingFolder)
|
||||
|
||||
Write-Verbose "Remove-GPOZaurrLegacyFiles - Backing up $($_.FullName)"
|
||||
$Created = New-Item -ItemType File -Path $DestinationFilePath -Force
|
||||
if ($Created) {
|
||||
Try {
|
||||
Copy-Item -LiteralPath $_.FullName -Recurse -Destination $DestinationFilePath -ErrorAction Stop -Force
|
||||
$BackupWorked = $true
|
||||
} catch {
|
||||
Write-Warning "Remove-GPOZaurrLegacyFiles - Error backing up error: $($_.Exception.Message)"
|
||||
$BackupWorked = $false
|
||||
}
|
||||
} else {
|
||||
$BackupWorked = $false
|
||||
}
|
||||
}
|
||||
if ($BackupWorked -or $BackupFinalPath -eq '') {
|
||||
try {
|
||||
Write-Verbose "Remove-GPOZaurrLegacyFiles - Deleting $($_.FullName)"
|
||||
Remove-Item -Path $_.FullName -ErrorAction Stop -Force
|
||||
$_
|
||||
} catch {
|
||||
Write-Warning "Remove-GPOZaurrLegacyFiles - Failed to remove file $($_.FullName): $($_.Exception.Message)."
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($Deleted.Count -gt 0) {
|
||||
if ($RemoveEmptyFolders) {
|
||||
$FoldersToCheck = $Deleted.DirectoryName | Sort-Object -Unique
|
||||
foreach ($Folder in $FoldersToCheck) {
|
||||
$FolderName = $Folder.Substring($Folder.Length - 4)
|
||||
if ($FolderName -eq '\Adm') {
|
||||
try {
|
||||
$MeasureCount = Get-ChildItem -LiteralPath $Folder -Force -ErrorAction Stop | Select-Object -First 1 | Measure-Object
|
||||
} catch {
|
||||
Write-Warning "Remove-GPOZaurrLegacyFiles - Couldn't verify if folder $Folder is empty. Skipping. Error: $($_.Exception.Message)."
|
||||
continue
|
||||
}
|
||||
if ($MeasureCount.Count -eq 0) {
|
||||
Write-Verbose "Remove-GPOZaurrLegacyFiles - Deleting empty folder $($Folder)"
|
||||
try {
|
||||
Remove-Item -LiteralPath $Folder -Force -Recurse:$false
|
||||
} catch {
|
||||
Write-Warning "Remove-GPOZaurrLegacyFiles - Failed to remove folder $($Folder): $($_.Exception.Message)."
|
||||
}
|
||||
} else {
|
||||
Write-Verbose "Remove-GPOZaurrLegacyFiles - Skipping not empty folder from deletion $($Folder)"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,48 @@
|
||||
function Remove-GPOZaurrOrphanedSysvolFolders {
|
||||
[cmdletBinding(SupportsShouldProcess)]
|
||||
param(
|
||||
[int] $LimitProcessing = [int32]::MaxValue
|
||||
[string] $BackupPath,
|
||||
[switch] $BackupDated,
|
||||
[int] $LimitProcessing = [int32]::MaxValue,
|
||||
|
||||
[alias('ForestName')][string] $Forest,
|
||||
[string[]] $ExcludeDomains,
|
||||
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation
|
||||
)
|
||||
Get-GPOZaurrSysvol | Where-Object {
|
||||
if ($BackupPath) {
|
||||
if ($BackupDated) {
|
||||
$BackupFinalPath = "$BackupPath\$((Get-Date).ToString('yyyy-MM-dd_HH_mm_ss'))"
|
||||
} else {
|
||||
$BackupFinalPath = $BackupPath
|
||||
}
|
||||
} else {
|
||||
$BackupFinalPath = ''
|
||||
}
|
||||
Get-GPOZaurrSysvol -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation | Where-Object {
|
||||
if ($_.Status -eq 'Orphaned GPO') {
|
||||
$_
|
||||
}
|
||||
} | Select-Object | Select-Object -First $LimitProcessing | ForEach-Object {
|
||||
Remove-Item -Recurse -Force -LiteralPath $_.Path
|
||||
Write-Verbose "Remove-GPOZaurrOrphanedSysvolFolders - Processing $($_.Path)"
|
||||
if ($BackupFinalPath) {
|
||||
Try {
|
||||
Write-Verbose "Remove-GPOZaurrOrphanedSysvolFolders - Backing up $($_.Path)"
|
||||
Copy-Item -LiteralPath $_.Path -Recurse -Destination $BackupFinalPath -ErrorAction Stop
|
||||
$BackupWorked = $true
|
||||
} catch {
|
||||
Write-Warning "Remove-GPOZaurrOrphanedSysvolFolders - Error backing up error: $($_.Exception.Message)"
|
||||
$BackupWorked = $false
|
||||
}
|
||||
}
|
||||
if ($BackupWorked -or $BackupFinalPath -eq '') {
|
||||
Write-Verbose "Remove-GPOZaurrOrphanedSysvolFolders - Deleting $($_.Path)"
|
||||
try {
|
||||
Remove-Item -Recurse -Force -LiteralPath $_.Path
|
||||
} catch {
|
||||
$ErrorMessage = $_.Exception.Message
|
||||
Write-Warning "Remove-GPOZaurrOrphanedSysvolFolders - Failed to remove file $($_.Path): $($ErrorMessage)."
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
function Select-GPOTranslation {
|
||||
[cmdletbInding()]
|
||||
param(
|
||||
[Parameter(ValueFromPipeline)][System.Collections.IDictionary] $InputObject,
|
||||
[string] $Category,
|
||||
[string] $Settings
|
||||
)
|
||||
|
||||
$Important = [ordered] @{}
|
||||
$AllProperties = Select-Properties -AllProperties -Objects $InputObject.$Category.$Settings
|
||||
$MissingProperties = $AllProperties | Where-Object { $_ -notin 'DisplayName', 'DomainName', 'GUID', 'Linked', 'LinksCount', 'Links', 'GPOType', 'GPOCategory', 'GPOSettings' }
|
||||
$Types = foreach ($Property in $MissingProperties) {
|
||||
($InputObject.$Category.$Settings | Where-Object { $null -ne $_.$Property }).$Property | ForEach-Object {
|
||||
($_ | Get-Member -MemberType Properties) | Where-Object { $_.Name -notin 'Length' }
|
||||
}
|
||||
}
|
||||
$Important['AllProperties'] = $AllProperties
|
||||
$Important['MissingProperties'] = $MissingProperties
|
||||
$Important['Types'] = $Types | Select-Object -Unique
|
||||
$Important['Data'] = $InputObject.$Category.$Settings
|
||||
$Important
|
||||
}
|
||||
@@ -39,6 +39,23 @@ That's it. Whenever there's a new version, you run the command, and you can enjo
|
||||
|
||||
## Changelog
|
||||
|
||||
- 0.0.51 - 2.08.2020
|
||||
- Updates to `Invoke-GPOZaurr` - still work in progress
|
||||
- Added `Get-GPOZaurrSysvolDFSR`
|
||||
- Added `Clear-GPOZaurrSysvolDFSR` (requires testing)
|
||||
- 0.0.50 - 29.07.2020
|
||||
- Updates to couple of commands
|
||||
- 0.0.49 - 23.07.2020
|
||||
- Hidden files were skipped - and people do crazy things with them
|
||||
- 0.0.48 - 21.07.2020
|
||||
- Added `Get-GPOZaurrFilesPolicyDefinitions`
|
||||
- Updates to `Invoke-GPOZaurr` - still work in progress
|
||||
- Updates to `Get-GPOZaurrFiles` - still work in progress
|
||||
- Updates to `Remove-GPOZaurrOrphanedSysvolFolders` with backup and support for domains
|
||||
- Module will now be signed
|
||||
- 0.0.47 - 29.06.2020
|
||||
- Update to `Get-GPOZaurrAD` for better error reporting
|
||||
- Updates to `Invoke-GPOZaurr` - still work in progress
|
||||
- 0.0.46 - 28.06.2020
|
||||
- Additional protection for `Get-GPOZaurrAD` for CNF duplicates
|
||||
- Update to `Save-GPOZaurrFiles`
|
||||
|
||||
Reference in New Issue
Block a user