Friday, May 13, 2011

Domain Controller Assessment

I really wish Microsoft would release a single product that would be able to assess the health of the overall domain controller.

Server 2008 does come with built in Best Practice Analyzers and they are very helpful.

image

This is really nice because you are able to click on anything that gives you a warning or error and open up the properties of that error.

image

As you can see, Microsoft even suggests how to fix the issue.

This is all fine and good and you can run these BPA on any of the roles you have installed, however, some times you run into a server that is so broken that these BPAs won’t run. That is when you have to use a basket full of commands. I have added in few that I use and just put them into a batch file that I can run on the servers.

Example:

mkdir c:\<Folder>
dnscmd /info > c:\<Folder>\dnsinfo.txt
dnscmd <SERVERNAME> /directorypartitioninfo DomainDnsZones.<DOMAIN> > c:\<Folder>\dnspartitioninfoDomain.txt
dnscmd <SERVERNAME> /directorypartitioninfo forestDnsZones.<DOMAIN>> c:\<FOLDER>\dnspartitioninfoForest.txt
repadmin /showreps > c:\<FOLDER>\replog.txt
repadmin /replsum /errorsonly > c:\<FOLDER>\replogerror.txt
route print > c:\<FOLDER>\routes.txt
copy c:\windows\system32\drivers\etc\* c:\<FOLDER>\

I grab the routes as well as all the files in the etc folder because I have run across issues before where someone had gone in and put static routes on the servers or static entries in the hosts file or protocols file that had me scratching my head for a few hours until I figured it out. It’s best to just grab these files and make sure they are clean.

I would like to know what other commands people use and why they use them, maybe we can get a super script that will take 2 seconds to run and generate a nice report with useful information.

EDIT: I left DCDIAG and NETDIAG.. not sure why.. I just did Smile

Tuesday, May 10, 2011

Exporting a list of services from all machines in your domain

 

This can be done pretty quick with a power script, rather than going into each machine and opening up services and exporting manually.

Get-Service | Export-Csv -path "C:\services.csv"