Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4629
  • Last Modified:

Export list of active directory users with pictures

I am looking for a way to pull a list of all active directory users that includes full name, username and photo.
I am ok with just the photo attribute showing if its populated or not.
0
Sedryn
Asked:
Sedryn
  • 5
  • 5
  • 2
  • +1
1 Solution
 
Sikhumbuzo NtsadaSenior IT TechnicianCommented:
0
 
LeDaoukCommented:
you start from this script
Extract-All-Users-From-Active-Di.vbs
0
 
RickSheikhCommented:
If you would like to accomplish this simply in PowerShell oneliner with Quest Cmdlets :

Get-QADUser -sizelimit 0 -ip jpegphoto | where{$_.jpegphoto -eq "*"} | select name,samaccountname | export-csv Users_with_photos.csv
0
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

 
SedrynAuthor Commented:
Sorry guys, I am not an expert. None of those options are going to work for me unless I can configure them for my needs. I have tried all 3 and have not been able to figure them out.
Got the first one to work but it only shows names.  
second one uses ou's only. I have quite an OU tree. so that doesn't work.
Installed Quest Cmdlets. Just errors out in PowerShell as not recognizing the cmdlet
0
 
LeDaoukCommented:
change the query to:
select name, alias, email, ....
0
 
RickSheikhCommented:
As far as PowerShell error, launch the "ActiveRoles Management Shell" snapin to use the Get-QADUser cmdlet or add the quest snapin to PowerShell via

Add-PSSnapin Quest.ActiveRoles.ADManagement
0
 
SedrynAuthor Commented:
We are close Rick. However, it produces a 0 byte file.
Also the attribute I need is the thumbnailPhoto
I did try to change your command line to reflect this but still got a 0 byte file.
0
 
RickSheikhCommented:
I was under the impression that you were just after finding who has that photo attribute populated not necessarily the actual value. Besides, the thumbnailphoto (or jpegphoto) has a syntax of hexadecimal so if you export it, it won't mean anything to you.

And use changing the attribute from jpegphoto to thumbnail should allow you find all accounts that have a value in that attribute.

Get-QADUser -sizelimit 0 -ip thumbnailPhoto | where{$_.thumbnailPhoto -eq "*"} | select name,samaccountname,thumbnailPhoto | export-csv Users_with_photos.csv
0
 
SedrynAuthor Commented:
Thanks Rick but unfortunately that still pulls a 0 byte csv.
0
 
SedrynAuthor Commented:
Rick I did a raw pull of all using Get-QADUser.  There is no field for Photos or Thumbnails. That is probably why it is pulling no records.
0
 
RickSheikhCommented:
Not sure why that is. Let try this. Lets do a straight dump without the "where" clause

Get-QADUser -sizelimit 0 -ip thumbnailPhoto  | select name,samaccountname,thumbnailPhoto | export-csv Users_with_photos.csv

Are you sure that some of these users that you are after do in fact have the thumbnailPhoto attribute populated ?
0
 
SedrynAuthor Commented:
Haha, yeah I just about figured that exact same one out. Worked!  Thanks!

Get-QADUser -includedproperties thumbnailPhoto,DisplayName,samaccountname | export-csv Users_with_photos.csv

0
 
RickSheikhCommented:
Great to hear.

On a side note, the displayname and samaccountname are already exposed and do not need to be included via the -ip parameter.


Get-QADUser -includedproperties thumbnailphoto | select thumbnailPhoto,DisplayName,samaccountname | export-csv Users_with_photos.csv
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Easily Design & Build Your Next Website

Squarespace’s all-in-one platform gives you everything you need to express yourself creatively online, whether it is with a domain, website, or online store. Get started with your free trial today, and when ready, take 10% off your first purchase with offer code 'EXPERTS'.

  • 5
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now