From 51b89b7dcdd93b561ba9583881f596b366f2d953 Mon Sep 17 00:00:00 2001 From: Patralos Date: Wed, 7 Jul 2021 14:30:17 +0200 Subject: [PATCH] Fix issue, as Configuration is beneath forest, not domain --- ADCS.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ADCS.ps1 b/ADCS.ps1 index 64e9888..a943eb1 100644 --- a/ADCS.ps1 +++ b/ADCS.ps1 @@ -12,7 +12,7 @@ Author: Christoph Falta (@cfalta) https://github.com/cfalta/PoshADCS #> - $DomainName = "DC=" + (((Get-Domain).Name).Replace(".",",DC=")) + $DomainName = "DC=" + (((Get-Forest).Name).Replace(".",",DC=")) $BasePath = "CN=Public Key Services,CN=Services,CN=Configuration" + "," + $DomainName $RootCA = Get-DomainObject -SearchBase ("CN=Certification Authorities," + $BasePath) -LDAPFilter "(objectclass=certificationAuthority)" $RootCA @@ -32,7 +32,7 @@ Author: Christoph Falta (@cfalta) https://github.com/cfalta/PoshADCS #> - $DomainName = "DC=" + (((Get-Domain).Name).Replace(".",",DC=")) + $DomainName = "DC=" + (((Get-Forest).Name).Replace(".",",DC=")) $BasePath = "CN=Public Key Services,CN=Services,CN=Configuration" + "," + $DomainName $EnterpriseCA = Get-DomainObject -SearchBase ("CN=Enrollment Services," + $BasePath) -LDAPFilter "(objectclass=pKIEnrollmentService)" $NTAuthStore = Get-DomainObject -SearchBase ("CN=NTAuthCertificates," + $BasePath) -LDAPFilter "(objectclass=certificationAuthority)" @@ -531,7 +531,7 @@ https://github.com/cfalta/PoshADCS $Filter) -$DomainName = "DC=" + (((Get-Domain).Name).Replace(".",",DC=")) +$DomainName = "DC=" + (((Get-Forest).Name).Replace(".",",DC=")) $BasePath = "CN=Public Key Services,CN=Services,CN=Configuration" + "," + $DomainName $SearcherArguments = @{"SearchBase"=("CN=Certificate Templates," + $BasePath)} @@ -627,7 +627,7 @@ https://github.com/cfalta/PoshADCS $Raw ) -$DomainName = "DC=" + (((Get-Domain).Name).Replace(".",",DC=")) +$DomainName = "DC=" + (((Get-Forest).Name).Replace(".",",DC=")) $BasePath = "CN=Public Key Services,CN=Services,CN=Configuration" + "," + $DomainName $SearcherArguments = @{"SearchBase"=("CN=Certificate Templates," + $BasePath)} @@ -764,7 +764,7 @@ https://github.com/cfalta/PoshADCS ) -$Domain = (Get-Domain).Name +$Domain = (Get-Forest).Name $DomainName = "DC=" + $Domain.Replace(".",",DC=") $BasePath = "CN=Public Key Services,CN=Services,CN=Configuration" + "," + $DomainName @@ -1132,4 +1132,4 @@ https://github.com/cfalta/PoshADCS } } } -} \ No newline at end of file +}