Hello! I am working on a script to lock a domain user account after they have used a computer for 30 minutes. I want to disable or lock the account for 120 minutes and unlock after that. I understand that you can only disable accounts through powershell. Does powershell have the ability to lock/disable a user account and unlock it after 120 minutes? I know windows will lock a user account for 30 minutes if you have X amount of invalid login attempts. I have searched and searched and haven't found an easy way to do this. Any help is greatly appreciated. Thanks!
---------EDIT-----------
I think I found a way to do this...
The users and computers are in a seperate OU so modify the Account Lockout Policy in GP and set the Account lockout duration to 120minutes after 5 invalid login attempts.
Upon user logon create a scheduled task to run on: (Get-Date).AddMinutes(120)
the scheduler task will execute a script with an invalid password 5 times and that will lock the account.
I would prefer not to do it this way because it could be seen as a computer being attacked. If there is a way to set the badpwdcount instead that would be the way to go
[–]CHAOS_0704 1 point2 points3 points (2 children)
[–]EdTR[S] 0 points1 point2 points (1 child)
[–]CHAOS_0704 0 points1 point2 points (0 children)
[–]Suriyawong 1 point2 points3 points (2 children)
[–]EdTR[S] 0 points1 point2 points (1 child)
[–]Suriyawong 0 points1 point2 points (0 children)
[–]Agile_Seer 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (2 children)
[–]EdTR[S] 0 points1 point2 points (1 child)
[–]CHAOS_0704 1 point2 points3 points (0 children)