Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

OperationMasterRoles details with (Get-ADForest).Domains

$
0
0

 

Hi

I have created below script to get the all DCs in forst with their desired output.

 

But I am not getting FSMO role owner DC details. I am getting below result:

 

OperationMasterRoles

Microsoft.ActiveDirectory.Management.ADPropertyValueCollection

Microsoft.ActiveDirectory.Management.ADPropertyValueCollection

 

 

Script is below:

 

$allDCs = (Get-ADForest).Domains | %{ Get-ADDomainController -Filter * -Server $_ }

$allDCs | select name,HostName,Domain,enabled,Forest,IPV4Address,IsGlobalCatalog,site,operatingsystem,OperatingSystemServicePack,OperationMasterRoles

 

 

I have tried like below way but could not get any sucess:

 

$allDCs = (Get-ADForest).Domains | %{ Get-ADDomainController -Filter * -Server $_ }

$allDCs | select name,HostName,Domain,enabled,Forest,IPV4Address,IsGlobalCatalog,site,operatingsystem,OperatingSystemServicePack,@{name="OperationMasterRoles";Expression={$_.SchemaMaster;$_.DomainNamingMaster;$_.PDCEmulator;$_.RIDMaster;$_.InfrastructureMaster}}

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles