| |
Mallen
Posts: 2
Score: 0
Joined: 6/22/2004
From:
Status: offline
|
I'm new to scripting, and could use some help. I'm trying to retrieve a list of services on a remote computer using WMI. Although I have gotten it to work on the server it's running on, I'm running into trouble now. As far as I understand things, in order to do this on a remote computer, I need to supply an explicit username and password as ConnectServer arguments. However, After doing this, the code gives me an "access denied" error, even though I'm supplying the username and password of an account from the administrator group. Not sure if this is relevant, but here's something of note about the security logs on the target remote computer. The administrator set up an account within the administrator group for me to use. However, whenever I try to log on using that account via ConnectServer, the security log shows a failed attempt by "SYSTEM". In addition, in the details about the failed attempt, the correct username is listed. I can't figure it out. Here's a snippet of the code (with the username and password literals replaced, of course). Set wbemServices = CreateObject("WbemScripting.SWbemLocator") Set wbemConnection = wbemServices.ConnectServer _ ("fnetserv","\root\cimv2","MyUsername","MyUserNameIsBusted") wbemConnection.Security_.ImpersonationLevel = 3 Set wbemObjectSet = wbemConnection.ExecQuery("SELECT * FROM Win32_Service") Another topic of note was that in the security log, the authority process was called "Microsoft something" (i forget now), whereas every other process was NTLM. I figured this was the COM verifying and determining proper authority from the network, so I wasn't worried about it, but if I should specify exactly to use NTLM in ConnectServer, can someone give me the exact literal to use? Sorry for being longwinded, and thanks in advance for any help on these issues!
|
|