Powershell Import / Export photo into / from AD

【Powershell Import / Export photo into / from AD】沉舟侧畔千帆进,病树前头万木春。这篇文章主要讲述Powershell Import / Export photo into / from AD相关的知识,希望能为你提供帮助。

  1. Import photo to AD
    $photopath = d:\\photo\\aaa.jpg $photo = [byte[]](Get-Content $photopath -Encoding byte) Set-ADUser $username -Replace @thumbnailPhoto=$photo

  2. Export photo from AD
    $photopath = d:\\photo\\aaa.jpg $user = Get-ADUser $username -Properties thumbnailPhoto $user.thumbnailPhoto | Set-Content $photopath -Encoding byte


    推荐阅读