使用AzureADUserThumbnailPhoto同步o365用户照片 [英] Sync o365 user photo with AzureADUserThumbnailPhoto
问题描述
你好!
我可以使用以下方式设置用户照片使用以下命令的Microsoft在线门户网站或powershell:
$ UserCredential
= Get-Credential
$UserCredential = Get-Credential
$ Session
= New-PSSession
- ConfigurationName
Microsoft.Exchange - ConnectionUri
https://outlook.office365.com/powershell-liveid/?proxyMethod=RPS
- Credential $ UserCredential
- 身份验证 基本
- AllowRedirection
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/?proxyMethod=RPS -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession
$ Session - AllowClobber
Import-PSSession $Session -AllowClobber
Set-UserPhoto
UserMailbox@contoso.com
- PictureData ( [ System.IO.File ] :: ReadAllBytes(" D:\\ \\ Temp\123.jpg" ))}
Set-UserPhoto UserMailbox@contoso.com -PictureData ([System.IO.File]::ReadAllBytes("D:\Temp\123.jpg"))}
一切正常。但我无法理解为什么使用Microsoft在线门户网站或PowerShell设置用户照片后AzureADUserThumbnailPhoto没有更新?
我使用以下命令检查设置用户照片:
Get-UserPhoto
UserMailbox
#此命令返回照片设置的信息
Get-UserPhoto UserMailbox # This command return information that photo is set
Get-AzureADUser
- 过滤器 " UserPrincipalName eq'UserMailbox@contoso.com '"
| ForEach-Object { Get-AzureADUserThumbnailPhoto
- ObjectId $ _ 。 ObjectId}
#此命令返回错误,该照片为否。
Get-AzureADUser -Filter "UserPrincipalName eq 'UserMailbox@contoso.com'" | ForEach-Object {Get-AzureADUserThumbnailPhoto -ObjectId $_.ObjectId} # This command return error, that photo is no.
请帮帮我。
推荐答案
它不能与Powershell一起使用,但您可以通过Azure门户本身完成,还是整个过程无效?
试试这个:
1.使用图片需要cha的用户登录Azure门户nged
2。通过Azure门户将用户目录切换到默认目录
3。转到Azure Active Directory>所有用户
4。选择用户,并在个人资料中更改照片
Try this:
1. Login to the Azure Portal using a user whose picture needs to be changed
2. Switch the directory of the user to the default directory through Azure Portal
3. Go to Azure Active Directory > All Users
4. Select the user, and in the profile change the photo
这篇关于使用AzureADUserThumbnailPhoto同步o365用户照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!