?
Solved

do a search on server names on domain with a LIKE

Posted on 2011-10-13
8
Medium Priority
?
245 Views
Last Modified: 2012-05-12
is it possible to bring have all servers(machines) on the domain that has the name DEV in it, through DOS prompt commands?

examples: POSDEV01, DEVELOPERSLAB24 etc
0
Comment
Question by:25112
8 Comments
 
LVL 59

Accepted Solution

by:
Bill Prew earned 500 total points
ID: 36964700
Have you looked at the ADFIND freeware utility, it's great for these types of queries.

www.joeware.net/freetools/tools/adfind/index.htm

~bp
0
 
LVL 57

Assisted Solution

by:Mike Kline
Mike Kline earned 500 total points
ID: 36964744
You can use an LDAP query in ADUC

(&(objectcategory=computer)(name=*DEV*))

from the command line

dsquery * -filter "(&(objectcategory=computer)(name=*DEV*))" -attr name


other ways from the command line too but that is one

Thanks

Mike
0
 
LVL 85

Assisted Solution

by:oBdA
oBdA earned 500 total points
ID: 36964752
In a command prompt, simply enter
dsquery computer -limit 0 | find /i "dev"

Open in new window

Redirect the output into a file by adding >devcomputers.txt
dsquery computer -limit 0 | find /i "dev" >devcomputers.txt

Open in new window

0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
LVL 43

Assisted Solution

by:Steve Knight
Steve Knight earned 500 total points
ID: 36965088
you could also use old school.....

Net view | find /i "dev"

but dsquery probably best if this is ad environment.
0
 
LVL 5

Author Comment

by:25112
ID: 36972159
OK.. is it possible dsquery may bring servers there were but not any more.. in other words.. does dsquery check in real time or from a database that may not be synced to realtime?
0
 
LVL 5

Author Comment

by:25112
ID: 36972163
oBdA, how can you check if I want to check for anything that starts with POS and also has DEV in them.. in your query..dsquery computer -limit 0 | find /i "pos*dev" >devcomputers.txt
but that did not bring it back right (mkline71 query worked, and hence i wanted to try that format)..

Mike, your query is good.. i need to pass it to on to programmers.. seems like oBdA is little simpler.. thats all.
0
 
LVL 5

Author Comment

by:25112
ID: 36972165
dragon-it,
Net view | find /i "dev"
does not seem to bring it all.. they also start with \\
0
 
LVL 5

Author Comment

by:25112
ID: 36972167
billprew, thanks. I will keep that tool in mind when we can.. right now we need to have something that programmers can use without having to install extra.. thanks.
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

Wouldn't it be nice if objects in Active Directory automatically moved into the correct Organizational Units? This is what AutoAD aims to do and as a plus, it automatically creates Sites, Subnets, and Organizational Units.
It’s time for spooky stories and consuming way too much sugar, including the many treats we’ve whipped for you in the world of tech. Check it out!
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

755 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