jonhicks
asked on
Problem running computer logon script from netlogon share
I have a computer logon script (under admin templates/System/Logon) that is a simple vb script to rename my computer. Code attached.
It runs fine if I enter the path as \\server1\netlogon\script. vbs.
If I enter the path as \\domain.local\netlogon\sc ript.vbs, users are prompted to run the script.
I'd like to resolve this because I don't like having to reconfigure (or at least check) GPOs whenever a DC is demoted.
It runs fine if I enter the path as \\server1\netlogon\script.
If I enter the path as \\domain.local\netlogon\sc
I'd like to resolve this because I don't like having to reconfigure (or at least check) GPOs whenever a DC is demoted.
Const MY_COMPUTER = &H11&
Set objNetwork = CreateObject("Wscript.Network")
strComputer = objNetwork.ComputerName
Set objShell = CreateObject("Shell.Application")
Set objFolder = objShell.Namespace(MY_COMPUTER)
Set objFolderItem = objFolder.Self
objFolderItem.Name = "My Computer " & strComputer
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Resolved the problem by running a computer startup script to add file://*.domain.local to the Local Intranet zone.
computer logon scripts run from \\domain.local\netlogon now run without a security warning.
Odd that this only affected computer logon scripts and not user logon scripts (which run fine without a warning).
computer logon scripts run from \\domain.local\netlogon now run without a security warning.
Odd that this only affected computer logon scripts and not user logon scripts (which run fine without a warning).
On Error Resume Next
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objReg=GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Windows\CurrentVersion\Internet Settings\" _
& "ZoneMap\Domains\domain.local"
objReg.CreateKey HKEY_LOCAL_MACHINE, strKeyPath
strValueName = "file"
dwValue = 1
objReg.SetDWORDValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, dwValue
ASKER
If I add file://*domain.local to the local Intranet zone in IE, it works without the warning.
I tried setting the script path as %logonserver%\netlogon\scr