File tree 4 files changed +19
-12
lines changed
4 files changed +19
-12
lines changed Original file line number Diff line number Diff line change 3
3
RootModule = ' ADSec.psm1'
4
4
5
5
# Version number of this module.
6
- ModuleVersion = ' 1.0.1 '
6
+ ModuleVersion = ' 1.0.4 '
7
7
8
8
# ID used to uniquely identify this module
9
9
GUID = ' 1cfaca0a-3c7d-47dd-bb9f-9711310a0b9d'
26
26
# Modules that must be imported into the global environment prior to importing
27
27
# this module
28
28
RequiredModules = @ (
29
- @ { ModuleName = ' PSFramework' ; ModuleVersion = ' 1.0.35 ' }
29
+ @ { ModuleName = ' PSFramework' ; ModuleVersion = ' 1.12.346 ' }
30
30
)
31
31
32
32
# Assemblies that must be loaded prior to importing this module
Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## 1.0.4 (2025-01-22)
4
+
5
+ - Upd: Raised PSFramework Dependency Version to 1.12.346
6
+ - Upd: Get-AdsAcl - Enabled retrieving ACL from deleted objects
7
+ - Upd: Get-AdsAcl - Detect insufficient access rights to retrieve security information
8
+
3
9
## 1.0.1 (2022-04-04)
4
10
5
11
- New: Configuration setting to disable connection verification
Original file line number Diff line number Diff line change 13
13
' Enable-AdsInheritance.Processing' = ' Starting process to enable inheritance on {0}' # $pathItem
14
14
' Enable-AdsInheritance.ReadAcl.Failed' = ' Failed to access acl on {0}' # $pathItem
15
15
' Enable-AdsInheritance.Updating.Acl' = ' Enabling inheritance' #
16
+ ' Get-AdsAcl.NoSecurityProperty' = ' No security information found on {0}. Ensure you have sufficient access.' # $pathItem
16
17
' Get-AdsAcl.ObjectError' = ' Error accessing item: {0}' # $pathItem
17
18
' Get-AdsAcl.Processing' = ' Retrieving Acl from {0}' # $pathItem
18
19
' Get-AdsOrphanAce.Read.Failed' = ' Failed to access {0}' # $pathItem
Original file line number Diff line number Diff line change 1
- function Get-AdsAcl
2
- {
3
- <#
1
+ function Get-AdsAcl {
2
+ <#
4
3
. SYNOPSIS
5
4
Reads the ACL from an AD object.
6
5
44
43
$EnableException
45
44
)
46
45
47
- begin
48
- {
46
+ begin {
49
47
$adParameters = $PSBoundParameters | ConvertTo-PSFHashtable - Include Server, Credential
50
48
Assert-ADConnection @adParameters - Cmdlet $PSCmdlet
51
49
}
52
- process
53
- {
50
+ process {
54
51
if (Test-PSFFunctionInterrupt ) { return }
55
52
56
- foreach ($pathItem in $Path )
57
- {
53
+ foreach ($pathItem in $Path ) {
58
54
if (-not $pathItem ) { continue }
59
55
Write-PSFMessage - String ' Get-AdsAcl.Processing' - StringValues $pathItem
60
56
61
- try { $adObject = Get-ADObject @adParameters - Identity $pathItem - Properties ntSecurityDescriptor }
57
+ try { $adObject = Get-ADObject @adParameters - Identity $pathItem - Properties ntSecurityDescriptor - IncludeDeletedObjects }
62
58
catch { Stop-PSFFunction - String ' Get-AdsAcl.ObjectError' - StringValues $pathItem - Target $pathItem - EnableException $EnableException - Cmdlet $PSCmdlet - ErrorRecord $_ - Continue }
63
59
$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
+
64
64
Add-Member - InputObject $aclObject - MemberType NoteProperty - Name DistinguishedName - Value $adObject.DistinguishedName - Force
65
65
$aclObject
66
66
}
You can’t perform that action at this time.
0 commit comments