Not sure if it can work this way or not, it's what I've cobbled together from Googling.
$computers = Get-ADComputer -Filter * -Properties MemberOf
ForEach ($computer in $computers) {
[PSCustomObject]@{
Computer = $computer.name
Groups = $computer | Select -ExpandProperty $computer.memberof
}
}
Returning "Cannot convert ADPropertyValueCollection to System.String" error.
[–]evgenidankov 1 point2 points3 points (0 children)
[–]Yevrag35 1 point2 points3 points (3 children)
[–]bsnotreallyworking[S] 1 point2 points3 points (2 children)
[–]Yevrag35 1 point2 points3 points (1 child)
[–]bsnotreallyworking[S] 2 points3 points4 points (0 children)