Link to home
Start Free TrialLog in
Avatar of Isaias Perez
Isaias PerezFlag for United States of America

asked on

Powershell Request - Grab Attribute for Each Object

I have a CSV File or Text File for 100s of Users in my environment. I would like to develop a script that would take each UPN on that column and give me back the data in the Attribute "Description" of that object which is where we put the users Title. Can anyone help?

$Users = Get-Content C:\users_upn.txt >>>>Give me back the data in the attribute field " Description" for each user. Write that data to a text or csv file.

I have a list of users but want to add their Titles to that spreadsheet and that data is stored in the "Description" attribute field.

User generated image
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
Avatar of Isaias Perez

ASKER

This seemed to work partially. In other words there were some fields generated but most were just blank. I have another project like this now where i have a bunch of user principle names and i have to generate the attribute Description for those users. So find the adusers and then give me their titles (which we usually use the description field for).
Avatar of oBdA
oBdA

Not an issue with the script, rather with the input file; any row in the output where SamAccountName and DistinguishedName are empty means that the UserPrincipalName could not be found.
Ok thank you