Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Want to run a script at logoff

169 views
Skip to first unread message

Ashpoint

unread,
Jun 14, 2009, 6:56:01 AM6/14/09
to
I have a small DOS batch file that I would ike to run when a user logs off
their workstation.

I have no experience with Group Policy but laoded the Group Policy utility
in the MMC and "think" I added the file to the right section for logout
scripts. But, the script does not get run.

I've tested the script and it works fine, I just need to know how to
configure the GP so that the script runs on the worksation when the user logs
off.

Maybe someone can direct me to a "dummy's" HowTo step by step to show me the
way?


Meinolf Weber [MVP-DS]

unread,
Jun 14, 2009, 7:23:49 AM6/14/09
to
Hello Ashpoint,

The GPO with the script has to be linked to the OU, not container, where
the user accounts are located. Then you have to wait 90-120 minutes for automatic
GPO refresh or run gpupdate /force or reboot.

I assume you have used Group policy management console, gpmc.msc (console
for domain management)? Or did you run Group policy editor gpedit.msc (locally
on the machine)?

Best regards

Meinolf Weber
Disclaimer: This posting is provided "AS IS" with no warranties, and confers
no rights.
** Please do NOT email, only reply to Newsgroups
** HELP us help YOU!!! http://www.blakjak.demon.co.uk/mul_crss.htm

Marcin

unread,
Jun 14, 2009, 10:00:01 AM6/14/09
to
Refer to http://support.microsoft.com/kb/322241

hth
Marcin

"Ashpoint" <Ashp...@discussions.microsoft.com> wrote in message
news:7B539223-142D-4CBF...@microsoft.com...

Twayne

unread,
Jun 14, 2009, 11:23:05 AM6/14/09
to

Only says for Win2k; is it exactly the same for XP?

Twayne


Ashpoint

unread,
Jun 14, 2009, 4:34:01 PM6/14/09
to
Hi Meinolf...

I'm confused about your comment "The GPO with the script has to be linked to

the OU, not container, where
the user accounts are located"

I used the MMC and added the Group Policy Object Editor in the (default)
"Local Computer"

In there, I navigated to User Configuration, Scriots (Login/Logoff) and
selected Logoff.

In there I added \\Myserver\netlogon\logoff.bat

I díd do a GPUpdate /Force AND also revisited the system after overnight.

The login script still does not run.

Ashpoint

unread,
Jun 15, 2009, 2:11:01 AM6/15/09
to
We have a Windows 2003 Server domain and WinXPPro workstations that are all
joined to the domain. All my GPO work has been on the server.

Regards,
Michael

"Meinolf Weber [MVP-DS]" wrote:

> Hello Ashpoint,
>
> Do you have a domain or only workgroup machines?

Meinolf Weber [MVP-DS]

unread,
Jun 15, 2009, 1:43:43 AM6/15/09
to
Hello Ashpoint,

Do you have a domain or only workgroup machines?

Best regards

Meinolf Weber
Disclaimer: This posting is provided "AS IS" with no warranties, and confers
no rights.
** Please do NOT email, only reply to Newsgroups
** HELP us help YOU!!! http://www.blakjak.demon.co.uk/mul_crss.htm

> Hi Meinolf...
>
> I'm confused about your comment "The GPO with the script has to be
> linked to the OU, not container, where the user accounts are located"
>
> I used the MMC and added the Group Policy Object Editor in the
> (default) "Local Computer"
>
> In there, I navigated to User Configuration, Scriots (Login/Logoff)
> and selected Logoff.
>
> In there I added \\Myserver\netlogon\logoff.bat
>

> I d�d do a GPUpdate /Force AND also revisited the system after

Meinolf Weber [MVP-DS]

unread,
Jun 15, 2009, 2:26:00 AM6/15/09
to
Hello Ashpoint,

If you use gpedit.msc you work locally on the server, in a domina configure
GPOs with GPMC and add them to the OUs where either the user or computer
is located.

Best regards

>>> I d�d do a GPUpdate /Force AND also revisited the system after

Ashpoint

unread,
Jun 16, 2009, 11:49:01 PM6/16/09
to
Hello Meinolf...

Thank you for your continued patience.

I downloaded GPMC and ran it on our main domain server.
Drilled down to Domains, OurDomain.local, domain controllers, Default Domain
Controlers Policy.
In the Settings tab I drilled down to Windows Settings, Scripts, Logoff and
see an entry "\\ourserver\Netlogon\Logout.bat"

The contents of Logout.bat is a single line as follows:

\\OurPDC\NetLogon\Kix32.exe \\OurPDC\NetLogon\TrackLogout.kix

I've placed a PAUSE before this line but when logging out of a workstation,
I'm not seeing a PAUSE in a DOS box. It leads me to believe that the batch
file is not even being executed. This could be because:

A) the path to \\ourserver\Netlogon is not available at time of loging off OR
B) the settings in the GPMC is in the wrong place.

Are you able to assits further?

Best regards,
Michael

"Meinolf Weber [MVP-DS]" wrote:

> >>> I díd do a GPUpdate /Force AND also revisited the system after

Meinolf Weber [MVP-DS]

unread,
Jun 17, 2009, 2:25:07 AM6/17/09
to
Hello Ashpoint,

The default domain controllers policy effects ONLY the domain controllers,
as the name states. You should not change this policy or the default domain
policy, create new GPOs and link them to the same level if needed, if you
have problems you can always easy go back to the default ones with deleting
the self created.

In your case the logoff should run on USER logoff on there workstations so
the GPO has to be linked to an OU where the user accounts are located.

I would strongly recommend that you built for your self a test system before
you use them in production environment. At least configure a test GPO with
test computer and test user accounts.

Even it sounds that you have not that knowledge about administrating a domain
and GPOs. Building a domain environment eis easy with just some clicks.

See here for some more infos about GPO configuration:
http://technet.microsoft.com/en-us/windowsserver/grouppolicy/default.aspx


Best regards

>>>>> I d�d do a GPUpdate /Force AND also revisited the system after

Lanwench [MVP - Exchange]

unread,
Jun 19, 2009, 9:04:14 AM6/19/09
to
Meinolf Weber [MVP-DS] <meiweb(nospam)@gmx.de> wrote:
> Hello Ashpoint,
>
> The default domain controllers policy effects ONLY the domain
> controllers, as the name states. You should not change this policy or
> the default domain policy, create new GPOs and link them to the same
> level if needed, if you have problems you can always easy go back to
> the default ones with deleting the self created.
>
> In your case the logoff should run on USER logoff on there
> workstations so the GPO has to be linked to an OU where the user
> accounts are located.
> I would strongly recommend that you built for your self a test system
> before you use them in production environment. At least configure a
> test GPO with test computer and test user accounts.
>
> Even it sounds that you have not that knowledge about administrating
> a domain and GPOs. Building a domain environment eis easy with just
> some clicks.
> See here for some more infos about GPO configuration:
> http://technet.microsoft.com/en-us/windowsserver/grouppolicy/default.aspx

Also, Ashpoint - never edit the default policies. Create your own - test
them - link them. Otherwise you run the risk of doing some Very Bad Things
to your network.

0 new messages