Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

AD: search for groups with name test in it

Posted on 2013-02-07
5
Medium Priority
?
485 Views
Last Modified: 2013-02-18
Hi,

Please advise: in  AD how do I search for groups with name test in it?
Tried with ADUC, search for groupname, *groupname*, %groupname%, advanced search, ldap search. Group exists but I don't get the result.

Please advise.
J.
0
Comment
Question by:janhoedt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 38863346
powershell:
$Filter = "(&(ObjectCategory=group)(DistinguishedName=*test*))"
$Searcher = New-Object System.DirectoryServices.DirectorySearcher($Filter)
$Searcher.Findall() | 
ForEach-Object `
  -Begin { "Results of $Filter query: " } `
  -Process { 
                    $_.properties.item("DistinguishedName")
                    $_.properties.item("Description")
                    "`r"
                   } `
  -End { [string]$Searcher.FindAll().Count + " $Filter results were found" }

Open in new window


based on how-can-i-search-active-directory-with-windows-powershell-to-return-a-list-of-missing-groups
0
 
LVL 17

Accepted Solution

by:
Tony Massa earned 1000 total points
ID: 38863596
Just search for the word TEST.  You can't use wildcards in the normal search as it's treated as part of the search string.

In ADUC, to filter for just groups with TEST in the name, perform a custom search. When you're in ADUC, perform a find, then in the "FIND" drop-down, choose "Custom Search".  You will then click the "Advanced" tab shown below to manually enter an LDAP query.
Enter the filter of
(&(objectCategory=Group)(name=*test*))

Open in new window

Custom LDAP Search
0
 
LVL 1

Assisted Solution

by:zaicnupagadi
zaicnupagadi earned 1000 total points
ID: 38867216
I think the simplest way to do it will be:

Get-QADGroup | ? {$_.Name -match "test"}

Instead if "$_.Name" which takes the "name" property from the current object (current object is "$_"), you can filter groups by other parameters like description:

Get-QADGroup | ? {$_.Description -match "test"}

If you would like to filter by those two:

Get-QADGroup | ? {($_.Name -match "test") -or ($_.Description -match "test")}

To invoke that query you will need "Quest PowerShell Commands for Active Directory", link with description how to use other functionality -
http://ss64.com/ps/quest.html

I cannot imagine my life as a admin without this software :)
0
 

Author Comment

by:janhoedt
ID: 38903037
Any idea how you would do an unattended install of this powerquest and it's modules?
Note: why not ISE instead of quest?
0
 
LVL 1

Expert Comment

by:zaicnupagadi
ID: 38904406
You install Quest cmdlet on the computer you want to execute the query - why would you like to install it remotely and silently? You have written "Why not ISE" - as far as I am concerned, "PowerShell ISE" is an editor for PS, Quest gives us additional modules to PS, so we can use addtional commands.

To add the Quest module to powershell - so it will be loaded by default, you have to create a file:

C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1

The content of mine "profile.ps1" is:

Add-PSSnapin Quest.ActiveRoles.ADManagement
Set-QADPSSnapinSettings -DefaultSizeLimit 0

First line will load the module, second one will set the default limit to 0 - which means no limit - quite useful.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Always backup Domain, SYSVOL etc.using processes according to Microsoft Best Practices. This is meant as a disaster recovery process for small environments that did not implement backup processes and did not run a secondary domain controller that ne…
Auditing domain password hashes is a commonly overlooked but critical requirement to ensuring secure passwords practices are followed. Methods exist to extract hashes directly for a live domain however this article describes a process to extract u…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

618 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