$groupinfo = (Get-ADGroupMember -Identity $group | select samaccountname |
Where-Object {($_.samaccountname -notin $users) -and ($_.samaccountname -notin
$excludeusers)}).samaccountname
From: [email protected] [mailto:[email protected]] On
Behalf Of [email protected]
Sent: Friday, October 30, 2015 12:40 PM
To: [email protected]
Subject: [powershell] help with hash tables.
$apvgroups = $null
$apvgroups = @{}
foreach ($group in $groups)
{
$groupinfo = Get-ADGroupMember -Identity $group | select samaccountname |
Where-Object {($_.samaccountname -notin $users) -and ($_.samaccountname -notin
$excludeusers)}
$apvgroups.add($group,$groupinfo)
}
Here is the output i'm getting:
PS C:\Windows\system32> $apvgroups
Name Value
---- -----
FA-EQIS APV Sewer {@{samaccountname=ED_TH}, @{samaccountname=BILL_J},
@{samaccountname=SCOTT_SY}, @{samaccountname=DAN_CO}}
FA-APV - Personnel Database
AA-APV manifest.apvcentral.com {@{samaccountname=NICOLE_C},
@{samaccountname=SCOTTMCK}, @{samaccountname=JAMES_ME},
@{samaccountname=IRIS_D}}
AA-APV Database - Mileage S... @{samaccountname=NICOLE_C}
FA-EQIS APV Linden Operations {@{samaccountname=DAN_CO},
@{samaccountname=BRYANNAG}, @{samaccountname=MARY_KU}}
FA-EQIS APV Northern PA Ope... {@{samaccountname=MARC_F},
@{samaccountname=SCOTTMCK}, @{samaccountname=DAN_CO},
@{samaccountname=JAMES_L}...}
FA-EQIS APV Brooklyn Operat... {@{samaccountname=BISI_A},
@{samaccountname=KRIS_B}, @{samaccountname=NICOLE_C},
@{samaccountname=SHAWN_H}...}
I just want the samaccountname values inserted into the hashtable.
================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1
**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be
used for urgent or sensitive issues
================================================
Did you know you can also post and find answers on PowerShell in the forums?
http://www.myitforum.com/forums/default.asp?catApp=1