Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scripts to harden the Windows Server 2003

Status
Not open for further replies.

CPaul123

IS-IT--Management
Apr 18, 2002
94
US
I am in the process of building several servers at the same time. I have to disable many of the services. Does anyone know of a way to create a script so that I could run it to modify the services? I would need modify the windows components as well?

Thanks!
 
Code:
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery _
    ("Select * from Win32_Service Where Name = 'DbService'")
For Each objService in colListOfServices
    objService.StopService()
    objService.Delete()
Next

I hope you find this post helpful.

Regards,

Mark
 
Optionally you could create a security Template in the "Security Analysis and Configuration" MMC plug-in. Then use the SECEDIT command to deploy it. That would allow you to modify a large number of configuration parameters without the need to learn WMI scripting.

PSC

Governments and corporations need people like you and me. We are samurai. The keyboard cowboys. And all those other people out there who have no idea what's going on are the cattle. Mooo! --Mr. The Plague, from the movie "Hackers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top