Forum Discussion
Dabby
Apr 29, 2022Copper Contributor
get-unique command get me wrong results in powershell
Hello, i need some help get the unique values inside a variable or array. The goal was to count member of ad groups. we could no be sure, if users are in multiple groups so i wanted to put the ...
- Apr 29, 2022
Can you try the following command to get unique objects by specific property name.
$users.count $A = $users | Select-Object -Unique -Property name $A.count
Read this post for more details : https://morgantechspace.com/2021/11/find-unique-object-items-by-property-in-powershell-array.html
Kevin_Morgan
Apr 29, 2022Iron Contributor
Can you try the following command to get unique objects by specific property name.
$users.count
$A = $users | Select-Object -Unique -Property name
$A.count
Read this post for more details : https://morgantechspace.com/2021/11/find-unique-object-items-by-property-in-powershell-array.html
- DabbyApr 29, 2022Copper Contributoryes, thats it..
thank you 😮