Link to home
Start Free TrialLog in
Avatar of janhoedt
janhoedt

asked on

AD: search for groups with name test in it

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.
Avatar of Meir Rivkin
Meir Rivkin
Flag of Israel image

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
ASKER CERTIFIED SOLUTION
Avatar of Tony Massa
Tony Massa
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of janhoedt
janhoedt

ASKER

Any idea how you would do an unattended install of this powerquest and it's modules?
Note: why not ISE instead of quest?
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.