Simple script to test if GPO is being executed.

  • 7006270
  • 14-Jun-2010
  • 20-May-2015

Environment

Novell Open Enterprise Server 2 (OES 2) Linux Support Pack 2
Novell Domain Services for Windows


Situation

Simple script to test if GPO is being executed.

Resolution

Here is a script to test if a GPO is being executed. The script will launch a window showing the login script execution time and a second message box will display the drive mapping after the user has logged in to the workstation.

Change the domain name from the example of novell.com to the appropriate domain name.

'The test GPO script. Copy and paste this script to your favorite text editor.

'Then change the domain name from novell.com to the appropriate domain name

WScript.Echo "Login Script execution time "& Time

'map network drive to sysvol as in TID 7005685
Set objNetwork = CreateObject("WScript.Network")
objNetwork.MapNetworkDrive "N:" , "\\novell.com\sysvol\novell.com\sysvol"

'message box
WScript.Echo "Map drive N: "
Wscript.Quit

After creating the script, map a drive to the sysvol with the domain name z:\<domain>\sysvol\<domain>\syvol\
example:\\novell.com\sysvol\novell.com\sysvol

Place the newly created script in the z:\<domain>\Policies\{31B2F340-016D-11D2-945F-00C04FB984F9}\USER\Scripts\Logon
example: z:\novell.com\Policies\ {31B2F340-016D-11D2-945F-00C04FB984F9}\USER\Scripts\Logon

If you are unable to add a script to the sysvol follow KB 7005685.

Edit the GPO with the Group Policy Management tool ran from the workstation.
In the User Configuration – Windows Settings – Scripts (Logon/Logoff) – Logon click add and select  the script, click OK, click Apply, and click OK.

Logout and log back in to the domain on the workstation. The script should execute.