hello,
Whenever I think, "yeaaah I get it"I am no longer een Noob..:)
A new issue pops up that cracks my brains...
It makes me learn more and that is good, only now I am confused, and start to think in circles ...
I use import-csv with 13 samacountnames, and a header called 'samccountname"
When I try $var =get-aduser ....
or Get-aduser ...|export-csv , the output is just 1 user
When I run it with just get-ADuser .... it returns all 13 users with their groups.
$users = import-csv "D:\Users\Documents\PS-script\Output\Inactief.csv" $Export = "D:\Users\Documents\PS-script\output\Adgroup_inactief.csv" $Result = @() foreach ($user in $userlist.samaccountname) { $result= Get-ADUser -Identity $user -Properties Memberof |select-object name, memberOf } $result | | export-csv $Export
I tried to do :
Get-ADUser -Identity $user -Properties Memberof |select-object name, memberOf | export-csv $ExportOnly this returns just the last user.
Also this returns the last user:
$result= Get-ADUser -Identity $user -Properties Memberof |select-object name, memberOfThanks for telling me, where I go the wrong path..:)
pba1211