Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

How do I check if one group belongs in another group

$
0
0

Hi Guys,

I am trying to write a quick script to see if a user belongs to an AD group.

#This line imports a csv file, which contains the following

Name
GRP AC HPOO Test
SGG-SF-Infrastructure-W_ACC

$groups = import-csv H:\Scripts\input\dan.csv##

This line gets a list of all groups the account ellisd belongs to

$accounts = Get-ADPrincipalGroupMembership "ellisd" | select name

What I now want to do is run the list of $groups over the list of $accounts, and if a match is found, output true .

Can someone please help with this

Dan


Viewing all articles
Browse latest Browse all 15028

Trending Articles



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