Re: Login script loging a user out based on day and time...

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



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
.



Relevant Pages

  • Re: Login script loging a user out based on day and time...
    ... however I am currently bound by using a login batch ... file to execute the commands I require during the login process. ... I currently have login time restrictions on most accounts to ...
    (microsoft.public.windows.server.scripting)
  • Re: Windows 2003 Federated Forst Trust
    ... # Jorge de Almeida Pinto # MVP Windows Server - Directory Services ... BLOG --> http://blogs.dirteam.com/blogs/jorge/default.aspx ... But user@xxxxxxxxxxx can't login into domainB.com from either workstation ... I was testing with a test user that belongs to Domain A and trying ...
    (microsoft.public.windows.server.active_directory)
  • Re: Login script loging a user out based on day and time...
    ... This maintenance window each night restricts login access, ... I figured if we use a login script to deny access at certain ... I currently have login time restrictions on most accounts to ... VBScript & Windows PowerShell Training - ...
    (microsoft.public.windows.server.scripting)
  • Re: URGENT - SPS & WSS Service Pack 1
    ... Check the Login that you are logged in to the Server. ... It must be a domain admin account. ... Here is a link to a blog on how to overcome this issue: ...
    (microsoft.public.sharepoint.portalserver)
  • Re: redirecting to specific webpage after logging in - ASP.NET 2.0
    ... Well I am able to have the user login and they get redirected back to the ... be administering their own blog though, that gets looked after by me, so they ... all user information? ... Also, if I stick with the current AspNetAccessProvider, ...
    (microsoft.public.dotnet.framework.aspnet.security)