Jump to content

Way to check environment to run different segments of code?


 Share

Recommended Posts

I have a couple of scripts that I wrote that evaluate the users logon time and if they've been logged on greater than 24 hrs, my script will log them off as long as they are NOT apart of an Active Directory security group that I've set up for "exempt" accounts. My question is this. Currently it is two scripts: one to set up the scheduled task to run hourly to evaluate the user's logon time and one to actually check the security group and kick people off where necessary. The first one runs at Startup and the second runs during the users logged-on session ah hourly intervals.

My question is -- what's a good way to differentiate between startup and logon so I can consolidate the two scripts into one? Any ideas?

My Additions:- RunAs AdminDeviant Fun:- Variable Sound Volume

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...