none
Need to import photos of users in outlook 2010 RRS feed

  • General discussion

  • Hi,

        What will be the AD Powershell / Exchange Shell script if i want to import multiple photos of users from a specific OU in AD or an entire domain.... 

    Regards

    Sathya

    Thursday, June 26, 2014 3:42 PM

All replies

  • Instead of PS you can use an app for that task - its easier and more comfortable with graphical UI.
    Oh - and it's free: CodeTwo Active Directory Photos

    www.codetwo.com

    If this post helps resolve your issue, please click the "Mark as Answer" or "Helpful" button at the top of this message. By marking a post as Answered, or Helpful you help others find the answer faster.

    Friday, June 27, 2014 7:31 AM
  • I did check on the tool and few more to...

    The requirement basically to have script which we can schedule....


    Sathya

    Wednesday, July 30, 2014 7:24 AM
  • How you do it depends on what release of Powershell you're using and whether you have the ActiveDirectory module in the machine.

    Import-Module ActiveDirectory

    $photo=[byte[]](Get-Content"C:\directory\XXX.jpg"-Encodingbyte) Set-ADUserUserID-Replace@{thumbnailPhoto=$photo}

    If you don't have the ActiveDirectory module, and you don't want to depend on having the EMS on the machine doing the work, you can use something like this:

    $username = "XXXXXX"
    $jpgfile = "XXXXXX.jpg"
    $dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()
    $root = $dom.GetDirectoryEntry()
    $search = [System.DirectoryServices.DirectorySearcher]$root
    $search.Filter = "(&(objectclass=user)(objectcategory=person)(samAccountName=$username))"
    $result = $search.FindOne()
    
    if ($result -ne $null)
    {
    	$user = $result.GetDirectoryEntry()
    	[byte[]]$jpg = Get-Content $jpgfile -encoding byte
    	$user.put("thumbnailPhoto",  $jpg )
    	$user.setinfo()
    	Write-Host $user.displayname " updated"
    }
    else {Write-Host $struser " Does not exist"}

                  

    --- Rich Matheisen MCSE&I, Exchange MVP

    Saturday, August 2, 2014 5:47 PM
  • I use a separate system with AD module... the environment Windows 2008 and Exchange 2007 SP3

    Sathya

    Tuesday, December 9, 2014 9:45 AM