Need a batch file to run at logon and logoff for single domain user

I have one user who needs to run a little batch file I created that simply copies any new data from a local folder on his laptop up to the network server when he logs on or off.  I have the script already, and I think I could just throw it in the startup folder to run at login, but how can I get it to run when he logs off as well?  Thanks in advance.
tenoverAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

shadowlesssCommented:
I would setup an OU in AD and place that user in this OU and create a group policy that runs your script at logon and logoff
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shadowlesssCommented:
Located here  in Group Policy - "User Configuration", "Windows Settings", "Scripts (Logon/Logoff)"
0
tenoverAuthor Commented:
Let me ask you this though....If this user is already a member of an OU that has some other policy that is applied, say a policy that maps some network drives, then how do I move OUs yet still allow him to get his mapped drives AND run this new script that only he should run?
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

snusgubbenCommented:
Place him in a child OU
0
tenoverAuthor Commented:
So just create a new OU for him only UNDERNEATH his current OU and then apply the script to that child OU only?
0
shadowlesssCommented:
Exactly..place him in the child OU and apply the Group Policy to that child OU
0
tenoverAuthor Commented:
Thanks, and the policy should be both "Enforced" and "Linked", correct?
0
shadowlesssCommented:
Just link it..no need to enforce
0
Krys_KCommented:
Hi
Better still, leave the user in the OU where he is!
Create your GPO and put the bacth file in the logon/logoff
Create an AD group Called Something relevant. Put the user in this group and tie the group to the GPO.
That way nothing changes with OU's and you have control of who get the GPO applied by dropping users in / out of the group as required.
Hope that helps
Regards
Krystian
0
snusgubbenCommented:
Or use security filtering. If you put him in a childe OU he will inherit the above GPO's aslong as you don't block inheritence.
0
Krys_KCommented:
Isn't security filtering the same thing as i was saying? using groups to filter the GPO to the user/ This method will still allow all otehr GPOs on teh OU to be applid to the user as all GPO's have Authenticated Uers by default as their security filtering.
Its worht noting that if you add a group to the GPO, to remove the Authenticated Users otherwise all users in teh OU will get it too.
I personally would reccommend using Groups as makign child OU's just for a GPO is the start of a messy mehtod. Imagine wanting to apply differnt GPO's for lots of differnt users in the same OU. You would end up with lots of Child OU's to accomodate this
Just my opinion :-)
Krystian
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Active Directory

From novice to tech pro — start learning today.