Solved

wmi connection to a remote computer

Posted on 2011-03-03
2
517 Views
Last Modified: 2012-05-11
I'm trying to get the events log from a remote computer, using the following code. I can get the information if I'm working on the computer but not if connected in remote. My local computer is Windows 7 and the remote W2003.

Therefore,  what should I do?
strComputer = "."

Set objWMIService = GetObject("winmgmts:" _
 & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Open in new window

0
Comment
Question by:Pakhu1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
khaaz earned 500 total points
ID: 35026599
You should try this  (after having set strcomputer, struser, strpassword with the ip address of your remote computer, and a user/password that has access to this computer)


strComputer="192.168.0.10"
strUser="myDomain\adminaccount"
strPassword="adminpassword"

Set WbemLocator= CreateObject("wbemscripting.swbemlocator")
set objWMIService=wbemLocator.connectServer(strComputer,,strUser,strPassword)
	
	

Open in new window

0
 

Author Closing Comment

by:Pakhu1
ID: 35034377
Thank you!!!
0

Featured Post

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question