subina

connecting to a remote compuer

4 posts in this topic

 

I am trying to connect to a remote computer. first thing i want the script to do is check that the computer is on the system. i verified that it does by using Ping and the computer name. which gives me the ip address.

i used the following code for that, but it returned the error message that the compute could not be located.

any ideas on why, as the ping give me a valid ip address. also once this done how do i code the script to connect

$ipaddress (found from ping command, not listed here for security reasons)

$oWMIService = ObjGet("winmgmts:\\" & $ipAddress & "\root\CIMV2")

If Not IsObj($oWMIService) Then
    MsgBox(48, "ERROR", "Couldn't locate the computer. Please make sure you've selected the correct computer and try again.")
    Return
EndIf

 

Share this post


Link to post
Share on other sites



ty

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now