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

Find a server in AD with only part of its name

Hi all,
can't remember the query to run in order to find all servers using only part of the name. We know it has "hyp" in the name but not the rest. Does anyone know?
Jason Thomas
Jason Thomas
2 Solutions
Miguel Angel Perez MuñozCommented:
On Users and computers of Active directory is (&(objectCategory=computer)(name=hyp*) if starts with hyp. You can try with name=*hyp*

You can try this
Get-ADComputer -Filter 'SamAccountName -like "hyp*"' | Select -Exp Name

Jason ThomasAuthor Commented:
I'll try thanks .  @ Miguel , I'm not sure what you mean or how I apply what you are saying?
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Try below on DC

dsquery computer -o rdn -limit 0 > C:\Computerlist.txt

Open in new window

Jason ThomasAuthor Commented:
Hi lahesh. Where in the command are we specifying part of the name? Won't your command display all names in AD?
-o rdn will export the all computers netbios name in active directory
The command has to be run on domain controller from elevated command prompt

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

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