WMI: How can I fix the port?

9,453

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

  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 TCP 24158 WMIFixedPor
Share:
9,453
YoyoMan
Author by

YoyoMan

Updated on September 18, 2022

Comments

  • YoyoMan
    YoyoMan almost 2 years

    I need to use WMI for getting some information from my servers. But I have a server in DMZ, so I need to open a port in my firewall. I've searching and I found that WMI uses random port. How can this be fixed?

    • Volodymyr Molodets
      Volodymyr Molodets over 11 years
      What OS is installed on a DMZ server?
    • YoyoMan
      YoyoMan over 11 years
      Hi, it's Windows server 2003, 2008 and Seven.
  • YoyoMan
    YoyoMan over 11 years
    shikran, I've already test this manipulation but it doesn't change anything. For information, I use Splunk for getting log files.
  • Volodymyr Molodets
    Volodymyr Molodets over 11 years
    Fixed port cannot be set on a Windows Server 2003 machine. This option appeared starting from Windows Vista. "...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." Source: msdn.microsoft.com/en-us/library/windows/desktop/…
  • YoyoMan
    YoyoMan over 11 years
    Hi, I don't have a local firewall on the PCs but a network firewall, so it's why I need fixe a WMI port for open it.
  • Volodymyr Molodets
    Volodymyr Molodets over 11 years
    You'd better mention this next time in your question. In such situation, you can only setup fixed port on a Windows Server 2008 and Windows 7 machines, but not W2K3 server. Follow this link: msdn.microsoft.com/en-us/library/windows/desktop/…
  • YoyoMan
    YoyoMan over 11 years
    Sorry for that. I've already did this manipulation, but my Splunk Server use always random port for WMI.