Say I have an AD group called "group1" and I'd like to get all members and then pass off their UserPrincipalName (samaccountname + domain name) to another cmdlet, what would be the best method for that? I'm working with a cmdlet that will accept a single UserPrincipalName or an array, so right now I have this:
$group4 = Get-ADGroupMember SAMPLE-GROUP foreach ($user in $group4){ $getuser = get-aduser $User $user = $getuser.userprincipalname add-tpuser $group4 -Verbose }
There's got to be an easier way, though.
Thanks.
zarberg@gmail.com