Let's say I have an AD that looks like the following:
Chicago
-Chicago Users
-Chicago PC's
--Office
---Front
---Back
Boston
-Boston Users
--No Internet
-Boston PC's
I want to run a search that would return all groups that have the word "internet" in them. Googling around I found "Get-ADGroup" so I open up my Powershell Active Directory module and put in this command string:
get-adgroup -filter {name -like "*Internet*"}
And that returns nothing. That seems odd. I search for the following things here's the results I get:
- name -like "Back". Result: nothing
- name -like "Front". Result: the right group gets returned
- name -like "Office". Result: nothing
- name -like "Boston". Result: the right groups get returned
What's going on here? Is there better way/command to search for what I'm looking for?
Any help is appreciated.