Skip to content

Commit fec0f0a

Browse files
committed
Update Microsoft Active Directory.ps1
- Handle permission issues for CannotChangePassword
1 parent 0bdbb39 commit fec0f0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Microsoft Active Directory.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -442,7 +442,7 @@ function Convert-ADPropertyCollection {
442442
$value_collection[0]
443443
}
444444

445-
$value = Get-CannotChangePassword $byte_array
445+
try { $value = Get-CannotChangePassword $byte_array } catch { Log warning "Unable to retrieve 'CannotChangePassword' for user: $((New-Object System.Guid(, $PropertyCollection['objectGUID'][0])).ToString())" }
446446
}
447447
elseif ($p -eq 'canonicalName') {
448448
if($value_collection.length -lt 1 -or $null -eq $value_collection) {

0 commit comments

Comments
 (0)