carpediem Posted May 19, 2011 Posted May 19, 2011 (edited) I'm trying to achieve a folder syncronization from one of our servers to domain computers using a startup script (Running as local system) but I run into problems.The problemLogin scripts that require admin rights doesn't work on Vista/Windows .The solutionRun user logon scripts as before but move stuff that require admin rights into a startup script wich runs with Local System credentialsHere's what's happeningThe autoit3.exe is called from the startup script section in a GPO with the location of the script called as a parameter. This works fine and I've tested to create a file from the script and it lands on the remote computer just fine. I run into problems when I call robocopy to do its stuff. Running the script (with admin rigths) while logged in, it works fine, but when the script runs on startup Robocopy doesn't do anything.If anyone has an idea on why it doesn't work, I'd be very greatful. Is it that RoboCopy can't be called at all during a startup process (pre login)?Here's the script:$sBaseServerFolder = "\\fileserver\share\" $sBaseComputerFolder = "c:\localFolder\" $saCopyFolders = StringSplit("Folder1,Folder2,Folder3,FolderX",",") for $i = 1 to $saCopyFolders[0] $sCopyString = $sBaseServerFolder & $saCopyFolders[$i] & ' ' & $sBaseComputerFolder & $saCopyFolders[$i] Run(@ScriptDir & '\robocopy.exe' & ' ' & $sCopyString & ' /S /E /R:0 /W:0', "", @SW_HIDE) Next Edited May 19, 2011 by carpediem
hannes08 Posted May 19, 2011 Posted May 19, 2011 Hi carpediem, I guess you "local system" has no access to \\fileserver\share. Either you grant access for the Computer object to that folder, or you can try to do a DriveMapAdd() with given credentials before you run the robocopy. Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]
carpediem Posted May 19, 2011 Author Posted May 19, 2011 (edited) Hi carpediem,I guess you "local system" has no access to \\fileserver\share.Either you grant access for the Computer object to that folder, or you can try to do a DriveMapAdd() with given credentials before you run the robocopy.I Hannes and thanks for the tip.The test machine already has access to read autoit3.exe, the script and robocopy.se (all files are in the same folder in the sysvol share for the startup script) Edited May 19, 2011 by carpediem
carpediem Posted May 24, 2011 Author Posted May 24, 2011 If anyone has tips, it would be greatly appreciated.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now