留作笔记;
照片大小应该小于10K,大小应该为96×96,格式为JPG;上传时最好让用户自己提供照片,照片名字以用户名命名,假设张三,则格式为zhangsan.jpg;
1、首先注册schmmgmt.dll模块,这样才能在mmc中添加AD架构;

需要一个脚本,PowerShell下通过命令来列出,截取,研究研究吧。。。
写出来一个东西,这个例子中,所有用户照片都放在C:\photo\文件夹中,且以用户登录名称命名:
$lists=Get-Item -Include * -path c:\photo\* | select name
ForEach ($item in $lists)
{
$item=[string]$item
$item=($item.trim().split("."))[0]
$item=$item.split("=")[1]
$photo="c:\photo\"+$item+".jpg";
echo $item $photo
Import-RecipientDataProperty -Identity $item -Picture -FileData ([Byte[]]$(Get-Content -Path $photo -Encoding Byte -ReadCount 0))
echo finsh!
}

















