Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
What OS is installed on a DMZ server? –  Volodymyr Feb 22 '13 at 10:05
    
Hi, it's Windows server 2003, 2008 and Seven. –  YoyoMan Feb 22 '13 at 10:34

3 Answers 3

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 WMIFixedPor
share|improve this answer
    
shikran, I've already test this manipulation but it doesn't change anything. For information, I use Splunk for getting log files. –  YoyoMan Feb 22 '13 at 10:55

from http://social.technet.microsoft.com/Forums/en-US/winserverManagement/thread/c2ca4979-165a-4bb9-903c-e23f6a35dbf1/

On the responding machine... Step one: Set the DCOM config to use a static port.... Basically, run "dcomcnfg" from command prompt. Navigate the tree to My Computer > DCOM Config > Windows Management and Instrumentation, select properties of that folder. Go to the Endpoints tab Select Properties button for Connection-oriented TCP/IP Use static endpoint, set the port. Step 2: Configure WMI to use a fixed port http://msdn.microsoft.com/en-us/library/bb219447(v=VS.85).aspx 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" Establish a new port number for the WMI service by typing netsh firewall add portopening TCP 24158 WMIFixedPort Still testing this myself, so not 100% certain it works.

There is more information in other comments

share|improve this answer
    
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/… –  Volodymyr Feb 22 '13 at 11:35

To be able to collect information from remote host via WMI, you need to do the following:

1. Enable remote WMI requests

1.1. On the target server, go to Administrative Tools -> Computer Management.

1.2. Expand 'Services and Applications'.

1.3. Right click for Properties on 'WMI Control'.

1.4. Select the Security tab.

1.5. Press the Security button.

1.6. Add the monitoring user (if needed), and then be sure to check Remote Enable check-box for the user/group that will be requesting WMI data.

2. Allow WMI through Windows Firewall

This can only be done at the command prompt. Run the following on the target computer if it is running a Windows firewall:

on Windows Server 2003 machines

 netsh firewall set service RemoteAdmin enable

on Windows Server 2008 machines

netsh advfirewall firewall set rule group="windows management instrumentation (wmi)" new enable=yes

More details can be found here. Articles on MSDN with more in-depth view here & here.

share|improve this answer
    
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. –  YoyoMan Feb 22 '13 at 11:48
    
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/… –  Volodymyr Feb 22 '13 at 11:51
    
Sorry for that. I've already did this manipulation, but my Splunk Server use always random port for WMI. –  YoyoMan Feb 22 '13 at 11:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.