How do you pull a list of group members, from multile groups using a list of groups from a text file.


i'm trying pull list of group members ad security groups starting "gg". i've pull list of these groups , exported text file, can't work out how powershell use text file members of each group listed.

i need include name of group and the name of group member.

can @ all?

thanks in advance.

depending on format of file, assuming file contains group names line line

get-content c:\groups.txt | foreach { [pscustomobject]@{

'group' = $_
'members' = get-adgroupmember $_ }

} | export-csv c:\groupmembers.csv -notypeinformation


if find post has answered question, please mark answer. if find post helpful in anyway, please click vote helpful. (99,108,97,121,109,97,110,50,64,110,121,99,97,112,46,114,114,46,99,111,109|%{[char]$_})-join''











Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Schannel Issue

Indexing Server

oclist /xml or /?