作成 2010.01.07
更新 2010.01.07
更新 2010.01.07
WMI リモート接続
事前準備
- ファイアウォールをあける
リモート管理やRPCをあける。
リモート接続
- 基本
Set objWMIService = GetObject("winmgmts:\\TargetComputer")
Set objWMIService = GetObject("winmgmts:\\DomainName\TargetComputer")
Set objWMIService = GetObject("winmgmts:\\TargetComputer\root\cimv2")
wbemImpersonationLevelImpersonate = 3
wbemAuthenticationLevelPktPrivacy = 6
Set objLocator = CreateObject("WbemScripting.SWbemLocator")
Set objService = objLocator.ConnectServer _
("TargetComputer", "root\cimv2", "UserName", "Password")
objService.Security_.ImpersonationLevel = wbemImpersonationLevelImpersonate
objservices.Security_.AuthenticationLevel = wbemAuthenticationLevelPktPrivacy