misc/settingsTest.txt
$JSON = $([ordered]@{
Description = "PS.RAD Settings" SchemaVer = "1" OID = (get-date).toFileTime() URL = "https://www.breakwaterlabs.net" Repo = "https://www.gitlab.com/...." Version = "1.1.0" InstallDate = (get-date) OUPaths = @{ RADRoot = "OU=RAD,DC=Lab0,DC=Local" GlobalBase = "OU=RAD,DC=Lab0,DC=Local" OrgBase = "OU=Orgs,OU=RAD,DC=Lab0,DC=Local" } FilePaths = @{ JSON = "\\lab0.local\SYSVOL\..." LDIF = "\\lab0.local\SYSVOL\..." Settings = "\\lab0.local\SYSVOL\..." } Names = @{ Global = "Global" Orgs = "Orgs" Components = "Components" Computers = "Endpoints" Rights = "Rights" Roles = "Roles" Users = "Users" Admins = "Admins" } Modules = @{ PKI = @{ Version = "1.1.0" InstallDate = (get-date) SettingsPath = "...." } } })| convertto-json -compress set-adobject 'CN=PS.RAD-Settings,OU=Orgs,DC=lab0,DC=local' -Replace @{'msDS-Settings'="PS.RAD=$JSON"} $Settings = [System.Collections.Specialized.OrderedDictionary]::new() $Settings = ((get-adobject -filter "name -eq 'PS.RAD-Settings'" -properties "msDS-Settings").'msds-settings'.valuelist.where{$_ -like "P*"}.replace("PS.RAD=","") | ConvertFrom-Json) |