This commit is contained in:
Przemyslaw Klys
2020-08-28 09:49:26 +02:00
parent 91d3776403
commit 1b70d39984
7 changed files with 88 additions and 9 deletions
+1 -1
View File
@@ -2,11 +2,11 @@
# 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
}
# Show the Excel
Start-Process "$Env:USERPROFILE\Desktop\EFGPOAnalysis.xlsx"
+16 -3
View File
@@ -1,9 +1,22 @@
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExportEvotec1'
$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPODefender'
#$Output = Invoke-GPOZaurr -GPOPath 'C:\Support\GitHub\GpoZaurr\Ignore\GPOExport'
$Output | Format-Table
$Output.Reports.RegistrySettings | Format-Table *
$Output.Reports.InternetExplorerZones | Format-Table *
$Output.Reports | Format-Table
$Output.Reports.WindowsDefenderExploitGuard
#$Output.Reports.RegistrySetting | Format-Table
#$Output.CategoriesFull | Format-Table
<#
$Output.Reports.Policies | Format-Table
$Output.Reports.SecurityOptions | Format-Table
$Output.Reports.PublicKeyPoliciesCertificates | Format-Table
$Output.Reports.PublicKeyPoliciesEnrollmentPolicy | Format-Table
$Output.Reports.PublicKeyPoliciesAuto | Format-Table *
#>
return
# Report to Excel of translated reports
foreach ($Key in $Output.Reports.Keys) {
+53 -3
View File
@@ -1,5 +1,55 @@
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
Invoke-GPOZaurrSupport -ComputerName 'AD1' -UserName 'przemyslaw.klys' -Type HTML
#$Support
# $Support.ComputerResults.GPO | select name, @{LABEL=”LinkOrder“;EXPRESSION={$_.link.linkorder}} | sort linkorder
#Invoke-GPOZaurrSupport -ComputerName 'AD1' -UserName 'przemyslaw.klys' -Type HTML
#$Support1 = Invoke-GPOZaurrSupport -ComputerName 'AD1' -UserName 'przemyslaw.klys' -Type Object
#$Support = Invoke-GPOZaurrSupport -ComputerName 'AD1' -UserName 'EVOTEC\Administrator' -Type Object
#$Support.ComputerResults.ExtensionData
foreach ($GpoType in @('UserResults', 'ComputerResults')) {
if ($Support.$GpoType.ExtensionData) {
foreach ($Extension in $Support.$GpoType.ExtensionData) {
$GPOSettingTypeSplit = ($Extension.type -split ':')
#$Extension
#$Extension | Get-Member -MemberType Properties -ErrorAction Stop
$KeysToLoop = $Extension | Get-Member -MemberType Properties -ErrorAction Stop | Where-Object { $_.Name -notin @($GPOSettingTypeSplit[0], 'xmlns', 'blocked', 'type') }
foreach ($GpoSettings in $KeysToLoop.Name) {
$Extension.$GpoSettings | Format-Table
}
}
}
}
# $env:LOGONSERVER
# if($env:LOGONSERVER -match "MicrosoftAccount") {"Logged on with Windows account"}
# If it reports \\MicrosoftAccount, they are using their Windows account to sign in instead of domain credentials.
#You can check this by using the IF statement as shown here:
#[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name
#[System.DirectoryServices.ActiveDirectory.DomainController]::
# https://concurrency.com/blog/may-2018/domain-controller-selection
#echo %logonserver% - This shows the DC that was used to authenticate and log in the current user
#nltest /dsgetsite - This shows the AD site that the current server has detected that it's in
#nltest /dclist: (include the colon at the end) - This shows the list of DCs in the current domain, including which site each is in.
# nslookup -type=srv _ldap._tcp.mydomain.local. - This will query the primary DNS server for all domain controller SRV records. This should return all of the DCs in the domain. In this example, MGLABDC4 and MGLABDC5 are returned.
# nslookup -type=srv _ldap._tcp.mysitename._sites.dc._msdcs.mydomain.local. - This will query the primary DNS server for domain controllers that are registered in "mysitename". In this example, only MGLABDC4 is in the site that was queried, which matches the information we found with nltest /dclist: previously.
# Windows 10
#Add-WindowsCapability -Online -Name 'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0'
#Add-WindowsCapability -Online -Name 'Rsat.GroupPolicy.Management.Tools~~~~0.0.1.0'
#Remove-WindowsCapability -Online -Name 'Rsat.ActiveDirectory.DS-LDS.Tools~~~~0.0.1.0'
echo %logonserver%
nltest /dsgetsite
nltest /dclist:
$env:LOGONSERVER
[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetComputerSite().Name
nslookup -type=srv _ldap._tcp.ad.colmore.com.
nslookup -type=srv _ldap._tcp.birmingham._sites.dc._msdcs.ad.colmore.com.
@@ -0,0 +1,4 @@
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
$SummaryPermission = Get-GPOZaurrPermissionSummary -IncludePermissionType GpoEdit, GpoEditDeleteModifySecurity
$SummaryPermission | Sort-Object -Property Permission
@@ -0,0 +1,4 @@
Import-Module "$PSScriptRoot\..\GPoZaurr.psd1" -Force
$SummaryPermission = Get-GPOZaurrPermissionSummary -IncludeOwner
$SummaryPermission | Sort-Object -Property Permission | Format-Table *