-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This script reads the domain Kerberos policy from Group Policy. NOTE: This script REQUIRES the GroupPolicy module installed.
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Function Get-KerberosPolicy | ||
{ | ||
# NOTE: This script REQUIRES the GroupPolicy module installed. | ||
Import-Module GroupPolicy | ||
|
||
[string]$PDCHostName = (Get-ADDomainController -Discover -Service PrimaryDC).HostName | ||
[xml]$DefaultDomainPolicyXML = Get-GPO -Name "Default Domain Policy" -Server $PDCHostName | Get-GPOReport -ReportType XML # -Path c:\temp\DDP.xml | ||
$NameSpaceManager = New-Object System.XML.XmlNamespaceManager($DefaultDomainPolicyXML.NameTable) | ||
$NameSpaceManager.AddNamespace('root','http://www.microsoft.com/GroupPolicy/Settings') | ||
$GPOsettings = [array]$DefaultDomainPolicyXML.SelectNodes('//root:Extension',$NameSpaceManager) | ||
$KerberosPolicySettings = $GPOsettings.Account |?{$_.type -match "Kerberos"} | ||
|
||
$KerberosPolicySettingsMaxRenewAge = $KerberosPolicySettings.MaxRenewAge | ||
$KerberosPolicySettingsMaxTicketAge = $KerberosPolicySettings.MaxTicketAge | ||
|
||
return $KerberosPolicySettings | ||
} |