Skip to content

Commit 84dffe3

Browse files
added insufficient access scenario
1 parent a00e0b0 commit 84dffe3

File tree

4 files changed

+8
-2
lines changed

4 files changed

+8
-2
lines changed

ADSec/ADSec.psd1

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
RootModule = 'ADSec.psm1'
44

55
# Version number of this module.
6-
ModuleVersion = '1.0.3'
6+
ModuleVersion = '1.0.4'
77

88
# ID used to uniquely identify this module
99
GUID = '1cfaca0a-3c7d-47dd-bb9f-9711310a0b9d'

ADSec/changelog.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# Changelog
22

3-
## 1.0.3 (2025-01-22)
3+
## 1.0.4 (2025-01-22)
44

55
- Upd: Raised PSFramework Dependency Version to 1.12.346
66
- Upd: Get-AdsAcl - Enabled retrieving ACL from deleted objects
7+
- Upd: Get-AdsAcl - Detect insufficient access rights to retrieve security information
78

89
## 1.0.1 (2022-04-04)
910

ADSec/en-us/strings.psd1

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
'Enable-AdsInheritance.Processing' = 'Starting process to enable inheritance on {0}' # $pathItem
1414
'Enable-AdsInheritance.ReadAcl.Failed' = 'Failed to access acl on {0}' # $pathItem
1515
'Enable-AdsInheritance.Updating.Acl' = 'Enabling inheritance' #
16+
'Get-AdsAcl.NoSecurityProperty' = 'No security information found on {0}. Ensure you have sufficient access.' # $pathItem
1617
'Get-AdsAcl.ObjectError' = 'Error accessing item: {0}' # $pathItem
1718
'Get-AdsAcl.Processing' = 'Retrieving Acl from {0}' # $pathItem
1819
'Get-AdsOrphanAce.Read.Failed' = 'Failed to access {0}' # $pathItem

ADSec/functions/acl/Get-AdsAcl.ps1

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
try { $adObject = Get-ADObject @adParameters -Identity $pathItem -Properties ntSecurityDescriptor -IncludeDeletedObjects }
5858
catch { Stop-PSFFunction -String 'Get-AdsAcl.ObjectError' -StringValues $pathItem -Target $pathItem -EnableException $EnableException -Cmdlet $PSCmdlet -ErrorRecord $_ -Continue }
5959
$aclObject = $adObject.ntSecurityDescriptor
60+
if (-not $aclObject) {
61+
Stop-PSFFunction -String 'Get-AdsAcl.NoSecurityProperty' -StringValues $pathItem -Target $pathItem -EnableException $EnableException -Cmdlet $PSCmdlet -Category PermissionDenied -Continue
62+
}
63+
6064
Add-Member -InputObject $aclObject -MemberType NoteProperty -Name DistinguishedName -Value $adObject.DistinguishedName -Force
6165
$aclObject
6266
}

0 commit comments

Comments
 (0)