Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Passing variable to -Identity param

$
0
0

Hello

I want to pass multiple group names in the -Identity param for Get _ADGroupMember. I tried many others ways but it did not work out.

I have $groupnames @()
with 7-8 elements in it.
I want to use this $groupname as

 $groupMembers = Get-ADGroupMember -identity $groupName  | Select SamAccountName

How do I achieve this?



Viewing all articles
Browse latest Browse all 21975

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>