• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

need assistance with a quest adcmdlet's script to search for "country" value

hello, can someone provide a way that I can use this script to search for all users in country = US.

here is the script that works fine for searching for a specific city:

Get-QADuser -city "boston" -sizelimit 0 -searchroot "OU=Users,OU=Corp Accounts,DC=mydomain,DC=com" | Add-QADGroupMember bostonDL

Open in new window


I need to search for all users in US and add them to a group.

thx much!
0
siber1
Asked:
siber1
  • 2
  • 2
1 Solution
 
SreRajCommented:
Hi,

Please try the following.

Get-QADUser -IncludedProperties "c" | where {$_.c -eq "US"} | select name,c 

Open in new window

0
 
siber1Author Commented:
thank you SreRaj, how can I also return results for country not equal "US"
0
 
SreRajCommented:
That would be as follows.

Get-QADUser -IncludedProperties "c" | where {$_.c -ne "US"} | select name,c

Open in new window

0
 
siber1Author Commented:
perfect. thanks SreRaj!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now