Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Scripting Error 800A0046

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,3573
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Scripting Error 800A0046
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Scripting Error 800A0046 - 6/29/2005 4:15:01 AM   
  AndrewParker

 

Posts: 14
Score: 0
Joined: 6/29/2005
From:
Status: offline
Hi, can anyone help, I'm attempting to execute a script on a remote PC from my Domain Controller, unfortunatly I get a msg box stating 800A0046 error code and Permission Denied message.

The Domain Admins group is part of the PC's Local Admins group, I have modified the registry to allow remote scripts to execute however it still doesn't work, any ideas?

Script that is executed from the server below... Apart from the values entered into the first two vars this is cut straight from MS's Scripting book:

strRemoteComputer = "WORKSTATION-79"
strWorkerScript = "C:\Test.vbs"
Set objWshController =
WScript.CreateObject("WshController")
Set objRemoteScript = _
objWshController.CreateScript(strWorkerScript,
strRemoteComputer)
objRemoteScript.Execute

Do While Not objRemoteScript.Status = 2
Wscript.Sleep(100)
Wscript.Echo "Remote script not yet complete."
Loop

Thanks in advance.

Andrew Parker
 
 
Post #: 1
 
 Re: Scripting Error 800A0046 - 6/29/2005 12:30:01 PM   
  Xandros

 

Posts: 100
Score: 0
Joined: 6/23/2005
From:
Status: offline
There are several requirements for using WshController and CreateScript.

1 The machines involved all have to be running WSH 5.6... no earlier version supports
CreateScript.

2 The remote machine needs to have WshRemote enabled (it is disabled by default):
' Change the registry key "Remote" (of type REG_SZ) to 1. The default value is 0 (disabled)
' HKLM\Software\Microsoft\Windows Script Host\Settings\Remote

3 All machines must be NT, W2K, XP (Pro, not Home), or higher.

4 The account used to run the WshController script must have admin access to the remote machine to launch an instance of WshRemote via CreateScript. Add yourself to remote machine's Local Administrators Group.

5 If the remote machine is XP (pre-sp1) you probably need to run: wscript.exe -regserver
to register wscript.exe as an out of process COM server. Original XP installs have a bug that don't do this registration.

6 The remote machine needs to have DCOM enabled and properly configured. You can run DCOMCNFG to check, but it's normally enabled by default. The following configuration works for some users...
'
' A. execute DCOMCNFG
' B. highlight "WSHScript" at bottom of combo box
' C. click "Properties"
' D. on General tab...
' change Authentication type from "Default" to "Connect"
' E. on Identity tab...
' change from "The launching user" to This user"
' enter Userid/Password for account to use

(in reply to AndrewParker)
 
 
Post #: 2
 
 Re: Scripting Error 800A0046 - 6/29/2005 8:44:28 PM   
  AndrewParker

 

Posts: 14
Score: 0
Joined: 6/29/2005
From:
Status: offline
Thanks, I've confirmed the following:

1 The machines involved all have to be running WSH 5.6... no earlier version supports
CreateScript.

...Running cscript.exe has confirmed that both machines are running 5.6

2 The remote machine needs to have WshRemote enabled (it is disabled by default):
' Change the registry key "Remote" (of type REG_SZ) to 1. The default value is 0 (disabled)
' HKLM\Software\Microsoft\Windows Script Host\Settings\Remote

... This is turned on

3 All machines must be NT, W2K, XP (Pro, not Home), or higher.

...The calling machine is 2000 Server DC, the Remote PC is my XP SP2 PC (no Firewall)


4 The account used to run the WshController script must have admin access to the remote machine to launch an instance of WshRemote via CreateScript. Add yourself to remote machine's Local Administrators Group.

... The Domain Admins Group is a member of the Local Admins group on my PC

5 If the remote machine is XP (pre-sp1) you probably need to run: wscript.exe -regserver
to register wscript.exe as an out of process COM server. Original XP installs have a bug that don't do this registration.

...My PC (remote PC) is SP2

6 The remote machine needs to have DCOM enabled and properly configured. You can run DCOMCNFG to check, but it's normally enabled by default. The following configuration works for some users...
'
' A. execute DCOMCNFG
' B. highlight "WSHScript" at bottom of combo box
' C. click "Properties"
' D. on General tab...
' change Authentication type from "Default" to "Connect"
' E. on Identity tab...
' change from "The launching user" to This user"
' enter Userid/Password for account to use

... I get a Component Services Window when I run dcomcnfg not what you have above.

Any ideas, your help is greatly appreciated.

Regards

(in reply to AndrewParker)
 
 
Post #: 3
 
 Re: Scripting Error 800A0046 - 6/30/2005 12:59:52 AM   
  mbouchard


Posts: 1894
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Is the firewall on the remote PC turned on? Also, take a look at psexec.exe in Pstools from Www.sysinternals.com. While it won't allow you to run a vbs file you can run an exe/cmd file on a remote PC, which would allow you to call the vbs file.

(in reply to AndrewParker)
 
 
Post #: 4
 
 Re: Scripting Error 800A0046 - 6/30/2005 5:52:04 AM   
  Xandros

 

Posts: 100
Score: 0
Joined: 6/23/2005
From:
Status: offline
Please check the following registry key value:

HKEY_LOCAL_MACHINE\Software\Microsoft\OLE

The value should be "Y" if DCOM is enabled. When installed and enabled you should see the dialog I described above if you run DCOMCNFG.

(in reply to AndrewParker)
 
 
Post #: 5
 
 RE: Re: Scripting Error 800A0046 - 7/11/2005 11:36:06 AM   
  AndrewParker

 

Posts: 14
Score: 0
Joined: 6/29/2005
From:
Status: offline
Neither Firewall is on...

I want to execute the script without resorting to 3rd party products so I'll keep trying, maybe I'll do it with a GP as a last resort...

Thanks for your help.

(in reply to mbouchard)
 
 
Post #: 6
 
 RE: Re: Scripting Error 800A0046 - 7/11/2005 11:37:14 AM   
  AndrewParker

 

Posts: 14
Score: 0
Joined: 6/29/2005
From:
Status: offline
I'll have a look at this when I get back to work...

Thanks for your help.

(in reply to Xandros)
 
 
Post #: 7
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Scripting Error 800A0046 Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts