< Back

Get-OrphanedAce

Fri Jan 10, 2020 6:36 pm

NAME Get-OrphanedAce



SYNOPSIS

Gets SIDS that are explicitly set in an ACL





SYNTAX

Get-OrphanedAce [-Path <Object>] [-IncludeInherited] [-Recurse] [-Directory] [-File] [<CommonParameters>]



Get-OrphanedAce [-Path <Object>] [-IncludeInherited] [-SingleItem] [<CommonParameters>]





DESCRIPTION

This function will get you 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.





PARAMETERS

-Path <Object>

Supply a valid path, either local or UNC



Required? false

Position? named

Default value $pwd

Accept pipeline input? false

Accept wildcard characters? false



-IncludeInherited [<SwitchParameter>]

Includes inherited ACEs



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Recurse [<SwitchParameter>]

Will search recursively relative to the Path parameter



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-SingleItem [<SwitchParameter>]

Indicates that the function should only list the ACL for the specified path



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-Directory [<SwitchParameter>]

Shows only directories



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-File [<SwitchParameter>]

Shows only files



Required? false

Position? named

Default value False

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 IsInherited Path

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

S-1-5-21-3986840155-3541320725-2334626613-1014 False C:\\Users\\RObama\\play2





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



SID IsInherited Path

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

S-1-5-21-3986840155-3541320725-2334626613-1014 False C:\\Users\\RObama\\play2

S-1-5-21-3986840155-3541320725-2334626613-1014 False C:\\Users\\RObama\\7.txt



This command will list any sid on any directory or file in your current directory.









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



PS>Get-OrphanedAce -Recurse



SID IsInherited Path

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

S-1-5-21-3986840155-3541320725-2334626613-1014 False C:\\Users\\RObama\\play2

S-1-5-21-3986840155-3541320725-2334626613-1014 False C:\\Users\\RObama\\7.txt

S-1-15-3-4096 False C:\\Users\\RObama\\Favorites\\Bing.url

S-1-5-21-3986840155-3541320725-2334626613-1015 False C:\\Users\\RObama\\play2\\xml.xml



This command will recursively list any sid on any directory or file in your current directory and

subdirectories/files.









-------------------------- EXAMPLE 3 --------------------------



PS>Get-OrphanedAce -Recurse -IncludeInherited



SID IsInherited Path

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

S-1-5-21-3986840155-3541320725-2334626613-1014 False C:\\Users\\RObama\\play2

S-1-5-21-3986840155-3541320725-2334626613-1014 False C:\\Users\\RObama\\7.txt

S-1-15-3-4096 True C:\\Users\\RObama\\Favorites\\Bing.url

S-1-5-21-3986840155-3541320725-2334626613-1015 False C:\\Users\\RObama\\play2\\xml.xml



This command will recursively list any sid on any directory or file in your current directory and

subdirectories/files and also include inherited ACEs.











RELATED LINKS