OrphanedSid

1.1.0

Finds orphaned SIDs in Active Directory ACLs, removes them with a backup of every ACL it touches, and restores an ACL from that backup

Minimum PowerShell version

5.1

Installation Options

Copy and Paste the following command to install this package using PowerShellGet More Info

Install-Module -Name OrphanedSid

Copy and Paste the following command to install this package using Microsoft.PowerShell.PSResourceGet More Info

Install-PSResource -Name OrphanedSid

You can deploy this package directly to Azure Automation. Note that deploying packages with dependencies will deploy all the dependencies to Azure Automation. Learn More

Manually download the .nupkg file to your system's default download location. Note that the file won't be unpacked, and won't include any dependencies. Learn More

Owners

Copyright

(c) 2026 Jeffrey Stuhr. All rights reserved.

Package Details

Author(s)

  • Jeffrey Stuhr

Tags

ActiveDirectory AD SID OrphanedSID ACL Security Permissions Cleanup Audit Compliance Backup Restore Windows

Functions

Find-OrphanedSid Remove-OrphanedSid Restore-OrphanedSidBackup

PSEditions

Desktop Core

Dependencies

This module has no dependencies.

Release Notes

1.1.0 - Safer removal, faster detection, and fixes from testing against a live domain.
A SID is reported orphaned only when its deleted object is found or every directory lookup
completed and none found it. A SID whose lookup failed, including one from a trusted domain that
cannot be reached, is reported as Unverified (new VerificationStatus and VerificationError
properties) and is never removed. A live principal found among deleted-object search results is no
longer taken as deleted.
Remove-OrphanedSid takes one backup per object, removes all of that object's orphaned entries
together, and returns one RemovalOperationResult per object; restoring such an object now brings
back every removed entry. Inherited entries are left in place with a warning.
Detection is several times faster: on a lab domain controller a typical user object went from
941 ms to 96 ms on Windows PowerShell 5.1. An unreachable domain controller costs about 42 seconds
per SID instead of 3.5 minutes.
Pipeline input of Active Directory objects now works for all three commands. -MaxRetries now
sets the retries of each search-base read and SID lookup. Logging, configuration, backup
timestamps, correlation IDs and restore messages are corrected.
See CHANGELOG.md for every change and the issue behind it.

FileList

Version History

Version Downloads Last updated
1.1.0 (current version) 10 11/12/2026
1.0.1 12 11/9/2026
1.0.0 8 11/9/2026