mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-07-26 11:49:17 +00:00
Update
This commit is contained in:
@@ -6,10 +6,11 @@
|
||||
[alias('ForestName')][string] $Forest,
|
||||
[string[]] $ExcludeDomains,
|
||||
[alias('Domain', 'Domains')][string[]] $IncludeDomains,
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation,
|
||||
[switch] $AsHashtable
|
||||
)
|
||||
$Dictionary = [ordered] @{}
|
||||
$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) {
|
||||
$QueryServer = $ForestInformation['QueryServers'][$Domain]['HostName'][0]
|
||||
@@ -52,7 +53,7 @@
|
||||
-join ($WMI[$i + 5], ';' , $WMI[$i + 6])
|
||||
}
|
||||
}
|
||||
[PSCustomObject] @{
|
||||
$WMIObject = [PSCustomObject] @{
|
||||
DisplayName = $_.'msWMI-Name'
|
||||
Description = $_.'msWMI-Parm1'
|
||||
DomainName = $Domain
|
||||
@@ -68,9 +69,17 @@
|
||||
CanonicalName = $_.CanonicalName
|
||||
DistinguishedName = $_.'DistinguishedName'
|
||||
}
|
||||
if (-not $AsHashtable) {
|
||||
$WMIObject
|
||||
} else {
|
||||
$Dictionary[$WMIObject.ID] = $WMIObject
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
if ($AsHashtable) {
|
||||
$Dictionary
|
||||
}
|
||||
}
|
||||
<#
|
||||
CanonicalName : ad.evotec.xyz/System/WMIPolicy/SOM/{E988C890-BDBC-4946-87B5-BF70F39F4686}
|
||||
|
||||
@@ -52,13 +52,14 @@
|
||||
}
|
||||
try {
|
||||
#Write-Verbose "Request-GPOZaurr - ComputerName: $($SplatPolicy['Computer']) UserName: $($SplatPolicy['User'])"
|
||||
$ResultantSetPolicy = Get-GPResultantSetOfPolicy @SplatPolicy
|
||||
$ResultantSetPolicy = Get-GPResultantSetOfPolicy @SplatPolicy -ErrorAction Stop
|
||||
} catch {
|
||||
if ($_.Exception.Message -eq 'Exception from HRESULT: 0x80041003') {
|
||||
Write-Warning "Request-GPOZaurr - Are you running as admin? $($_.Exception.Message)"
|
||||
return
|
||||
} else {
|
||||
Write-Warning "Request-GPOZaurr - Error: $($_.Exception.Message)"
|
||||
$ErrorMessage = $($_.Exception.Message).Replace([Environment]::NewLine, ' ')
|
||||
Write-Warning "Request-GPOZaurr - Error: $ErrorMessage"
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -100,9 +101,11 @@
|
||||
if ($PolicyContent.Rsop.UserResults) {
|
||||
$Output.UserResults = ConvertFrom-XMLRSOP -Content $PolicyContent.Rsop -ResultantSetPolicy $ResultantSetPolicy -ResultsType 'UserResults' -Splitter $Splitter
|
||||
}
|
||||
if ($Type -eq 'Object') {
|
||||
|
||||
New-GPOZaurrReportConsole -Results $Output
|
||||
if ($Type -contains 'Object') {
|
||||
$Output
|
||||
} elseif ($Type -eq 'HTML') {
|
||||
} elseif ($Type -contains 'HTML') {
|
||||
New-GPOZaurrReportHTML -Path $Path -Offline:$Offline -Open:(-not $PreventShow) -Support $Output
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user