IncidentResponsev2

4.56 Remove Unauthorized Users (Local/AD/Cloud)

Task

Identify and remove unauthorized or suspicious user accounts across local systems, Active Directory (AD), and Cloud Identity Providers (Azure AD, AWS IAM, Google Workspace).


Conditions

Given access to local systems, enterprise identity directories, and cloud tenant management interfaces.


Standards


End State

All unauthorized user accounts are identified, removed, and documented across local, enterprise, and cloud environments.


Notes


Manual Steps

Step 1: Identify All Active User Accounts

Local Accounts (Windows)

Get-LocalUser

Look for:

Local Accounts (Linux/macOS)

cat /etc/passwd

Look for users with UID >= 1000 (normal users).

lastlog

Look for users that have never logged in or have not logged in for long periods.

Active Directory (Windows Server)

Get-ADUser -Filter * -Properties LastLogonDate | Select-Object Name, Enabled, LastLogonDate

Look for:


Azure AD (Microsoft 365 Cloud)

Connect-AzureAD
Get-AzureADUser -All $true | Select-Object DisplayName, UserPrincipalName, AccountEnabled

Look for:


AWS IAM (Cloud)

aws iam list-users
aws iam get-user --user-name <username>

Look for:

Operator Note: AWS IAM → lastUsed attribute can indicate if dormant.


Google Workspace (Cloud)

Admin Console → Directory → Users → Filter by login activity

Look for:

Operator Note: Dormant accounts should be reviewed with account owners.


Step 2: Validate Account Authorization

Operator Note: Accounts created outside of normal onboarding process are HIGH RISK.


Step 3: Disable or Remove Unauthorized Accounts

Local Users (Windows)

Disable-LocalUser -Name "username"
Remove-LocalUser -Name "username"

Local Users (Linux/macOS)

sudo usermod -L username
sudo userdel username

Active Directory

Disable-ADAccount -Identity "username"
Remove-ADUser -Identity "username"

Azure AD

Set-AzureADUser -ObjectId <UserId> -AccountEnabled $false
Remove-AzureADUser -ObjectId <UserId>

AWS IAM

aws iam delete-user --user-name <username>

Google Workspace

Operator Note: Suspend (disable) first unless immediate removal is required → preserves data for audit.


Step 4: Validate Removal and Audit


Dependencies


Other Available Tools

Tool Platform Installation Usage
PowerShell AD Modules Windows Built-in / RSAT AD queries and management
AWS CLI Cross-platform Package manager IAM management
AzureAD Module PowerShell Install-Module Azure AD management
Google Admin Console Web N/A Google Workspace user management

Operator Recommendations and Additional Tools

Operator Checklist

Best Practices


References


Revision History

Date Version Description Author
2025-05-02 1.0 Created from scratch with deep operator guidance and multi-platform examples Leo