or download this
#!/usr/bin/perl -w
use strict;
my $un = 'steve gilbert';
my $jpeg = 'v:/employee photos/out/steve gilbert.jpg';
my $result = `c:\\windows\\system32\\windowspowershell\\v1.0\\powershe
+ll.exe -command "Set-ADUser $un -Replace @{thumbnailPhoto=([Byte[]](G
+et-Content $jpeg -Encoding Byte))}"`;