WMI runs as part of a shared service host with ports assigned through DCOM by default. Starting with Windows Vista, you can set up the WMI service to run as the only process in a separate host and specify a fixed port.
A fixed port makes WMI easier to use behind firewalls, but in Windows Vista you cannot use scripts that make asynchronous calls. For more information about asynchronous calls, see Calling a Method.
The following procedure is an automated setup to allow WMI to have a fixed port. The procedure uses the winmgmt command-line tool.
To set up a fixed port for WMI
- At the command prompt, type winmgmt -standalonehost
- Stop the WMI service by typing the command net stop "Windows Management Instrumentation"
- Restart the WMI service again in a new service host by typing net start "Windows Management Instrumentation"
- 4. Establish a new port number for the WMI service by typing netsh firewall add portopening TCP 24158 WMIFixedPort
Specify a fixed port other than 24158
To do that you'll need to do the following:
1. open DCOM Config (dcomcnfg)
2. find "Windows Management and Instrumentation"
3. Open the properties and select the Endpoints tab.
4. Edit the properties of the "Connection-oriented TCP/IP"
This should be done either before stopping the WinMgmt service or before starting it backup. Don't forget to modify the firewall opening to reflect the new port.
1. open DCOM Config (dcomcnfg)
2. find "Windows Management and Instrumentation"
3. Open the properties and select the Endpoints tab.
4. Edit the properties of the "Connection-oriented TCP/IP"
This should be done either before stopping the WinMgmt service or before starting it backup. Don't forget to modify the firewall opening to reflect the new port.
Original Source: http://msdn.microsoft.com/en-us/library/bb219447(VS.85).aspx