|
WMI Fun !! 〜 WMIに興味がある方・システム管理者必見!! 〜 WMI StepWMI SampleWMI ReferenceWMI LibraryMy Let'snotePersonalLinkAbout WMI Fun !! |
|
|
|
WMI Fun !! > WMI Sample (VBS) > WindowsファイアウォールのICMP設定を取得する |
|
|
Panasonic Let'snoteを長年愛用しています、その理由はMy Let'snoteで…
インクを買うよりもしかしたら安い?インクジェット複合機Canon PIXUS MP493 ビジネスにパソコンを活用する為のバイブル、 WindowsファイアウォールのICMP設定を取得する: HNet_FwIcmpSettings - WMI Sample (VBS)Topics
現在のWindowsファイアウォールのICMP(Internet Control Message Protocol)設定を取得するサンプルプログラムです。名前空間は「Root\Microsoft\HomeNet」、クラスが「Hnet_FwIcmpSettings」になります。
Sample Code
Option Explicit
'WMIにて使用する各種オブジェクトを定義・生成する。 Dim oClassSet Dim oClass Dim oLocator Dim oService Dim sMesStr 'ローカルコンピュータに接続する。 Set oLocator = WScript.CreateObject("WbemScripting.SWbemLocator") Set oService = oLocator.ConnectServer(, "Root\Microsoft\HomeNet") 'クエリー条件をWQLにて指定する。 Set oClassSet = oService.ExecQuery("Select * From HNet_FwIcmpSettings") 'コレクションを解析する。 For Each oClass In oClassSet sMesStr = sMesStr & "エコー要求の着信:" & oClass.AllowInboundEchoRequest & vbCrLf & _ "マスク要求の着信:" & oClass.AllowInboundMaskRequest & vbCrLf & _ "ルータ要求の着信:" & oClass.AllowInboundRouterRequest & vbCrLf & _ "タイムスタンプ要求の着信:" & oClass.AllowInboundTimestampRequest & vbCrLf & _ "到達できない宛先の送信:" & oClass.AllowOutboundDestinationUnreachable & vbCrLf & _ "パラメータ問題の送信:" & oClass.AllowOutboundParameterProblem & vbCrLf & _ "送信元抑制:" & oClass.AllowOutboundSourceQuench & vbCrLf & _ "時間経過の送信:" & oClass.AllowOutboundTimeExceeded & vbCrLf & _ "リダイレクトを許可:" & oClass.AllowRedirect & vbCrLf Next MsgBox ("WindowsファイアウォールのICMP設定の情報です。" & vbCrLf & vbCrLf & sMesStr) '使用した各種オブジェクトを後片付けする。 Set oClassSet = Nothing Set oClass = Nothing Set oService = Nothing Set oLocator = Nothing
Comment
実行すると現在のWindowsファイアウォールのICMP設定内容が表示されます。
を紹介しています。
Recommended book
個人的にお勧めする本の紹介です。
Latest sample information
最近WMI Sampleへ追加したサンプルのご紹介です。
|
|
ご意見・ご要望・ご感想をこちらのアンケートからお待ちしています |
| ∧ ページの先頭へ… |