The entries in the "Trustee" field are Security Identifiers (SIDs), which are unique identifiers for security principals such as users, groups, and computers. To identify the users or groups associated with these SIDs, follow the steps below:
First Step - Convert SID to User or Group:
Use the below PowerShell command to convert SIDs to human-readable information. Here's an example:
$sid = New-Object System.Security.Principal.SecurityIdentifier("S-1-5-21-1234567890-1234512345-0987654321-11223344")
$user = $sid.Translate([System.Security.Principal.NTAccount]).Value
Write-Output $user
Replace the SID in the code with the one you want to verify. Run this script for each SID to find the appropriate user or group.
Batch Conversion
You can also check multiple SIDs at once; you can use a loop:
$sids = @("S-1-5-21-1234567890-1234512345-0987654321-11223344", "S-1-5-21-1234567890-1234512345-0987654321-58963247", "S-1-5-21-1234567890-1234512345-0987654321-19732846", "S-1-5-21-1234567890-1234512345-0987654321-91374682")
foreach ($sid in $sids) {
$translatedUser = (New-Object System.Security.Principal.SecurityIdentifier($sid)).Translate([System.Security.Principal.NTAccount]).Value
Write-Output "$sid : $translatedUser"
}
Identify Disabled Users
If you specifically want to identify disabled users, you can check the status of the user account associated with the SID using the Get-User
cmdlet:
$user = Get-User -Identity $translatedUser
Write-Output "$sid : $translatedUser : Disabled: $($user.UserAccountControl -band 2)"
This will display whether the user is disabled or not. If a user or group is deleted or no longer exists in your environment, the translation might not work, and you might need to refer to backup or other records to identify them.