Select just one Objects table of metadata for object

I’ve run this for a User object:

Get-ADReplicationAttributeMetadata -Object "CN=MyUserObject,DC=corp,DC=com" `
    -Server DC1 -ShowAllLinkedValues

…and get all the metadata but how do I select just one of those attributes and it’s corresponding metadata?

i.e. AttributeName : whenCreated ?

I’ve tried various Select’s, -expandProperty etc but not getting errors or output

Thanks

Hi Jeff,

The output of Get-ADReplicationAttributeMetadata contains multiple Attributes with the same names and values. you can verify this by piping the output to Get-Member so you cannot do a select-object direct from the pipeline you need to iterate through the output into the attribute Name ( $_.AttributeName.WhenCreated ) and then search

try the below

Get-ADReplicationAttributeMetadata -Object "CN=Test201,OU=Users,OU=Accounts,OU
=lab,DC=zerobyte,DC=local" -ShowAllLinkedValues -server "test.test.local" | Where-Object {
$_.AttributeName -eq "whenCreated"} | Select-Object AttributeValue

Regards

perfect thanks Spietersz

We can use the inbuilt filter option for this.

Get-ADReplicationAttributeMetadata -Object 'CN=MyUserObject,DC=corp,DC=com' -Server DC1 -Filter "AttributeName -eq 'WhenCreated'" | Select-Object AttributeValue