Link to home
Start Free TrialLog in
Avatar of Indie101
Indie101

asked on

Powershell script to disallow login hours and change default login to test pc

Powershell script to deny all login hours for users in a certain OU

i.e. I want to deny all login hours for all disabled users kept in a certain OU, want to do a test beforehand on one user for example

I also want to do the same for login rights to workstations (have them logon to test pc) for instance
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

a disabled user cannot login to the domain
for an enabled user you want to enable login hours not disable login hours if you want to restrict the time frame that they can login and use the network.
Avatar of Indie101
Indie101

ASKER

I should have said that I am working in an area where accounts aren't deleted for data protection reasons

At present the user is disabled from  a security perspective I have recommended that
-Passwords for disabled users changed when they leave
-Login hours should be disallowed, currently they're not
-Likewise for login workstations

I just want to make it harder for someone to reenable than just reenable if that makes senses, these are security recommendations which are been put in place I can get users for any OU, I want to know if for terminated users OU for example its possible to run a script to deny login hours as well. Thanks apologies for not being clearer initially :)
ASKER CERTIFIED SOLUTION
Avatar of Muhammad Burhan
Muhammad Burhan
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial