< Back

Remove-OrphanedAce

Fri Jan 10, 2020 6:37 pm

NAME Remove-OrphanedAce



SYNOPSIS

Removes SIDS that are explicitly set in an ACL





SYNTAX

Remove-OrphanedAce [-SID] <String[]> [-Path] <String> [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

This function will remove the SIDs of any file or folder, Inherited or not. SIDS are often the remains of a user

ACE and appears when there isn't any longer a mapping between sid

and user. For example if the user has been deleted.



Use this function preferrably with the Get-OrphanedAce function





PARAMETERS

-SID <String[]>



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Path <String>



Required? true

Position? 2

Default value

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

PSCustom Object



SID Path Action

--- ---- ------

S-1-5-21-3986840155-3541320725-2334626613-1014 C:\\users\\robama\\play2 Remove





NOTES





Created by Robert Amartinesei

2017-01-20



Disclaimer: These scripts are provided in good faith and with no warranty as to their fitness of purpose. Use

this software at your own risk. The author accepts no liabiliy for any losses or damages resulting from the

use thereof.



-------------------------- EXAMPLE 1 --------------------------



PS>Get-OrphanedAce | Remove-OrphanedAce -whatif



What if: Performing the operation "Remove "S-1-5-21-3986840155-3541320725-2334626613-1014" from ACL" on target

"C:\\users\\robama\\play2".

What if: Performing the operation "Remove "S-1-5-21-3986840155-3541320725-2334626613-1014" from ACL" on target

"C:\\users\\robama\\7.txt".



Pipes the object from Get-OrphanedAce to Remove-Orphaned and uses that whatif statement.









-------------------------- EXAMPLE 2 --------------------------



PS>Get-OrphanedAce | Remove-OrphanedAce -Verbose



VERBOSE: Performing the operation "Remove "S-1-5-21-3986840155-3541320725-2334626613-1014" from ACL" on target

"C:\\users\\robama\\play2".



VERBOSE: Performing the operation "Remove "S-1-5-21-3986840155-3541320725-2334626613-1014" from ACL" on target

"C:\\users\\robama\\7.txt".



SID Path Action

--- ---- ------

S-1-5-21-3986840155-3541320725-2334626613-1014 C:\\users\\robama\\play2 Remove

S-1-5-21-3986840155-3541320725-2334626613-1014 C:\\users\\robama\\7.txt Remove



Pipes the object from Get-OrphanedAce to Remove-Orphaned and uses that Verbose statement.











RELATED LINKS