Solved

server list in AD

Posted on 2013-01-24
2
297 Views
Last Modified: 2013-02-11
Is there anyway we can find the list of servers in AD, is there any cmd command put that in a txt file?
0
Comment
Question by:pdsmicro
[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
2 Comments
 
LVL 14

Accepted Solution

by:
BlueCompute earned 500 total points
ID: 38816954
Either use PowerShell, and run something like this one:
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.Filter = '(OperatingSystem=Window*Server*)'
"Name","canonicalname","distinguishedname" | Foreach-Object {$null = $objSearcher.PropertiesToLoad.Add($_) }
$objSearcher.FindAll() | Select-Object @{n='Name';e={$_.properties['name']}},@{n='ParentOU';e={$_.properties['distinguishedname'] -replace '^[^,]+,'}} | out-file C:\Servers.txt

Open in new window

Which will list all servers, and the OU they're in to C:\servers.txt if you genuinely want all boxes that are servers. If it's just Domain Controllers you need, this command line will do it:
Nltest /dclist:%yourdomain.local% >> C:\DCs.txt

Open in new window

You could try netdom like this:
netdom query SERVER
netdom query DC

Open in new window

But most or all of your workstations are probably listed as servers too, as they run the "server" service for admin shares etc.
0
 

Author Closing Comment

by:pdsmicro
ID: 38877044
thanks
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Microsoft has released remote PowerShell capabilities to all commercial Office 365 customers. So you can be controlled via PowerShell and not from the Office 365 admin center Download Windows PowerShell Module for Lync Online http://www.micros…
The System Center Operations Manager 2012, known as SCOM, is a part of the Microsoft system center product that provides the user with infrastructure monitoring and application performance monitoring. SCOM monitors:   Windows or UNIX/LinuxNetwo…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

624 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