[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 477
  • Last Modified:

Powershell script to identify server roles for a farm of servers

Hello Experts,

I just wonder if you can provide me with a nice Powershell  script that exports into a CSV the FQDN of servers from a forest/domain and the server role as well of OS installed on each server. Please see example below

ServerFQDN                            Server role        OS                                   Forestname                domainname
server1.root.domainname    schema master  Windows 2003 R2          root.domainname      domainA
server2.domainname            dhcp server         Windows 2008              root.domainname      domainB
server3.domainname            DNS                      Windows 2008 R2
server4.domainname            Exchange             Windows 2012 R2
server5.domainname            File server            Windows 2012

The script should be able to read information from AD and all servers and/or discovery the server roles installed on each server that is part of that forest/domain

Any help is highly appreciated
0
Jerry Seinfield
Asked:
Jerry Seinfield
1 Solution
 
Mohammed KhawajaCommented:
Have you tried Microsoft MAP?  If not I recommend you try MAP as it could provide you various kinds of reports.
0
 
David Johnson, CD, MVPOwnerCommented:
server1.root.domainname    schema master  Windows 2003 R2          root.domainname      
server2.domainname            dhcp server         Windows 2008              root.domainname      
server3.domainname            DNS                      Windows 2008 R2
server4.domainname            Exchange             Windows 2012 R2
server5.domainname            File server            Windows 2012


getting the operating system and whether or not it is a DC or not is trivial. How would one differentiate between a member server and a file server?  you can check the roles and see if dhcp and/or dns is installed.  (doesn't mean that it is active).  Exchange is an application that runs on the server it is not a role.
0
 
Jerry SeinfieldAuthor Commented:
Any other suggestions from the Powershell team?
0
 
compdigit44Commented:
I am not a powershell expert but I believe the following MS blog article will give you tell you how to get most of the information you are looking for..

http://blogs.technet.com/b/heyscriptingguy/archive/2010/07/19/hey-scripting-guy-how-can-i-use-windows-powershell-2-0-to-retrieve-information-about-domain-controllers.aspx

http://technet.microsoft.com/en-us/library/ee176825.aspx
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

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