WMI question

Joined
Jun 13, 2009
Messages
1
Reaction score
0
Hi all!

Got a dumb question on WMI. Tried to find the answer on the net but got confused even deeper.

I got 2 comps that are NOT part of a domain. They are connected between each other with net cable and are in the same workgroup.

I have created the same user account that is part of Admin group on both computers.

Can i run this script without having a domain set up?

Code:
strComputer = "comp-a"
 
On Error Resume Next
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\CIMV2")
If Err.Number <> 0 Then
WScript.Echo Err.Number & ": " & Err.Description
WScript.Quit
End If
Set objSoftware = objWMIService.Get("Win32_Process")
If Err.Number <> 0 Then
WScript.Echo Err.Number & ": " & Err.Description
WScript.Quit
End If
Res = objSoftware.Create("notepad.exe", Null, Null, PID)
If Err.Number <> 0 Then
WScript.Echo Err.Number & ": " & Err.Description
WScript.Quit
End If
MsgBox "OK"

I am confused because Microsoft says "The account on Computer B must be in the Administrator group, but a domain account is not required."
(http://msdn.microsoft.com/en-us/library/aa389290(VS.85).aspx)
Giving a similar script as an example

Thank you
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top