OrphanedSid
1.0.1
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
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
Dependencies
This module has no dependencies.
Release Notes
1.0.1 - Restore-OrphanedSidBackup restores a single object again. In 1.0.0 every single-object
restore failed with "Could not find file '<BackupPath>\C'", because one matching backup was
indexed as a string. Container restores were not affected.
A single-object restore now matches backups on the object DN they record, not on the file name,
which could select a backup of another object such as CN=User10 for CN=User1.
1.0.0 - First release as a module.
Find-OrphanedSid, Remove-OrphanedSid and Restore-OrphanedSidBackup replace the three modes of the
Find-UnknownSID.ps1 script that lived in the TechbyJeff repository. Results are written to the
pipeline as objects; -OutputPath still writes a CSV. Remove-OrphanedSid and
Restore-OrphanedSidBackup prompt before changing anything and need -Force (or -Confirm:$false)
to run unattended.
See CHANGELOG.md for the detail.
FileList
- OrphanedSid.nuspec
- CHANGELOG.md
- Private\ACL\Get-ACLForRemoval.ps1
- Private\FileSystem\Get-SafeFileName.ps1
- Private\Security\Get-SecurityDescriptor.ps1
- LICENSE
- Private\ACL\Invoke-SIDRemoval.ps1
- Private\FileSystem\Initialize-LogDirectory.ps1
- Private\Security\Invoke-RemovalVerification.ps1
- Private\ACL\Set-ModifiedACL.ps1
- Private\FileSystem\Test-DirectoryAccess.ps1
- Private\Security\Invoke-SecurityValidation.ps1
- OrphanedSid.psd1
- Private\ActiveDirectory\Get-ADObjectFromSearchBase.ps1
- Private\Logging\Format-LogMessage.ps1
- Private\Security\Test-PathTraversal.ps1
- OrphanedSid.psm1
- Private\ActiveDirectory\Get-ADObjectsSequential.ps1
- Private\Logging\Initialize-LoggingConfiguration.ps1
- Private\SID\Get-SIDAnalysis.ps1
- README.md
- Private\ActiveDirectory\Invoke-ADOperationWithRetry.ps1
- Private\Logging\Initialize-LoggingSystem.ps1
- Private\SID\Invoke-SIDProcessing.ps1
- Classes\MemoryManager.ps1
- Private\ActiveDirectory\Test-ValidDistinguishedName.ps1
- Private\Logging\Protect-LogMessage.ps1
- Private\SID\New-SIDResult.ps1
- Classes\OrphanedSIDResult.ps1
- Private\Backup\Find-BackupFile.ps1
- Private\Logging\Write-ADOperationSecurityLog.ps1
- Private\SID\Resolve-SIDIdentity.ps1
- Classes\ProcessingStatistics.ps1
- Private\Backup\Get-BackupFileMetadata.ps1
- Private\Logging\Write-RemovalSecurityLog.ps1
- Private\SID\Test-OrphanedSID.ps1
- Classes\RemovalOperationResult.ps1
- Private\Backup\Invoke-RestoreWorkflow.ps1
- Private\Logging\Write-SecurityLog.ps1
- Private\SID\Test-SIDFormat.ps1
- Classes\RestoreOperationResult.ps1
- Private\Backup\New-ACLBackup.ps1
- Private\Logging\Write-SecurityLogEvent.ps1
- Private\SID\Test-SIDSecurity.ps1
- Classes\ScriptConfiguration.ps1
- Private\Backup\Restore-ACLOperation.ps1
- Private\Logging\Write-SecurityStructuredLogEntry.ps1
- Private\System\Get-MemoryStatistics.ps1
- Classes\SecurityValidationResult.ps1
- Private\Backup\Test-BackupValidation.ps1
- Private\Logging\Write-StructuredLog.ps1
- Private\System\Initialize-MemoryManager.ps1
- Classes\SIDAnalysisResult.ps1
- Private\Core\Initialize-ScriptExecution.ps1
- Private\Logging\Write-StructuredLogEntry.ps1
- Private\System\Invoke-GarbageCollection.ps1
- Classes\StreamingResultsManager.ps1
- Private\Core\Invoke-MainProcessingLogic.ps1
- Private\Operations\Invoke-OperationWithRetry.ps1
- Private\System\Invoke-MemoryMonitoring.ps1
- en-US\about_OrphanedSid.help.txt
- Private\Core\Remove-OrphanedSidEntry.ps1
- Private\Operations\Invoke-RemovalWorkflow.ps1
- Private\System\Invoke-ResourceDisposal.ps1
- en-US\OrphanedSid-Help.xml
- Private\Core\Start-OrchestrationWorkflow.ps1
- Private\Reporting\Export-DiagnosticData.ps1
- Private\Utilities\Get-StringHash.ps1
- Public\Find-OrphanedSid.ps1
- Private\Core\Start-OrphanedSidSession.ps1
- Private\Reporting\Get-LogFileSummary.ps1
- Private\Utilities\Test-BackupFileIntegrity.ps1
- Public\Remove-OrphanedSid.ps1
- Private\Core\Stop-OrphanedSidSession.ps1
- Private\Reporting\Write-ProcessingSummary.ps1
- Private\Utilities\Test-BackupSignature.ps1
- Public\Restore-OrphanedSidBackup.ps1
Version History
| Version | Downloads | Last updated |
|---|---|---|
| 1.0.1 (current version) | 8 | 11/9/2026 |
| 1.0.0 | 8 | 11/9/2026 |