Re: wshController CreateScript errors
- From: vedeht <DevinHenderson@xxxxxxxxx>
- Date: Wed, 20 Feb 2008 07:45:22 -0800 (PST)
On Feb 6, 3:00 am, FUBARinSFO <file1...@xxxxxxxxx> wrote:
Hi:
I really hate to post this request for help, but I've spent about just
as much time on this problem as I can handle.
In attempting to use wshController on a remote machine on the LAN,
I've been getting either of two errors:
"the remote server machine does not exist or is unavailable", and
"permission denied"
The two machines K7N and MPX2 are both Windows XP SP2 systems, and
Windows Explorer can browse each other's shared files OK. Both the
source and the target are Administrators users. My actual scripts
work OK since I've inclued the local machine as the first system in
the computer system name file, as a loopback test.
What seems ridiculous to me is that when I vary the Windows Firewall
setting on the remote machine I get strictly counterintuitive results:
with firewall off, I get "permission denied"; with it on I get "the
remote server machine does not exist or is unavailable". I've got it
set to popup on blocked programs, but nothing pops up, and there's no
pfirewall.log (indicating nothing blocked).
I've explored and set all the tests per the posts here insofar as I've
been able to
The one open issue is this directive: " Make sure that the user
account that is used to run the script is in the local administrator
group on the target." I have assumed that since the browers work OK
and can read/write each other the accounts are OK. This sounds pretty
lame, but it may be here that I've failed to make the connection.
I'm afraid this makes me feel pretty clueless insofar as persmissions
and security settings are concerned. It would be a great help if
someone would be able to point me to a document for debugging this
sort of security and DCOM commuication problem.
Thank you in advance for your help.
-- Roy Zider
.......................................................................................
' deployment.vbs Remote script deployment script
' 2/5/2008 lsz
'
' Originally fromhttp://www.raybryan.com/tools/advanced%20vbscript.pdf
' Advanced VBScript for Microsoft Windows Administrators
'
' See further notes at End
Option Explicit
Dim objController, objRemoteScript, objFSO
Dim objTSIn, objTSOut, strComputer
'Create objects
Set objController = CreateObject("WshController")
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Read computer names from file
' Set objTSIn = objFSO.OpenTextFile("C:\computers.txt")
Set objTSIn = objFSO.OpenTextFile("computers.txt") ' local folder
'Open output file for Log
' Set objTSOut = objFSO.CreateTextFile("C:\log.txt", True)
Set objTSOut = objFSO.CreateTextFile("log.txt", True) ' local folder
Do Until objTSIn.AtEndOfStream
'Deploy script to remote computer
strComputer = objTSIn.ReadLine
objTSOut.WriteLine strComputer & ": Deploying at " & Now
Set objRemoteScript = objController.CreateScript( _
"C:\Deployed.vbs", strComputer) ' c:\deployed.vbs is to be
deployed
WScript.ConnectObject objRemoteScript, "remote_"
objRemoteScript.Execute
Do Until objRemoteScript.Status = 2 ' 1 is running, 2 is done.
(error in book)
WScript.Echo "."
WScript.Sleep 1000
Loop
objTSOut.WriteLine strComputer & ": Completed at " & Now
Set objRemoteScript = Nothing
Loop
objTSIn.Close
objTSOut.Close
WScript.Echo "Deployment script complete."
' --- SUBS -----------------------------------------
Sub remote_Start
WScript.echo strComputer & ": Starting remote script"
End Sub
Sub remote_End
WScript.Echo strComputer & ": Ending remote script"
End Sub
Sub Remote_Error
' from Microsoft Technet
'http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_dzqk.mspx...
Wscript.Echo "Error Running Remote Script."
Dim objError : Set objError = objRemoteScript.Error
WScript.Echo "(" _
& objError.Line & ", " _
& objError.Character & ") :" _
& objError.Description
Wscript.Echo "Number :" & hex(objError.Number)
Wscript.Echo "Source :" & objError.Source
Wscript.Echo "Source Text :" & objError.SourceText
objRemoteScript.Terminate
Wscript.Quit
End Sub
.......................................................................................
The access denied is exactly what it says. You don't have permission
one way or another to what you are trying to access. I had this exact
scenario happen to me. I had the windows firewall service disabled
temporarily because I was doing a migration from one domain to
another.
I feel like you are not going to like this post but if you are
receiving an access denied it isn't because of the firewall. The
firewall will prevent you from connecting to a client but it will not
give you an access denied message.
Are you using the same account to browse the shares with that you
launch the script from?
.
- References:
- wshController CreateScript errors
- From: FUBARinSFO
- wshController CreateScript errors
- Prev by Date: The Best ADSI Editor????
- Next by Date: Problemas With W2K3+SP2 with WMI
- Previous by thread: wshController CreateScript errors
- Next by thread: Re: Script that uses Windows Native File Compress Program
- Index(es):
Relevant Pages
|
Loading