Forum Discussion
JasonT77
Jul 26, 2023Copper Contributor
Exporting AD User Attributes
I'm using PowerShell to export selected attributes of all our users in a specific OU in AD. It's mostly working but for some reason several attributes aren't exporting correctly. The personalPager at...
- Jul 26, 2023
Hi, Jason.
There's two possibilities here:
- You've misspelled the attribute names in your "Select-Object" statement; and/or
- The account you're using does not have permission to read those attributes (which includes if the attributes are marked as confidential.)
To check point 1 isn't a problem, run just the first part of your statement:
get-aduser -filter * -Properties * -SearchBase "OU=Standard Users,OU=Users,OU=Organisation,DC=wdea,DC=local"
If you see the attributes listed with values, then you've simply made a typo in the Select-Object clause.
If you see the attributes listed but without value(s), then either:
- The attribute really holds no value for that object; and/or
- The account you're querying with does not have permission to read that attribute; and/or
- The attribute is marked as confidential.
Obviously, I can't check if your custom attributes are marked as confidential, but the default for personalPager is that it's not marked as confidential, so I'm inclined to think it's point 2 (permissions of the querying account) above.
Cheers,
Lain
LainRobertson
Jul 26, 2023Silver Contributor
Hi, Jason.
There's two possibilities here:
- You've misspelled the attribute names in your "Select-Object" statement; and/or
- The account you're using does not have permission to read those attributes (which includes if the attributes are marked as confidential.)
To check point 1 isn't a problem, run just the first part of your statement:
get-aduser -filter * -Properties * -SearchBase "OU=Standard Users,OU=Users,OU=Organisation,DC=wdea,DC=local"
If you see the attributes listed with values, then you've simply made a typo in the Select-Object clause.
If you see the attributes listed but without value(s), then either:
- The attribute really holds no value for that object; and/or
- The account you're querying with does not have permission to read that attribute; and/or
- The attribute is marked as confidential.
Obviously, I can't check if your custom attributes are marked as confidential, but the default for personalPager is that it's not marked as confidential, so I'm inclined to think it's point 2 (permissions of the querying account) above.
Cheers,
Lain
JasonT77
Jul 26, 2023Copper Contributor
Thanks for the response. The account I'm logged in as is a domain admin. The weird part is that personalPager and conditionalimages returned blank columns in the exported CSV but pronouns has a value listed for 1 user, but not the others.