Author Topic: Logon script on GPO not run on Zentyal 4.2.2 server  (Read 5094 times)

patricktslee

  • Zen Apprentice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Logon script on GPO not run on Zentyal 4.2.2 server
« on: March 13, 2016, 02:32:20 pm »
I created GPO, Windows10, using Group Policy Management under one of Users OU and configure the logon script path \\anc.hk\SysVol\anc.hk\scripts\Windows10\Users\logon.cmd under User Configuration - Policies - Windows Settings - Scripts (Logon/Logoff).  I put my user account into that OU.  However it didn't run on my Windows 10 machine.

I checked that I can manually run the script and mapped the network drive.

Don't know why it can't automatically run it.  How can I troubleshoot it?

BerT666

  • Zen Warrior
  • ***
  • Posts: 228
  • Karma: +17/-0
    • View Profile
Re: Logon script on GPO not run on Zentyal 4.2.2 server
« Reply #1 on: March 14, 2016, 11:19:50 am »
did you set the GPO to enforced? In my Net, this helped...

Regards

Thomas

patricktslee

  • Zen Apprentice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Logon script on GPO not run on Zentyal 4.2.2 server
« Reply #2 on: March 14, 2016, 04:13:33 pm »
Thanks Thomas.

GPO is set enforced.  It didn't map the drive.  I have run the gpresult /h gpo.html and check gpo.html.  I found that \\anc.hk\SysVol\anc.hk\scripts\Windows10\Users\logon.cmd    has been run 14/3/2016 22:59:56 which is after my logon time.  Please see my capture.PNG.

I have tried to set pause command on logon.cmd.  However no command prompt popup and show the "Press any key to continue" after I logon.

How to set the logon script to show after I logon?

BerT666

  • Zen Warrior
  • ***
  • Posts: 228
  • Karma: +17/-0
    • View Profile
Re: Logon script on GPO not run on Zentyal 4.2.2 server
« Reply #3 on: March 16, 2016, 01:29:41 pm »
Howdy,

maybe I have an Idea how to troubleshoot:

- open a shell on the server (local or SSH)
- tail -f /var/log/syslog       (shows syslog updates in realtime)
- try to logon on the WIN-Client

at best you can find hints for troubleshooting...
Another way to test could be to create a "public share" ,put the logon-script there (adjust the script path) and retry...

Regards

Thomas

patricktslee

  • Zen Apprentice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Logon script on GPO not run on Zentyal 4.2.2 server
« Reply #4 on: March 16, 2016, 03:30:01 pm »
Hi Thomas,

Here is the log after I logon the Windows 10 machine. 

Quote
Mar 14 23:35:39 zentyal dhcpd: DHCPREQUEST for 10.0.1.100 from 08:00:27:45:9f:ae (DESKTOP-N2UF8JO) via eth0
Mar 14 23:35:39 zentyal dhcpd: DHCPACK on 10.0.1.100 to 08:00:27:45:9f:ae (DESKTOP-N2UF8JO) via eth0
Mar 14 23:35:45 zentyal named[2904]: samba_dlz: starting transaction on zone anc.hk
Mar 14 23:35:45 zentyal named[2904]: client 10.0.1.100#57418: update 'anc.hk/IN' denied
Mar 14 23:35:45 zentyal named[2904]: samba_dlz: cancelling transaction on zone anc.hk
Mar 14 23:36:26 zentyal smbd_audit: ANC\plee04|10.0.1.100|connect|ok|plee04
Mar 14 23:36:36 zentyal smbd_audit: ANC\plee04|10.0.1.100|connect|ok|mgti-common
Mar 14 23:36:36 zentyal smbd_audit: ANC\plee04|10.0.1.100|connect|ok|plee04
Mar 14 23:36:36 zentyal smbd_audit: ANC\plee04|10.0.1.100|connect|ok|mgti
Mar 14 23:36:42 zentyal smbd_audit: ANC\plee04|10.0.1.100|opendir|ok|.
Mar 14 23:36:42 zentyal smbd_audit: ANC\plee04|10.0.1.100|opendir|ok|.
Mar 14 23:37:01 zentyal smbd_audit: ANC\plee04|10.0.1.100|open|ok|r|.

I added 2 commands to map my home drive \\zentyal.anc.hk\plee04 and \\zentyal.anc.hk\mgti public drive.
It looks like that it is connected but the Windows 10 machine still don't map the network drive.

Thanks

Patrick Lee

BerT666

  • Zen Warrior
  • ***
  • Posts: 228
  • Karma: +17/-0
    • View Profile
Re: Logon script on GPO not run on Zentyal 4.2.2 server
« Reply #5 on: March 17, 2016, 12:33:28 pm »
Hi,

beside the named error (DNS Update failed), everything looks good...
I think I once had a similar problem, forcing me to run the scripts "on my own"...

Can you try to do drive-mapping via GPO?
In my "home-net" this is working like a charm.

Sorry, but atm I do not have any clue regarding to the logon-script :-(

Regards

Thomas

patricktslee

  • Zen Apprentice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Logon script on GPO not run on Zentyal 4.2.2 server
« Reply #6 on: March 22, 2016, 01:17:20 pm »
Hi Thomas

Thanks your help.  The Drive mapping via GPO is working fine.

Regards.

Patrick