Link to home
Start Free TrialLog in
Avatar of ivan rosa
ivan rosaFlag for United States of America

asked on

Getting members from AD

Hello Folks,

I'm trying to get all users from an active directory GroupMember, I have the following script

get-adgroupmember "TEX_Users" -recursive | % {
    get-aduser $_ -Properties Employeeid | select Name | Out-File -FilePath C:\Window.000\users.txt
}

Open in new window


When deploying script within the PS console i get the users from that group, although for some with a long name i get something like
john doe smit ...

when I try to export it to a file or CSV, it only shows me one user ...

can anybody suggest me what the error might be or if they have a better script that would also work out...

thanks for looking
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial