Forum Discussion
rmerritt
Oct 31, 2024Copper Contributor
How do I display a "Microsoft.ActiveDirectory.Management.ADPropertyValueCollection" using PowerShell
PS C:\Users\serveradmin.QA> Get-ADDomainController -Filter * | Select-Object Name, OperationMasterRoles |Where-Object {$_.OperationMasterRoles}
Name OperationMasterRoles
---- --------------------
ADAICTQA {SchemaMaster, DomainNamingMaster, PDCEmulator, RIDMaster...}
in the above command I output OperationMasterRoles Id like those to be displayed in the same row comma seperated ...how do I disect that ADPropertyValueCollection ?
- LainRobertsonSilver Contributor
Hi, Rob.
Get-ADDomainController -Filter { (operationMasterRoles -like "*") } | ForEach-Object { [PSCustomObject] @{ name = $_.name; operationMasterRoles = $_.operationMasterRoles -join ","; } }
Cheers,
Lain