yes they do. the \\pluto\software directory is a very commonly used directory.
Main Topics
Browse All TopicsI have a script that i'm trying to run on our domain as a log on script.
the first script references the second script.
Script 1:
If I run the script while logged in as the domain administrator the script runs successfully. However logged in as any other user I get the message shown in the screen shot attached to this post. Line 69 is the line that writes to the output log file on the server. I have no idea why permission is denied here. Any ideas?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
This line could be the problem:
objTextFile.WriteLine(objC
try changing to:
objTextFile.WriteLine(objC
Just moved the bracket after objComputer.MachineName
I would also try replacing this:
' ** This is the meat of the program and where the actual command is run.
rc = WshShell.Run ("runas /noprofile /user:" & sUser & " " & Chr(34) & sCommand & Chr(34))
' ** This gives the command window the time to open.
WScript.Sleep 900
' ** This will grab the active command window to send the password to.
WshShell.AppActivate(WinPa
' ** This will send the password to the waiting window.
WshShell.SendKeys sPass
with this
' ** This is the meat of the program and where the actual command is run.
rc = WshShell.Run ("\\pluto\software\psexec -accepteula -e -u " & sUser & " -p " & sPass " & " " & Chr(34) & sCommand & Chr(34), 1, True)
Which uses PSExec from Microsoft. It's far more reliable than sendkeys because the password can be passed directly.
Regards,
Rob.
so i commented out this part of the script:
'Set objTextFile = objFSO.OpenTextFile("\\plu
'objTextFile.WriteLine(obj
'objTextFile.Close
and now the script runs fine, but with the script running this way i have no confirmation that the script has actually run on all the machines.
again if I run the script as domain admin the script runs fine and writes to the log file on pluto. any more ideas?
As Asaf said, change this
objTextFile.WriteLine(objC
to this:
objTextFile.WriteLine(objC
Then check the permissions on the existing Finished.txt file and make sure the domain users can write to it.
Regards,
Rob.
still no good. The error is referring to line one of line 69 which is:
Set objTextFile = objFSO.OpenTextFile("\\plu
I don't understand why that would be affected by line 70. I'm going to try some more messing around with it. Any more help would be appreciated!
Did you check permissions? The line 70 would not affect line 69, but assuming that line 69 did work, line 70 would have had an error anyway.
I assume that Finished.txt already exists, so try changing that line 69 to this:
If objFSO.FileExists("\\pluto
MsgBox "File exists. Attempting to open for appending."
Set objTextFile = objFSO.OpenTextFile("\\plu
Else
MsgBox "Cannot find the file."
End If
That will probably still produce an error, but at least you'll know whether the script can find the file before it tries to open it.
Regards,
Rob.
HURRAY! I got the first script working, however I've developed a new problem.. The second script that is called by the first sript fails if it is run by someone without local admin privileges. Most of our users have local admin privs to their computer and no others, but some do not. In this case the password will no be reset if a non admin user logs in. the error is on line 50 char 1 which is :
objUser.SetPassword "new_password" ' <--- this will be the new admin password.
When the script fails it simly doesn't change the local admin password. any ideas now?
I've attached the code again in case i've changed anything since last time, so this is the current version.
Hmmm, is there any reason that you cannot include the file writing bit into the second script, then just run the second script as a StartUp script instead of a Logon script? This way, the script will run as the System account and won't need the admin credentials.
The only thing you'll have to do is move the script to the NetLogon share of your domain controllers, so that the SYSTEM account can read the script to run it.
Regards,
Rob.
OK, I've pieced your bits of code together, such that this should work as a logon script, provided that you change
"\\pluto\software\change\F
to something like
"\\domain.com\sysvol\domai
Where \\domain.com\sysvol\domain
You can test the script out manually while logged in as an administrator first.
Regards,
Rob.
Business Accounts
Answer for Membership
by: AsafBrukarzPosted on 2009-10-14 at 15:50:11ID: 25576000
It may be an obvious question, but have you confirmed that all domain users have write permission on the \\pluto\software\change\Fi nished.txt file?