mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-08-11 11:16:55 +00:00
Added LAPS support
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
function ConvertTo-XMLLaps {
|
||||
[cmdletBinding()]
|
||||
param(
|
||||
[PSCustomObject] $GPO
|
||||
)
|
||||
$CreateGPO = [ordered]@{
|
||||
DisplayName = $GPO.DisplayName
|
||||
DomainName = $GPO.DomainName
|
||||
GUID = $GPO.GUID
|
||||
GpoType = $GPO.GpoType
|
||||
#GpoCategory = $GPOEntry.GpoCategory
|
||||
#GpoSettings = $GPOEntry.GpoSettings
|
||||
'EnableLocalAdminPasswordManagement' = 'Not set'
|
||||
'PasswordSettings' = 'Not set'
|
||||
'PasswordComplexity' = $null
|
||||
'PasswordLength' = $null
|
||||
'PasswordAge(Days)' = $null
|
||||
'AdministratorAccountName' = $null
|
||||
'NameOfAdministratorAccountToManage' = 'Not set'
|
||||
'DoNotAllowPasswordExpirationTimeLongerThanRequiredByPolicy' = 'Not set'
|
||||
}
|
||||
if ($GPO.DataSet.Category -eq 'LAPS') {
|
||||
foreach ($Policy in $GPO.DataSet) {
|
||||
if ($Policy.Category -eq 'LAPS') {
|
||||
foreach ($Setting in @('DropDownList', 'Numeric', 'EditText')) {
|
||||
if ($Policy.$Setting) {
|
||||
foreach ($Value in $Policy.$Setting) {
|
||||
$Name = Format-ToTitleCase -Text $Value.Name -RemoveWhiteSpace
|
||||
if ($Value.Value -is [string]) {
|
||||
$CreateGPO["$Name"] = $Value.Value
|
||||
} else {
|
||||
$CreateGPO["$Name"] = $Value.Value.Name
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$Name = (Format-ToTitleCase -Text $Policy.Name -RemoveWhiteSpace)
|
||||
$CreateGPO[$Name] = $Policy.State
|
||||
}
|
||||
}
|
||||
$CreateGPO['Linked'] = $GPO.Linked
|
||||
$CreateGPO['LinksCount'] = $GPO.LinksCount
|
||||
$CreateGPO['Links'] = $GPO.Links
|
||||
[PSCustomObject] $CreateGPO
|
||||
}
|
||||
}
|
||||
@@ -92,6 +92,20 @@
|
||||
ConvertTo-XMLEventLog -GPO $GPO
|
||||
}
|
||||
}
|
||||
LAPS = @{
|
||||
Types = @(
|
||||
@{
|
||||
Category = 'RegistrySettings'
|
||||
Settings = 'Policy'
|
||||
}
|
||||
)
|
||||
Code = {
|
||||
ConvertTo-XMLLaps -GPO $GPO
|
||||
}
|
||||
CodeSingle = {
|
||||
ConvertTo-XMLLaps -GPO $GPO
|
||||
}
|
||||
}
|
||||
LocalUsers = [ordered] @{
|
||||
Types = @(
|
||||
@{
|
||||
|
||||
Reference in New Issue
Block a user