Security File Open Error vbs script from Netlogon Share
-
Thursday, March 29, 2012 7:36 PM
Hi,
I am a newbie as far as scripting is concerned and I have used a vb script to create a shortcut on a windows xp desktop, what I would like to do is create a desktop for specific machines in one ou with a gpo loopback policy applied.
so I though run the script as a startup script, if I run the script locally it works fine, if I run it from the netlogon share I get the Security file open message. I did some googling and found the http://support.microsoft.com/kb/889815 link which seems to resolve the issue. I have tried modifying the original script to include the additional Method 1: Change the SEE_MASK_NOZONECHECKS environment variable I dont get any error message but I still get the security file open message. The machine does not have client side extensions loaded nor does it have cscript
Can someone please point me in the correct direction so I can fix the Problem (Presumably) ?
SET fso = Wscript.CreateObject("Scripting.FileSystemObject")
SET WshShell = WScript.CreateObject("WScript.Shell")
SET oEnv = WshShell.Environment("PROCESS")
oEnv("SEE_MASK_NOZONECHECKS") = 1
WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%")
strDsk = WshShell.SpecialFolders("Desktop")
strshortcut = strDsk & "\Reporting.lnk"
If Not fso.FileExists(strshortcut) Then
SET oUrlLink = WshShell.CreateShortcut(strshortcut)
oUrlLink.TargetPath = "https://192.168.100.1:8080"
oUrlLink.IconLocation = Windir & "\System32\URL.dll,0"
oUrlLink.Save
oEnv.Remove("SEE_MASK_NOZONECHECKS")
End If
All Replies
-
Thursday, March 29, 2012 7:45 PM
Why are you running this from terh NETLOGN share. That is not a location that is available to users. It is fo rth OS tto load specific items like the default profile.
Start by describing the problem you are trying to solve.
¯\_(ツ)_/¯
-
Thursday, March 29, 2012 8:51 PMI want a desktop shortcut placed on each machine, I copied the script to the netlogon share because that is where I was testing it from
-
Thursday, March 29, 2012 8:55 PM
I want a desktop shortcut placed on each machine, I copied the script to the netlogon share because that is where I was testing it from
YOu cannot remotely access a share when running a remote script like WMI.
Netlogon is not an open share. Use a standard share.
Netlogon also appears to not be trusted. This is prpbably due to zone settings being ccorrupt or set incorrectly. If this happens with a standard share and you are running at the console then you have issues.
¯\_(ツ)_/¯
-
Thursday, March 29, 2012 9:14 PM
I would like to create a desktop shortcut on remote machines, I was planning to use a startup script on each machine a gpo is applied, the script does not run presumably because when i was testing it running it from the netlogon share it displays a file security open error message. I dont want to run it from the Netlogon share the actual script is here C:\Windows\SYSVOL\sysvol\adatum.com\Policies\{GUID of GPO}\Machine\Scripts\Startup but the point I was trying to make is that if the script will not run manually then I cant be surprised if it wont run automatically.
-
Thursday, March 29, 2012 9:26 PM
I would like to create a desktop shortcut on remote machines, I was planning to use a startup script on each machine a gpo is applied, the script does not run presumably because when i was testing it running it from the netlogon share it displays a file security open error message. I dont want to run it from the Netlogon share the actual script is here C:\Windows\SYSVOL\sysvol\adatum.com\Policies\{GUID of GPO}\Machine\Scripts\Startup but the point I was trying to make is that if the script will not run manually then I cant be surprised if it wont run automatically.
Most of us run scripts from GP all of the time. There is never an issue except if you are doing something that requires a user response or something that you should not be doing.
Shortcuts can be more easily created from Group Policy Preferences. Shortcuts are not usually created from script as it is a one time operation.
If you are trying to create global shortcuts then just use a a Computer GPP to create them in ALLUsers. If you want to do it from script then create teh shortcut and copy it to all machines AllUsers profile.
You are runing into trouble because you are trying to approach this from the back end.
¯\_(ツ)_/¯
-
Thursday, March 29, 2012 9:43 PM
This version works fine in a GPO but not is a staup script. It will only work in a login script. In a startup script you can only target the ALLUsers profile. To do this you cannot ask for teh desktop. Startup scripts are sessionless and have no desktop. Get teh profiles path and add allusers and desktop.
Again, this all is very easy in GPP but much harder in a script.
SET fso = Wscript.CreateObject("Scripting.FileSystemObject") If Not fso.FileExists(strshortcut) Then SET WshShell = WScript.CreateObject("WScript.Shell") WinDir = WshShell.ExpandEnvironmentStrings("%WinDir%") strDsk = WshShell.SpecialFolders("Desktop") strshortcut = strDsk & "\Reporting.lnk" With WshShell.CreateShortcut(strshortcut) .TargetPath = "https://192.168.100.1:8080" .IconLocation = Windir & "\System32\URL.dll,0" .Save End With End If
¯\_(ツ)_/¯
- Edited by jrvMicrosoft Community Contributor Thursday, March 29, 2012 9:45 PM
- Proposed As Answer by Richard MuellerMVP, Moderator Monday, April 02, 2012 9:44 PM
- Marked As Answer by IamMredMicrosoft Employee, Owner Thursday, April 05, 2012 12:49 AM
-
Sunday, April 01, 2012 10:09 PMModerator
Startup scripts run before there is any user, so there is no desktop. Either use a logon script, or GPP, as jv suggested.
Richard Mueller - MVP Directory Services
- Marked As Answer by IamMredMicrosoft Employee, Owner Thursday, April 05, 2012 12:49 AM

