• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1549
  • Last Modified:

Samba domain controller with PC logoff scripts

Hello all,

I have setup a samba domain controller, all machines attached to the domain are XP and vista machines. I was wondering what the most efficient way to run a log-off script would be.

Is it best to go to the GPO and edit the log-off setting computer by computer, or would there be a more elegant technique, such as copying and running a registry value, which the computer would execute.

With the registry settings I have no idea where I need to place the reg file.
  • 3
1 Solution
What do you want the log off script to do, exactly?
blowflyAuthor Commented:
When the user logs off, I want the users .PST files (Outlook address books)  to be copied to a server.
Option Explicit

Dim objFSO, objFileCopy
Dim strFilePath, strDestination

strFilePath = "<server>\<share>\<folder>\file.pst"
strDestination =""<server>\<share>\<folder>\file.pst"

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFileCopy = objFSO.GetFile(strFilePath)
' Copy the file to its destination
objFileCopy.Copy (strDestination)
WSCript.Echo "Copied to " & strDestination

Script the above - in a .vbs
so - run cscript.exe script.vbs , and add this into the log off scripts of the GPO (run the cscript.exe from a batch file - making sure that the .vbs and .bat are in the same folder and the Authenticated Users group has read and execute permissions)
Thank you - hope the script was useful.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now