Group name: "Emergency - All"
Title | Department
IT Admin | IT
Technician | Facilities
Group name: "Emergency - Facilities"
Title | Department
Technician | Facilities
Title Department
----- ----------
{IT Admin , Technician...} {Facilities...
$report = @()
$Distros = Get-ADGroup -filter * | ? {$_.Name -like "Emergency - *"}
foreach ($Distro in $Distros){
$DistroMembers = Get-ADGroupMember -Identity $Distro.SID -Recursive | Where objectclass -eq 'user' | Get-ADUser -Properties Displayname,Title,Department | Select DistinguishedName,samAccountName,Name,Displayname,Title,Department
#add line to object
$obj = New-Object -TypeName PSObject
$obj | Add-Member -MemberType NoteProperty -Name Group -Value $Distro.Name
$obj | Add-Member -MemberType NoteProperty -Name Title -Value ($DistroMembers | select Title -unique).title
$obj | Add-Member -MemberType NoteProperty -Name Department -Value ($DistroMembers | select Department -unique).department
$report += $obj
}
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE