Re: Login script loging a user out based on day and time...
- From: Jeffery Hicks <"jhicks[at]SAPIEN.com">
- Date: Wed, 14 Feb 2007 11:40:26 -0500
On Wed, 14 Feb 2007 08:03:42 -0800, Joe wrote:
Hey Jeffrey,
This would be excellent, however I am currently bound by using a login batch
file (login.bat) to execute the commands I require during the login process.
If I could get similar IF statements for batch file processing it would be
great!
- Joe
"Jeffery Hicks" <"jhicks[at]SAPIEN.com" wrote:
On Wed, 14 Feb 2007 05:50:07 -0800, Joe wrote:
Good day,
I am using a simple batch file to set up my users environment (drive
mappings, etc). I currently have login time restrictions on most accounts to
ensure that everyone is off the system while nightly maintenance is being
performed. We recently deployed Exchange and Outlook Web Access to deliver
email to my users. Now if time restrictions kick in the users can't access
Outlook Web Access. I want to change my login batch file to check for the
day of the week and the time of day. If it is a certain day and time the
user should have displayed a message that they are attempting to login during
an denied period, click "OK", then logged out automatically. Can this be
done and if so, what statements do I require?
Thanks in Advance!
- Joe
There are several VBSCript functions you could use: WeekDay, WeekDayName,
Hour.
dtHour=Hour(Now)
If dtHour >=3 And dtHour <=6 Then
WScript.Echo "Not allowed"
End If
If the current hour is between 3 and 6 (24 hour schedule), then the message
is displayed.
Is this what you're looking for?
--
Jeffery Hicks
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
VBScript & Windows PowerShell Training -
www.ScriptingTraining.com/classes.asp
Windows PowerShell? - www.SAPIENPress.com/powershell.asp
blog: http://blog.SAPIEN.com
blog: http://jdhitsolutions.blogspot.com
You could write a short VBS script and call it from within login.bat. Or
is that not allowed?
--
Jeffery Hicks
SAPIEN Technologies - Scripting, Simplified. www.SAPIEN.com
VBScript & Windows PowerShell Training -
www.ScriptingTraining.com/classes.asp
Windows PowerShell? - www.SAPIENPress.com/powershell.asp
blog: http://blog.SAPIEN.com
blog: http://jdhitsolutions.blogspot.com
.
- Follow-Ups:
- References:
- Re: Login script loging a user out based on day and time...
- From: Jeffery Hicks
- Re: Login script loging a user out based on day and time...
- From: Joe
- Re: Login script loging a user out based on day and time...
- Prev by Date: Re: How to script to restart all computer in a domain.
- Next by Date: Re: How to print from a script
- Previous by thread: Re: Login script loging a user out based on day and time...
- Next by thread: Re: Login script loging a user out based on day and time...
- Index(es):
Relevant Pages
|