mirror of
https://github.com/EvotecIT/GPOZaurr.git
synced 2026-07-26 11:49:17 +00:00
Update
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
|
||||
|
||||
Get-GPOZaurrSysvol -Verbose | Format-Table
|
||||
Get-GPOZaurrSysvol -Verbose | Format-Table
|
||||
#Get-GPOZaurrSysvol | Out-HtmlView -ScrollX
|
||||
@@ -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 -IncludeDomains 'ad.evotec.xyz'
|
||||
Remove-GPOZaurrOrphaned -Verbose -WhatIf -IncludeDomains 'ad.evotec.xyz' #-LimitProcessing 2
|
||||
|
||||
# this runs for whole SYSVOL and checks things against GPOS
|
||||
Remove-GPOZaurrOrphanedSysvolFolders -Verbose -IncludeDomains 'ad.evotec.xyz' -BackupPath $Env:UserProfile\Desktop\MyBackup1 #-WhatIf
|
||||
Remove-GPOZaurrOrphaned -Verbose -IncludeDomains 'ad.evotec.xyz' -BackupPath $Env:UserProfile\Desktop\MyBackup1 -WhatIf
|
||||
@@ -7,8 +7,6 @@
|
||||
[System.Collections.IDictionary] $ExtendedForestInformation
|
||||
)
|
||||
Begin {
|
||||
#$Owners = [System.Collections.Generic.List[object]]::new()
|
||||
#$Modify = [System.Collections.Generic.List[object]]::new()
|
||||
$ForestInformation = Get-WinADForestDetails -Forest $Forest -IncludeDomains $IncludeDomains -ExcludeDomains $ExcludeDomains -ExtendedForestInformation $ExtendedForestInformation -Extended
|
||||
}
|
||||
Process {
|
||||
@@ -22,43 +20,39 @@
|
||||
ADRightsAsArray = $true
|
||||
ResolveTypes = $true
|
||||
}
|
||||
$GPOPermissionsGlobal = Get-ADACL @getADACLSplat
|
||||
#$GPOPermissionsGlobal | Format-Table
|
||||
$GPOPermissionsGlobal = Get-ADACL @getADACLSplat #-Verbose
|
||||
foreach ($Permission in $GPOPermissionsGlobal) {
|
||||
if ($Permission.ActiveDirectoryRights | ForEach-Object {
|
||||
$_ -in 'WriteDACL', 'WriteOwner', 'GenericAll'
|
||||
}) {
|
||||
[PSCustomObject] @{
|
||||
Permission = 'GpoCustomOwner'
|
||||
Type = $Permission.PrincipalObjectType
|
||||
Name = $Permission.Principal
|
||||
DomainName = $Permission.PrincipalObjectDomain
|
||||
PermissionType = $Permission.AccessControlType
|
||||
GPOCount = 'N/A'
|
||||
GPONames = 'All'
|
||||
PrincipalName = $Permission.Principal
|
||||
Permission = 'GpoCustomOwner'
|
||||
PermissionType = $Permission.AccessControlType
|
||||
PrincipalSid = $Permission.PrincipalObjectSid
|
||||
PrincipalSidType = $Permission.PrincipalObjectType
|
||||
PrincipalDomainName = $Permission.PrincipalObjectDomain
|
||||
GPOCount = 'N/A'
|
||||
GPONames = -join ("All-", $Domain.ToUpper())
|
||||
DomainName = $Domain
|
||||
}
|
||||
#$Owners.Add($Permission)
|
||||
}
|
||||
if ($Permission.ActiveDirectoryRights | ForEach-Object {
|
||||
$_ -in 'CreateChild', 'GenericAll'
|
||||
}) {
|
||||
|
||||
[PSCustomObject] @{
|
||||
Permission = 'GpoCustomCreate'
|
||||
Type = $Permission.PrincipalObjectType
|
||||
Name = $Permission.Principal
|
||||
DomainName = $Permission.PrincipalObjectDomain
|
||||
PermissionType = $Permission.AccessControlType
|
||||
GPOCount = 'N/A'
|
||||
GPONames = 'All'
|
||||
PrincipalName = $Permission.Principal
|
||||
Permission = 'GpoCustomCreate'
|
||||
PermissionType = $Permission.AccessControlType
|
||||
PrincipalSid = $Permission.PrincipalObjectSid
|
||||
PrincipalSidType = $Permission.PrincipalObjectType
|
||||
PrincipalDomainName = $Permission.PrincipalObjectDomain
|
||||
GPOCount = 'N/A'
|
||||
GPONames = -join ("All-", $Domain.ToUpper())
|
||||
DomainName = $Domain
|
||||
}
|
||||
|
||||
#$Modify.Add($Permission)
|
||||
}
|
||||
}
|
||||
#$Owners | Format-Table
|
||||
|
||||
#$Modify | Format-Table
|
||||
}
|
||||
}
|
||||
End {}
|
||||
|
||||
Reference in New Issue
Block a user