Setting Up a Fixed Port for WMI
Setting Up a Fixed Port for WMI

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.

Bb219447.wedge(en-us,VS.85).gifTo set up a fixed port for WMI

  1. At the command prompt, type winmgmt -standalonehost
  2. Stop the WMI service by typing the command net stop "Windows Management Instrumentation"
  3. 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 port=24158 name=WMIFixedPort

See Also

Connecting to WMI on a Remote Computer
Connecting to WMI Remotely Starting with Vista
Provider Hosting and Security

 

 

Send comments about this topic to Microsoft

Build date: 1/8/2010

Build type: MSDN

Community Content

Step 4 incorrect
Added by:bork
The command netsh firewall add portopening port=24158 name=WMIFixedPort is incorrect. You need to add "protocol=tcp" to the end.
© 2010 Microsoft Corporation. All rights reserved.   Terms of Use | Trademarks | Privacy Statement
Page view tracker
Rate the Lightweight library
x
Lightweight builds on ScriptFree (loband) by adding features you've requested: a SearchBox and default code language selection.
Do you like the SearchBox?
Do you like the tabbed code blocks?
How useful is this topic?
Tell us more.
Thanks
x
You're helping to improve MSDN Online.
Feedback
Switch View
Classic
Lightweight Beta
ScriptFree
Switch View