Search This Blog

Tuesday, October 25, 2011

Disable Services Using Command line


Alright. Just received a request to disable services for security hardening.

Well, 1 VM = 6 services need to disable.

144 VM = 864 services need to disable.

Next question, why don’t i use group policy?. Well, due to unavoidable circumstance i cannot use group policy. Wow 864 times of configuration is a lot of work. The best way, is write a script to disable the services.

1. Check the service name from services.msc


Example of services:-

Microsoft iSCSI Initiator
Network Access Protection
RPC Locator
Smart Card
Smart Card Removal Policy


sc config MSiSCSI start= disabled
sc config napagent start= disabled
sc config RpcLocator start= disabled
sc config SCardSvr start= disabled
sc config SCPolicySvc start= disabled
sc config SNMPTRAP start= disabled

You can configure startup to be “auto” | “disable” | “demand” | “delayed-auto”

Save to batch file and execute to the entire VMs.