Active Directory
Strengthen passwords and handle employees who leave
Set a sensible password policy, find unused accounts, and remove access safely when people leave.
- PolicySet the rules
- FindInactive accounts
- LeaversDisable and remove
- ReviewMake it routine
What you need
- A working domain
- PowerShell on the domain controller, opened as Administrator
Check and set the password policy
Long passwords protect better than complex short ones. Lockout limits slow down password guessing, though a very low limit can lock out real users. Adjust these values to your security needs.
Get-ADDefaultDomainPasswordPolicy Set-ADDefaultDomainPasswordPolicy -Identity "corp.example.com" ` -MinPasswordLength 12 ` -LockoutThreshold 10 ` -LockoutDuration "00:15:00" ` -LockoutObservationWindow "00:15:00"Find inactive accounts
Old accounts are a common way into a network. Review this list with department managers rather than disabling everything automatically, because some service accounts rarely sign in.
Search-ADAccount -AccountInactive -TimeSpan 90.00:00:00 -UsersOnly | Select-Object Name, SamAccountName, LastLogonDateDisable a leaver's account immediately
Disable the account as soon as someone leaves, and record what you did. Check their group memberships first, so you know what access they had. Also change any shared passwords they knew.
Get-ADPrincipalGroupMembership -Identity "rahim" | Select-Object Name Disable-ADAccount -Identity "rahim" Get-ADUser -Identity "rahim" | Select-Object Name, EnabledMove it and remove it later
Move the account to a separate OU and remove it from its groups. Delete it later, after the period your company's data and legal rules require. Create the Disabled OU first.
Remove-ADGroupMember -Identity "Finance" -Members "rahim" -Confirm:$false Get-ADUser "rahim" | Move-ADObject -TargetPath "OU=Disabled,OU=Company,DC=corp,DC=example,DC=com"Add a second layer of protection
Use multi-factor authentication for remote access and email, especially for administrators. Give administrators a separate admin account for admin work, and use a normal account for everyday email and browsing.
Want this set up for your business?
We can plan, build and hand it over to your team.