码迷,mamicode.com
首页 > 系统相关 > 详细

Powershell连接Office 365各组件的方法

时间:2015-07-03 15:27:18      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:

参考: http://www.exchangecn.com/office365/20150108_540.html

$pw = ConvertTo-SecureString ‘password‘ -AsPlainText -Force
$creds = New-Object -Typename System.Management.Automation.PSCredential -Argumentlist ‘abc@company.cn‘, $pw

1. Connect to Office 365

Connect-MsolService -Credential $creds

Verify: Get-MsolDomain

断开: Get-PSSession | Remove-PSSession

 

2. Connect to SharePoint

Connect-SPOService -Url https://company-admin.sharepoint.cn -Credential $creds

验证: Get-SPOSite

断开: Disconnect-SPOService

 

3. Connect to Exchange Online

$ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://partner.outlook.cn/PowerShell -Credential $creds -Authentication Basic -AllowRedirection

Import-PSSession $ExchangeSession

断开: Remove-PSSession $exchangeSession

 

4. Connect to Lync

$LyncSession = New-CsOnlineSession -Credential $creds

Import-PSSession $LyncSession

断开: Get-PSSession | Remove-PSSession

Powershell连接Office 365各组件的方法

标签:

原文地址:http://www.cnblogs.com/IvanChen/p/4618624.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!