Can I run vbscript or powershell setting user logon hours by the Holiday table
Dears, Such as the title,I hope a domain account can set logon hours automatically, maybe create a daily tasks,run a script,check if today is a Holiday,then set logon hours allow or deny.Is there any method you recommend? (PS. AD:win2003 r2 std )
November 13th, 2012 10:28am

Hello, here is a powershell script that will allow you to modify the logonHours property on an AD User object: http://gallery.technet.microsoft.com/scriptcenter/fd6a340b-ed8b-4787-8d12-3c6fcb822104 It is somewhat confusing at first since the logonHours property is a binary array, but you should be able to manipulate this script to do what you are looking to do.
Free Windows Admin Tool Kit Click here and download it now
November 13th, 2012 11:09am

Hi, You can set Logon Hours either through ADUC or Windows Powershell, more information please refer to: Set Logon Hours http://technet.microsoft.com/en-us/library/cc754934.aspx Setting AD logon hours in PowerShell http://www.jonoble.com/blog/2008/8/26/setting-ad-logon-hours-in-powershell.html How to change the logon hours of all the members of a security group with PowerShell http://mctexpert.blogspot.com/2011/05/how-to-change-logon-hours-of-all.html However, based on your requirement I think you may need to customize it based on above links. If you encounter difficulty you can ask help in: http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/threads http://social.technet.microsoft.com/Forums/en/ITCG/threads By the way, to make Powershell run on Windows Server 2003 you must install it first. Regards, Cicely
November 13th, 2012 9:32pm

Hi, You can set Logon Hours either through ADUC or Windows Powershell, more information please refer to: Set Logon Hours http://technet.microsoft.com/en-us/library/cc754934.aspx Setting AD logon hours in PowerShell http://www.jonoble.com/blog/2008/8/26/setting-ad-logon-hours-in-powershell.html How to change the logon hours of all the members of a security group with PowerShell http://mctexpert.blogspot.com/2011/05/how-to-change-logon-hours-of-all.html However, based on your requirement I think you may need to customize it based on above links. If you encounter difficulty you can ask help in: http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/threads http://social.technet.microsoft.com/Forums/en/ITCG/threads By the way, to make Powershell run on Windows Server 2003 you must install it first. Regards, Cicely
Free Windows Admin Tool Kit Click here and download it now
November 13th, 2012 9:42pm

Thank you for the information, I will try to find a solution.
November 15th, 2012 12:18pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics