Someone asks me the subject question at least once a week, so in self defense:
- Create a logoff.bat file in the
%SystemRoot%\SYSVOL\sysvol\<DomainName>\Policies\<GUID>\USER\Scripts\Logoff folder on your domain controllers.
To determine the <GUID>, on your domain controller:
- Start / Run / dsa.msc / OK.
- Right-click the domain and press Properties.
- Select the Group Policy tab.
- Right-click the Default Domain Policy and press Properties.
- The <GUID> is in the Unique Name field.
- Open the Default Domain Policy.
- Navigate through User Configuration/Windows Settings/Scripts (Logon/Logoff).
- Double-click Logoff in the right pane.
- Press Add.
- Type logoff.bat and press OK.
- Press Show to confirm it knows where logoff.bat is.