Feb 23 2021 01:08 PM
Hi guys,
I looking for a powershell script that disable AD User Account after Login Hours expires!!!
The idea is configure a task to run this script each 5 minutes.
Any idea?? Is it possible to do that?
Thanks
Diogo
Feb 23 2021 03:29 PM
Hello @dmello30,
Can you please elaborate? What are you trying to accomplish?
Please describe your use case.
Logon hours attribute restrict the time that user is allowed to login to domain.
You want to disable user after logon hours and then enable it back again during the logon hours?
Thank you.
Feb 24 2021 03:12 AM
Hi,
I dont know why you might need to do such a change, as once the logon hour are not applicable, the user wont be able to login.
Anyway Check this script that can take you though
Feb 24 2021 05:54 AM
Hello @AndySvints
Exactly.
I want disable user after logon hours and then enable it back again during the logon hours.
Thanks
Diogo
Feb 24 2021 06:32 AM
Forgot to add the link
Check it out
http://kb.delborrell.net/2018/06/22/deploy-logon-hours-via-powershell/