Updating the Photo Attributes in Active Directory with Powershell

Today I got to have the joys of needed to once again get caught up on importing employee photos into the Active Directory photo attributes, thumbnailPhoto and jpegPhoto. While this isn’t exactly the most necessary thing on Earth it does make working in a Windows environment “pretty” as these images are used by things such as Outlook, Lync and Cisco Jabber among other. In the past the only way I’ve only ever known how to do this is by using the AD Photo Edit Free utility, which while nice tends to be a bit buggy and it requires lots of repetitive action as you manually update each user for each attribute. This year I’ve given myself the goal of 1) finally learning Powershell/PowerCLI to at least the level of mild proficiency and 2) automating as many tasks like this as possible. While I’ve been dutifully working my way through a playlist of great PluralSight courses on the subject, I’ve had to live dangerously a few times to accomplish tasks like this along the way.

So long story short with some help along the way from Googling things I’ve managed to put together a script to do the following.

  1. Look in a directory passed to the script via the jpgdir parameter for any images with the file name format <username>.jpg
  2. Do an Active Directory search in an OU specified in the ou parameter for the username included in the image name. This parameter needs to be the full DN path (ex. LDAP://ou=staff,dc=foo,dc=com)
  3. If the user is found then it will make a resized copy of the image file into the “resized” subdirectory to keep the file sizes small
  4. Finally the resized image is then set as the both the thumbnailPhoto and jpegPhoto attribute for the user’s AD account

So your basic usage would be .\Set-ADPhotos.ps1 -jpgdir "C:\MyPhotos" -OU "LDAP://ou=staff,dc=foo,dc=com" . This should be easily setup as a scheduled task to fully automate the process. In our case I’ve got the person in charge of creating security badges feeding the folder with pictures when taken for the badges, then this runs at 5 in the morning each day automatically.

All that said, here’s the actual script code:

 

Did I mention that I had some help from the Googles? I was able to grab some great help (read Ctrl+C, Ctrl+V) in learning how to piece this together from a couple of sites:

The basic idea came from https://coffeefueled.org/powershell/importing-photos-into-ad-with-powershell/

The Powershell Image Resize function: http://www.lewisroberts.com/2015/01/18/powershell-image-resize-function/

Finally I’ve been trying to be all DevOpsy and start using GitHub so a link to the living code can be found here: https://github.com/k00laidIT/Learning-PS/blob/master/Set-ADPhotos.ps1

Community and the Rural IT Professional

I was born and raised in a small area between Charleston and Huntington, WV. While I recognized my hometown, Scott Depot, was a small town growing up I thought of both those cities as just that, proper cities with all the benefits and drawbacks that go with them. As I grew older and my worldly view wider I came to realize that what I considered the big city was to many a minor suburb, but never the less it was and still is my home.

This lack of size and economic opportunity has never stood out more than when I began my career in Information Technology. After graduating from Marshall University with what I still believe to be a very respectable skill set many of my fellow graduates flocked to bigger areas such as Columbus, OH, RTP and Atlanta. I chose for a variety of reasons to stick around here and make a career of it and all in all while not always the most stable it has been fairly successful.

There are very few large datacenters here with most datacenters being composed of a handful of racks. Some go to work for various service providers, others enter the VAR space and I found my niche in what I like to call the Hyper Converged Administrator role. The HCA tends to wear most if not all of the hats; virtualization, storage, networking, server administration, etc. I consider myself somewhat blessed that I’ve managed to avoid the actual desktop admin stuff for most of my career, but still some of that too.

In the past couple of years I’ve got more and more active within the social IT community by way of conference attendance, social media and blogging and while it hasn’t necessarily changed the direction my career is going it has radically changed it in that I have found great opportunities for growing my personal knowledge. This growth in some cases has been very strictly technology related by way of pushing me to explore new facets of IT systems management I didn’t previously consider as well as access to very knowledgeable people who are usually very eager to point you in the right direction when asked. In other ways this knowledge while IT related is more oblique in that I feel like I now have a much better understanding of what life is like on the other side of the various fences (vendors, VARs, datacenter admins, etc) than I ever did before. This latter knowledge base has greatly changed how I approach some of the more political parts of IT such as vendor management and internal project pitches.

While the global Internet community is great I find that the missing piece is still facetime. The richness of communication when I’m at conferences is more personal than anything that is done online and I find myself somewhat jealous of those in areas large enough to support user groups of any kind of size. In the past year I’ve got to know VMware User Group (VMUG) leaders from Louisville, Kansas City, Phoenix and Portland as well as the guys behind the excellent career oriented community vBrisket and enjoying hearing tales of what’s involved in getting their regular meetings together and wish I could do the same here.

Personally my goal for the coming year is to do a bit of travel and attend the meetings of some of the User Groups listed above. If you are local here in the WV IT community reach out and let’s figure out how to do something here. There may not be a lot of us here but that’s an even better reason to get to know each other and share the knowledge.

Let’s See How This Goes: Getting Started with vDM30in30

For those of you that don’t know the idea of #vDM30in30 (virtual Design Master: 30 articles in 30 days) started last year by the same fine folks that bring you vDM with the stated goal of getting people to write more and become better writers. You can learn more about the basic rules in Eric Wright’s (aka discoposse) post announcing this year’s event. I caught up to the idea a little late in the game to make any kind of effort at it, but this year due to my writer’s funk of late I’ve decided to give it a go.

So what do I expect to write about? Since I’m freshly back from Veeam Software‘s annual VeeamON conference expect quite a bit of content related to that. Also I’ve had a few ideas regarding career and community here lately so there will be quite a bit of that as well. Past that? I guess we’ll just have to see what happens.

If you are interested in participating yourself really the only two things you need to remember is to write/create content anywhere (go setup a blogger.com account if you don’t have a site yet) and then post to social media with the #vDM30in30 hashtag, that’s it! If you don’t feel like you are ready for that kind of commitment, trust me, I get you, then you can still follow along and learn from everybody else using the same hashtag. For those of you who are participating good job and I look forward to learning from you!

Proud to be a Veeam Vanguard

On July 27th Rick Vanover over on the Veeam Blog announced the inaugural class of what is known as the Veeam Vanguard of which I am honored to have been selected as a member. What the heck is a Veeam Vanguard? While best described in Rick’s announcement blog post, my take is that this group is composed of members of the IT and virtualization global community who are Veeam users and go above and beyond in sharing their knowledge of the ins and outs of the various Veeam products.  Frankly I am flabbergasted to be named and wish to thank them for the nomination.

Without getting too gushy or fanboyish, I have found over the years that Veeam’s products tend to solve problems we all deal with in a virtualized world. Backup & Replication especially had made my day in, day out life easier because I know my data is nice and protected and I can test just about anything I want to do without effecting the production environment.

In closing I just want to say congrats to all of the other nominees and that I look forward to seeing what you have to share. To say the group is geographically diverse is an understatement as Veeam was ever so nice to include the nationalities of all members, it’s very cool to see so many flags represented. Many included I’ve followed on twitter and the blogspace for quite some time, while are others are new to me but in the end I’m sure there will be some great knowledge shared and I look forward to getting to know you.

VMUG Advantage Eval Experience

Do you find yourself longing for the good old days of the VMware Technical Network (VMTN)? Do you have a home lab you are wanting to use to learn more about the VMware ecosphere. Well good news, the fine folks at VMUG today announced the addition of a service called Eval Experience to their already excellent service VMUG Advantage. Eval Experience will provide 365 day evaluation licenses for a variety of VMware’s products including

  • vCenter Server Server 5 Standalone
  • vSphere with Operations Management Enterprise Plus
  • vCloud Suite Standard
  • vRealize Operations Insight
  • vRealize Operations 6 Enterprise
  • vRealize Log Insight
  • vRealize Operations for Horizon
  • Horizon Advanced Edition
  • Virtual SAN (VSAN)

That is a great list that includes the vast majority of technologies that one wanting to break into virtualization would look for. Really the only thing missing in my opinion is NSX and frankly I’m flummoxed as to why it isn’t there considering VMware’s big push in the SDN direction of late.

In any case, considering the $200 price tag for an Advantage subscription this is a good deal for evaluation licensing kit. For comparison, the best deal I ever got for Microsoft Technet (#RIP) was $250 per year. Nevermind the fact that you get a number of other discounts and services as part of your subscription.