1

Windows ファイアウォールで WMI が必要とする最も信頼性の高いオープン ポートをどのように作成できますか? これを BAT または VBS スクリプトの形式で必要としており、Win XP 以降で動作する必要があります。

どうもありがとうございました。

EDIT1: 2000 年の XP を勝ち取ります。

4

2 に答える 2

4

.BAT

You can use the netsh command to open a specified port in the firewall. to use the wmi you must run something like this.

to allow remote administration

netsh firewall set service RemoteAdmin enable

and to open the WMI port

netsh firewall add portopening protocol=tcp port=135 name=DCOM_WMIPort

Additionally you can read this article Connecting WMI Through Windows Firewall.

VbScript

if you want to use vbScript to accomplish this task , try using the HNetCfg.FwMgrCOM object in this article Windows Firewall Scripting you can found a serie of samples to manage the firewall settings using this com object from VbScript.

于 2011-04-06T20:31:23.253 に答える
0

JScriptは名前で言及されていませんが、JScriptはすべてのWindowsOSでWindows95から利用可能であり、VBScriptと同じWSHを使用します。

.jsファイルを作成して、次のコードを使用できます。

//Open WMI and Remote Access Ports
var firewall = new ActiveXObject("HNetCfg.FwMgr");
var policy = firewall.LocalPolicy.CurrentProfile;
var admin = policy.RemoteAdminSettings;
admin.Enabled = true;

その後、この.jsファイルは、他の.vbsファイルを実行するのと同じ方法で実行できます。

于 2011-11-09T17:36:36.863 に答える