Hello,
I'm trying to extract a list of users that are assigned to a few specific pools, and export that data to a CSV.
The info I need in the CSV are their names, pool they are assigned to, their distinguished name, and also the attribute called "CountryOrRegionDisplayName" which is visible by doing a get-csADuser cmdlet but not in the get-csuser cmdlet.
Here's what I have running, and it works great:
get-csuser -filter {
registrarpool -eq "pool1.mydomain.com"-or
registrarpool -eq "pool2.mydomain.com" -or
registrarpool -eq "pool3.mydomain.com"} |
select samaccountname, firstname, lastname, registrarpool, distinguishedname |
export-csv biglist.csv -NoTypeInformation
Now the only thing I need is to include the country that the user is located in, which is contained in the Active Directory attribute "CountryOrRegionDisplayName" which is totally included in the get-csADuser cmdlet, but not get-csuser.
How could I add "CountryOrRegionDisplayName to the list of things I select? As in something like the following, which obviously doesn't work:
select samaccountname, firstname, lastname, registrarpool, distinguishedname, countryorregiondisplayname |
I read a little about -ldapfilter but was confused if I could use that with get-csuser, or if I had to do a get-csaduser and try to pull Lync attributes, etc...
Any help pointing me in the right direction would be appreciated!
Thanks,
Brandon