none
Log on and Log off scripts though group policy?

    Question

  • Hi,

    I was wondering if someone could help me or guide me into why is wrong.

    So I am trying to set up a log on/ off script though GPO when users logon it will show when they log on. See pictures

    The bash script works because when I click it it shows me the txt document, but not working on gpo log on and off. Not sure where I went wrong.

    I used this http://community.spiceworks.com/how_to/82-monitor-user-log-in-and-log-off-without-software

    as the guide.

    Thank you

    rem The following line creates a rolling log file of usage by workstation echo Log In %Date% %TIME% %USERNAME% >> \\zeus\Logs\Computer\%COMPUTERNAME%.log rem The following line creates a rolling log file of usage by user echo Log In %Date% %TIME% %COMPUTERNAME% >> \\zeus\Logs\User\%USERNAME%.log

    rem The following line creates a rolling log file of usage by workstation
    echo Log Off %Date% %TIME% %USERNAME% >> \\zeus\Logs\Computer\%COMPUTERNAME%.log
    
    rem The following line creates a rolling log file of usage by user
    echo Log Off %Date% %TIME% %COMPUTERNAME% >> \\zeus\Logs\User\%USERNAME%.log


    Thursday, September 3, 2015 12:03 AM

All replies

  • Please follow this informative article that covers all the required steps in order to audit successful logon/logoff and failed logons in Active Directory : http://www.lepide.com/blog/audit-successful-logon-logoff-and-failed-logons-in-activedirectory/

    Carlo

    Thursday, September 3, 2015 10:12 AM
  • Probably NTFS permissions on your share.

    However I'd be inclined to agree with Carlo - audit events are much more reliable and should be used for your purpose.


    • Edited by zxxzxx Thursday, September 3, 2015 3:43 PM typo
    Thursday, September 3, 2015 10:16 AM
  • Hi Thank you for your response Carlo I did use the audit events for windows server but did not really like it that much. What I like about this bash script, it user friendly when i need to see a log.

    Thank you again

    Thursday, September 3, 2015 3:19 PM
  • Hi zxxzxx, Thank you for your response, when you mean NTFS permission that all the users on the AD should have a network drive connected? Becuase on my test users has all permisons. What I think is not working is gpo log on and log off settings.

    Thank youSee picture

    Thursday, September 3, 2015 3:27 PM
  • Your share permissions look correct (first screenshot), but the NTFS permissions look incorrect (second screenshot). There is no entry for users so it should be added. Add 'Authenticated Users' in the permissions with Modify.

    Assuming it is a user logon script GPO, when the script runs it will run as the user so you must grant the appropriate permissions.

    Thanks

    Thursday, September 3, 2015 3:42 PM
  • hi,

    sorry for the late reply :(, So I tried to implement on another server and it seems to be working but only on few computers i wonder why? As you can see its working on some computers but theres another another 50 computers. Did I miss something?

    Thank you

    Monday, September 7, 2015 7:05 PM