Powershell连接Office 365各组件的方法
参考: http://www.exchangecn.com/office365/20150108_540.html
MFA(双因子认证):https://technet.microsoft.com/en-us/library/mt811266(v=exchg.160).aspx
MFA-SFB: https://support.office.com/zh-cn/article/office-365-powershell-%E7%9A%84%E8%AE%BE%E7%BD%AE%E6%96%B9%E6%A1%88-6b2477de-2c07-4d5e-8061-a8a094c9a237?ui=zh-CN&rs=zh-CN&ad=CN#BMK_SKYPE
1. 适用于 IT 专业人员 RTW 的 Microsoft Online Services 登录助手
https://www.microsoft.com/en-us/download/details.aspx?id=41950
2. 用于 Windows PowerShell 的 Windows Azure Active Directory 模块 (History)
AdministrationConfig-zh-hans(1.0.9031.1): http://go.microsoft.com/fwlink/p/?linkid=236297
v1(1.1.166.0): https://docs.microsoft.com/en-us/powershell/msonline/v1/azureactivedirectory
v2: https://docs.microsoft.com/en-us/powershell/azuread/v2/azureactivedirectory
3. 适用于 Skype for Business Online 的 Windows PowerShell 模块
https://www.microsoft.com/en-US/download/details.aspx?id=39366
4. SharePoint Online Client Components SDK
https://www.microsoft.com/en-us/download/details.aspx?id=42038
5. SharePoint Online Management Shell
https://www.microsoft.com/en-us/download/details.aspx?id=35588
$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://outlook.office365.com/powershell-liveid/ -Credential $creds -Authentication Basic -AllowRedirection
# 世纪互联版地址:https://partner.outlook.cn/PowerShell
Import-PSSession $ExchangeSession
断开: Remove-PSSession $ExchangeSession
4. Connect to Exchange Online Protection
$EOPSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.compliance.protection.outlook.com/powershell-liveid/ -Credential $creds -Authentication Basic -AllowRedirection
Import-PSSession $EOPSession
5. Connect to Lync
$LyncSession = New-CsOnlineSession -Credential $creds
Import-PSSession $LyncSession
断开: Get-PSSession | Remove-PSSession
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 智能桌面机器人:用.NET IoT库控制舵机并多方法播放表情
· Linux glibc自带哈希表的用例及性能测试
· 深入理解 Mybatis 分库分表执行原理
· 如何打造一个高并发系统?
· .NET Core GC压缩(compact_phase)底层原理浅谈
· 手把手教你在本地部署DeepSeek R1,搭建web-ui ,建议收藏!
· 新年开篇:在本地部署DeepSeek大模型实现联网增强的AI应用
· Janus Pro:DeepSeek 开源革新,多模态 AI 的未来
· 互联网不景气了那就玩玩嵌入式吧,用纯.NET开发并制作一个智能桌面机器人(三):用.NET IoT库
· 【非技术】说说2024年我都干了些啥