How To Change Comment Field For Multiple Servers

by [Published on 18 Nov. 2010 / Last Updated on 10 Oct. 2009]

This article explains how you can change the Comment Field located on My Computer for Infrastructure Servers.

The "Comment Field" which is located at My Computer simplifies the identification of a Windows Computer. This is generally called "Computer Description". By just looking at the Computer Description you can identify the Server role. This article explains how you can set this field for multiple computers using a single command.

As an example, you have 100 IIS Servers in your organization but when you look at two-three IIS servers (My Computer property) it says something else or nothing. As a manual process it may take some considerable time for 100 servers. You can use the below steps to accomplish this:

  • Create a text file. Name it IISSRV.TXT and put all the IIS Server names in it.
  • Next run the following command from a computer which is reachable to all IIS Servers mentioned in the IISSRV.TXT file.

FOR /F "Tokens=*" %L IN (C:\IISSRV.TXT) DO REG.EXE Add \\%L\HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters /v srvcomment /t REG_SZ /d "IIS Infrastructure Server"

The above command runs against each server mentioned in the IISSRV.TXT and set a registry entry (srvcomment). This registry key holds the Computer Description text.


See Also

The Author — Nirmal Sharma

Nirmal Sharma avatar

Nirmal Sharma is a MCSEx3, MCITP and was awarded the Microsoft MVP award in Directory Services and Windows Networking. He specializes in Microsoft Azure, Office 365, Directory Services, Failover Clusters, Hyper-V, PowerShell Scripting and System Center products. Nirmal has been involved with Microsoft Technologies since 1994. In his spare time, he likes to help others and share some of his knowledge by writing tips and articles on various sites and contributing to PowerShell-based Dynamic Packs for www.ITDynamicPacks.Net solutions.

Featured Links