Solved

Export list of active directory users with pictures

Posted on 2011-03-16
13
3,935 Views
Last Modified: 2012-05-11
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
Comment
Question by:Sedryn
  • 5
  • 5
  • 2
  • +1
13 Comments
 
LVL 17

Expert Comment

by:Sikhumbuzo Ntsada
ID: 35148034
0
 
LVL 4

Expert Comment

by:LeDaouk
ID: 35148086
you start from this script
Extract-All-Users-From-Active-Di.vbs
0
 
LVL 11

Expert Comment

by:RickSheikh
ID: 35148323
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
 

Author Comment

by:Sedryn
ID: 35148585
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
 
LVL 4

Expert Comment

by:LeDaouk
ID: 35148600
change the query to:
select name, alias, email, ....
0
 
LVL 11

Expert Comment

by:RickSheikh
ID: 35149747
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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:Sedryn
ID: 35150842
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
 
LVL 11

Expert Comment

by:RickSheikh
ID: 35150937
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
 

Author Comment

by:Sedryn
ID: 35151177
Thanks Rick but unfortunately that still pulls a 0 byte csv.
0
 

Author Comment

by:Sedryn
ID: 35151258
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
 
LVL 11

Accepted Solution

by:
RickSheikh earned 500 total points
ID: 35151650
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
 

Author Comment

by:Sedryn
ID: 35151699
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
 
LVL 11

Expert Comment

by:RickSheikh
ID: 35151824
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

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Do you have users whose passwords are expiring and they are constantly calling you?  Well I sure did and needed a way to put an end to this.  We have a lot of remote users which would not be notified that their passwords were expiring since they wer…
In this article, we will see the basic design consideration while designing a Multi-tenant web application in a simple manner. Though, many frameworks are available in the market to develop a multi - tenant application, but do they provide data, cod…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now