小编Col*_*ole的帖子

除我以外的任何人与Set-UserPhoto的Office 365 Powershell问题

我是365环境的全局管理员,并且Powershell中的Set-UserPhoto命令遇到问题。如果我用自己的用户名运行它,就可以正常工作,但是如果我使用其他人的用户名运行它,则会出错。我需要给自己一些访问权限来完成这项工作吗?我是365中的域管理员和全局管理员,因此我应该能够执行任何操作。

使用以下命令通过PowerShell 3.0连接:

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/?proxyMethod=RPS -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Run Code Online (Sandbox Code Playgroud)

我正在运行的命令:

Set-UserPhoto –Identity username -PictureData ([System.IO.File]::ReadAllBytes("C:\userpics\username.jpg"))
Run Code Online (Sandbox Code Playgroud)

适用于我的用户名,对于任何其他用户名,我都可以这样做:

代理命令'Set-UserPhoto -Identity:'username'-PictureData上的错误- 这里的数字滚动了一段时间 -Confirm:$ False'到服务器BN3PR0201MB1027.namprd02.prod.outlook.com:服务器版本15.01.0534.0000 ,代理方法RPS:WinRM客户端无法处理该请求。连接字符串的格式应为[://] [:] [/],其中传输是“ http”或“ https”之一。传输,端口和后缀是可选的。主机可以是主机名或IP地址。对于IPv6地址,将地址括在方括号内-例如“ http:// [1 :: 2]:80 / wsman“。更改连接字符串,然后重试请求。 PSComputerName:outlook.office365.com

powershell office365 powershell-3.0

5
推荐指数
1
解决办法
5639
查看次数

标签 统计

office365 ×1

powershell ×1

powershell-3.0 ×1