0

我正在尝试查找有关获取 Windows PowerShell 脚本的更多信息,该脚本将登录到 Office 365 的 powershell,该脚本将提示输入用户的管理员凭据。我不是关键字,我可以搜索这个,但我没有找到太多关于它的信息,请大家帮忙。我不只是想要一个可以做到这一点的脚本,我也在寻找关于它的信息以及它是如何工作的。

4

2 回答 2

2

对于交换 powershell 使用:

$SecPass1 = convertto-securestring -asplaintext -string "PassSword" -force
$MSOLM = new-object System.Management.Automation.PSCredential -argumentlist "GlobalAdmin@some.com",$SecPass1
$Session = New-PSSession -ConfigurationName Microsoft。 Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $MSOLM -Authentication Basic -AllowRedirection
Import-Module MSOnline Import-PSSession $Session –AllowClobber

于 2013-08-14T18:18:08.623 回答
1

此脚本将提示输入凭据并以管理员身份登录 Office 365:

To Login:


$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange-ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Import-PSSession $Session

如果您有更多的任务要做而不仅仅是登录,我可能会帮助您编写脚本,因为我已经为 Office 365 搜索并编写了许多脚本。

于 2014-01-21T08:44:27.663 回答