Quantcast
Channel: Group Policy forum
Viewing all articles
Browse latest Browse all 19997

Group Policy does not run logon script

$
0
0

Seems I've got code blindness or there is some permission preventing a script in my GPO from running.

Here's the script:

Dim objShell
Dim cmd
Set objShell = CreateObject("Wscript.Shell")
cmd = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -nologo -noProfile -NonInteractive -ExecutionPolicy bypass -File \\MYDOMAINCTLR\SYSVOL\my.domain.com\scripts\mydir1\mydir2\myfile.ps1"
objShell.Run cmd,0

It's a vbs script that calls a powershell script (located in the netlogon share).  Calling the powershell script this way bypasses execution policy and suppresses popup windows.  The powershell script copies files (with robocopy) and does some other things.  Nothing too complicated.

The script is located here:

\\my.domain.com\SysVol\my.domain.com\Policies\{GUID}\Users\Scripts\Logon

In the GP Management Console, I go to User Configuration > Windows Settings > Scripts > Logon/Logoff.  The location above with the GUID is the location the GP Management Console creates when I configure the script.  To get the script in this location I right-click the window, create a new text document, edit it with the above script contents, and then change the extension.

The script works as expected when I right click it (from the GP Management Console window) and select "Open With... Windows Scripting Host."  The results are applied to the domain controller.  So the script itself has been tested successfully.  It's just not kicking off when users log in.

I've linked the GPO to the OU containing the users the script is designed to work, but nothing happens on logon.  There is no entry in the Event Log indicating failure of the GPO.

I've added "Everyone" and "Domain Users" (full control) to the security of the GPO and verified the paths of everything.

UAC is enabled on the Domain Controller - could this be the problem?  Is there something I did wrong creating the OU?  What permission could I missing?  Other ideas?


Viewing all articles
Browse latest Browse all 19997

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>