Re: Login script loging a user out based on day and time...
- From: Joe <Joe@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 14 Feb 2007 10:14:07 -0800
Hi Jeffrey,
That is our current situation. Login time restrictions are enforced via
GPO. The problem I have with this currently is that we have to "shut down"
access at 10:00pm on most nights (7:00pm on Thursday and Sunday) to allow for
maintenance on the system, including some re-indexing and of course a backup.
This maintenance window each night restricts login access, as well as access
to our web-based email client to out Exchange server (Microsoft Outlook Web
Access). This is due to the fact that the AD login is the same account for
both. If the AD account restrictions denies access, you don't have access to
OWA as well. I figured if we use a login script to deny access at certain
periods we could remove the GPO login restrictions, and since the OWA login
doesn't process the login script the users would have access to their email
as needed...
Clear as mud?
- Joe
"Jeffery Hicks" <"jhicks[at]SAPIEN.com" wrote:
On Wed, 14 Feb 2007 09:00:20 -0800, Joe wrote:.
That may be a good solution. How do you call a VBS script from within a
batch file...with the CALL command?
As far as the script itself I am certainly NOT a programmer, and may take
lotsa digging and research to build the proper script. What my current login
hours are at 6:30 am to 10pm on all days but Thursday and Sunday. On those
days we disable access earlier (7:00pm) to run some intensive reporting.
Could you point me in the right direction as to how could I would craft the
VBS script to take this into account, as well as properly log them off if
their attempt to login falls within these disabled hours?
Thanks for your assistance Jeffrey!
- Joe
"Jeffery Hicks" <"jhicks[at]SAPIEN.com" wrote:
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
Once you have the script finished, int the batch file all you need to do is
add the line:
cscript scriptname.vbs
As for the VBS itself, you'll have to check for the day of the week, which
you can get with WeekdayName(Weekday(Now)). But before you go this route,
why can't you enforce logon restrictions through Group Policy.
--
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
- 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...
- 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...
- From: Jeffery Hicks
- Re: Login script loging a user out based on day and time...
- Prev by Date: Re: Manage Printing ..
- Next by Date: Re: Manage Printing ..
- Previous by thread: Re: Login script loging a user out based on day and time...
- Next by thread: Re: How to script to restart all computer in a domain.
- Index(es):
Relevant Pages
|