Solved

Toggle Service State at Login/Logoff

Posted on 2014-01-08
6
394 Views
Last Modified: 2014-01-14
We plan to utilize our logged-off workstations for renderings (via Autodesk's Backburner software) but want it set up so that when a user logs in, their workstation is removed from the pool of available render nodes.  The easiest way to do this seems to be by stopping the Backburner service when a user logs in, and starting the service when they log out.

I know I can do this via login/logoff script ("net stop/start BACKBURNER_SRV_200"), but is there a way to do this with a GPO policy (or other)?  I've otherwise eliminated the need for login/logoff scripts and would like to avoid them if possible.  Thanks!
0
Comment
Question by:pcamis
6 Comments
 
LVL 22

Accepted Solution

by:
Matt V earned 300 total points
ID: 39766378
I think the only way you can do this is assigning a script via GPO to run at logon/logoff.  No matter how you do it, you will need the start/stop script file to do it.
0
 
LVL 53

Assisted Solution

by:Will Szymkowski
Will Szymkowski earned 200 total points
ID: 39766880
You have to be able to run this when the user logs in so a GPO startup script and a GPO logoff script would be required. You could also probably do something like this from a scheduled task as well via GPO.

GPO Scheduled Task - http://technet.microsoft.com/en-us/library/cc725745.aspx

Will.
0
 

Author Closing Comment

by:pcamis
ID: 39768582
Thanks guys - that's what I figured, but thought I'd inquire.  I like the idea of setting it via schedule, Will, but we also want to leave the possibility open of using workstations when a user is out of the office on any particular day.  Cheers!
0
 
LVL 53

Expert Comment

by:McKnife
ID: 39771887
>   I like the idea of setting it via schedule, Will, but we also want to leave the possibility open of using workstations when a user is out of the office on any particular day.
Seems you are not familiar with task triggers. Tasks can be triggered by logon/logoff events, so that's exactly what you need.
0
 

Author Comment

by:pcamis
ID: 39779289
McKnife - looks like I jumped the gun on conceding that I was stuck with logon/logoff scripts.  Task Scheduler triggers seem to be working perfectly!  If I had a way to award extra points to you, absolutely would.  Thank you VERY much for the clarification (and again to Will for leading me in this direction).

For reference, I created two tasks:

Title: Enable Backburner
Run whether user is logged on or not / Run with highest privileges
Trigger: On an event (Log: System; Source: Winlogon; Event ID: 7002)
Action: Start a program (Program: cmd.exe; Arguments: /c "net start BACKBURNER_SRV_200")

Title: Disable Backburner
Run whether user is logged on or not / Run with highest privileges
Trigger: At log on (At log on of any user)
Action: Start a program (Program: cmd.exe; Arguments: /c "net stop BACKBURNER_SRV_200")
0
 
LVL 53

Expert Comment

by:McKnife
ID: 39779301
You're welcome and thanks for feedback.
0

Join & Write a Comment

This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now