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}}