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.
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.
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