Difference between revisions of "Get-ADForest"

From UVOO Tech Wiki
Jump to navigation Jump to search
(Created page with "# Get your ad domain $DomainName = (Get-ADDomain).DNSRoot # Get all DC's $AllDCs = Get-ADDomainController -Filter * -Server $DomainName | Select-Object Hostname,Ipv4address,i...")
 
Line 1: Line 1:
# Get your ad domain
+
```
 
$DomainName = (Get-ADDomain).DNSRoot
 
$DomainName = (Get-ADDomain).DNSRoot
# Get all DC's
 
 
$AllDCs = Get-ADDomainController -Filter * -Server $DomainName | Select-Object Hostname,Ipv4address,isglobalcatalog,site,forest,operatingsystem
 
$AllDCs = Get-ADDomainController -Filter * -Server $DomainName | Select-Object Hostname,Ipv4address,isglobalcatalog,site,forest,operatingsystem
 
# Or
 
 
$AllDCs = (Get-ADForest).GlobalCatalogs
 
$AllDCs = (Get-ADForest).GlobalCatalogs
 +
```

Revision as of 23:29, 10 June 2021

$DomainName = (Get-ADDomain).DNSRoot
$AllDCs = Get-ADDomainController -Filter * -Server $DomainName | Select-Object Hostname,Ipv4address,isglobalcatalog,site,forest,operatingsystem
$AllDCs = (Get-ADForest).GlobalCatalogs