当前位置:网站首页 > 更多 > 玩电脑 > 正文

[玩转系统] 如何将员工照片导入 Active Directory

作者:精品下载站 日期:2024-12-14 12:20:44 浏览:14 分类:玩电脑

如何将员工照片导入 Active Directory


在这篇文章中,我们将了解如何将员工照片导入到 Active Directory 中。将图片导入 Active Directory 有多种方法,我所说的导入图片是指您可以在 Active Directory 中添加图片,它将显示在 Outlook 和 Lync 客户端中。

有很多第三方软件可以导入照片、编辑照片以及为用户帐户设置照片。我不建议安装任何第三方软件来设置用户帐户的图片。

在这篇文章中,我们将使用一个简单的命令来为用户帐户设置图片。请记住,图片的大小必须小于或等于10KB。

如何将员工照片导入 Active Directory

我们将使用交换命令Import-RecipientDataProperty来设置用户帐户的图片。使用 Exchange 管理员帐户登录到 Exchange Server 2010 并启动 Exchange 命令行管理程序。

输入命令

 Import-RecipientDataProperty -Identity "Username" -Picture -FileData ([Byte[]] $(Get-Content -Path "Provide path to pic" -Encoding Byte -ReadCount 0))

例子 -

Import-RecipientDataProperty -Identity "Eric.Dane" -Picture -FileData ([Byte[]] $(Get-Content -Path "C:UsersexadminPicturesTree.jpg" -Encoding Byte -ReadCount 0))

[玩转系统] 如何将员工照片导入 Active Directory

现在可以在 Outlook 2010 客户端中看到我们为用户帐户导入的图片。

[玩转系统] 如何将员工照片导入 Active Directory

您可以使用 PowerShell 命令在 Active Directory 中设置用户的图片。

登录到 Exchange 服务器,然后单击“开始”,然后在“搜索程序和文件”文本框中键入 PowerShell

单击Windows PowerShell 的Active Directory 模块

请注意,您还可以登录域控制器并执行相同的步骤。

[玩转系统] 如何将员工照片导入 Active Directory

命令语法 -

$photo = [byte[]](Get-Content path of pic -Encoding byte)

Set-ADUser username -Replace @{thumbnailPhoto=$photo}

例子 -

$photo = [byte[]](Get-Content C:UsersexadminPicturesTree.jpg -Encoding byte)

Set-ADUser eric.dane -Replace @{thumbnailPhoto=$photo}

[玩转系统] 如何将员工照片导入 Active Directory

您需要 登录账户 后才能发表评论

取消回复欢迎 发表评论:

关灯