Click to See Complete Forum and Search --> : SWbemLocator error '800706ba' The RPC server is unavailable.


pankbug2000
April 8th, 2009, 08:44 AM
Hello All,

I am trying to run a wav file on a remote machine(Let's say A). For this I have created a batch file on A, which runs wave file. Now I am trying to schedule a task on A using VBScript. But I am getting this error:

SWbemLocator error '800706ba'
The RPC server is unavailable.

Following is my code

strComputer = A_IP_ADD
Set objSWbemLocator = Server.CreateObject("WbemScripting.SWbemLocator")
Response.Write("<br> objSWbemLocator Created")

Set objSWbemServices = objSWbemLocator.ConnectServer _
(strComputer, "root\cimv2", DOMAIN\USEERNAME, PASSWORD)
Response.Write("<br> objSWbemServices Created")

objSWbemServices.Security_.impersonationlevel = 3
objSWbemServices.Security_.AuthenticationLevel = 6
Response.Write("<br> Impersonation level set")

Set objNewJob = objSWbemServices.Get("Win32_ScheduledJob")
Const JobID = "Play_Sound"
errJobCreated = objNewJob.Create _
(BATCH_FILE_PATH, "********072000.000000-420", _
False , , , , JobID)
Response.Write("<br> JOB CREATED: "& errJobCreated)

I am able to login to A through VNC using same user name and password that I am using in this code.

Please help me out with this. Thanks in advance.