Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions PSHTML-AD.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -655,17 +655,8 @@ foreach ($Group in $Groups)
$Users = "Skipped Domain Users Membership"
}

$OwnerDN = Get-ADGroup -Filter { name -eq $Group.Name } -Properties managedBy | Select-Object -ExpandProperty ManagedBy
Try
{
$Manager = Get-ADUser -Filter { distinguishedname -like $OwnerDN } | Select-Object -ExpandProperty Name
}
Catch
{
write-host -ForegroundColor Yellow "Cannot resolve the manager, " $Manager " on the group " $group.name
}
$Manager = (Get-ADGroup -Filter { name -eq $Group.Name } -Properties managedBy | Select-Object -ExpandProperty ManagedBy) -replace '^CN=|,.*$'

#$Manager = $AllUsers | Where-Object { $_.distinguishedname -eq $OwnerDN } | Select-Object -ExpandProperty Name

$obj = [PSCustomObject]@{

Expand Down