Solved

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

Posted on 2014-04-11
4
219 Views
Last Modified: 2014-04-11
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
Comment
Question by:siber1
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
SreRaj earned 500 total points
ID: 39994016
Hi,

Please try the following.

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

Open in new window

0
 

Author Comment

by:siber1
ID: 39994053
thank you SreRaj, how can I also return results for country not equal "US"
0
 
LVL 12

Expert Comment

by:SreRaj
ID: 39994072
That would be as follows.

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

Open in new window

0
 

Author Closing Comment

by:siber1
ID: 39994141
perfect. thanks SreRaj!
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
exchange 2007, outlook 3 23
mount point report 5 12
Powershell query 1 26
Exchange 2007 Autodiscover 6 8
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This article outlines the process to identify and resolve account lockout in an Active Directory environment.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question