Connect to Office365
How to connect to office365
1. Connect to Exchange Online
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://partner.outlook.cn/PowerShell -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Also We can use command with username and password
$CNUser = "admin@consto.partner.onmschina.cn"
$CNPWord = ConvertTo-SecureString –String "password" –AsPlainText -Force
$CNCredential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $CNUser,$CNPWord
Import-Module MSOnline
Connect-MsolService -Credential $CNCredential
$ExchangeShell = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://partner.outlook.cn/PowerShell-LiveID?PSVersion=2.0 -Credential $CNCredential -Authentication Basic -AllowRedirection
$importresults = Import-PSSession $ExchangeShell -AllowClobber
2. Connect to Office 365
Get-ExecutionPolicy
Set-ExecutionPolicy RemoteSigned #更改执行策略
$credential = Get-Credential /#创建凭据
$credential #验证凭据
#连接到office365上面(首先要导入模块,安装登录助手,Azure AD模块)
#注意要是安装好了Azure Adconnect 的时候,先决条件会自动安装成功
Import-Module MsOnline #导入office365模块
Get-Module #验证是否导入模块 ,若是返回Manifest MSOnline {Add-MsolAdministrativeUnitMe… 即是导入模块成功
Connect-MsolService -Credential $credential #连接到office365上面
Get-MsolDomain #获取office365中的域
Also We can use command with username and password
$User = "admin@constos.partner.onmschina.cn"
$PWord = ConvertTo-SecureString –String "password" –AsPlainText -Force
$Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $User,$Pword
Import-Module MsOnline
Connect-MsolService -Credential $Credential
3. connct office 365 sharepoint online
在你开始使用 Office 365 PowerShell 管理 SharePoint Online 之前,请确保安装了 SharePoint Online Management Shell 及其先决条件并且已连接到 SharePoint Online。
通过下载并运行 SharePoint Online Management Shell 安装 SharePoint Online Management Shell。只需对每台计算机执行一次此操作。
若要打开 SharePoint Online Management Shell 的命令提示符,请从开始屏幕中键入 sharepoint,然后单击“SharePoint Online Management Shell”。
若要连接到 SharePoint Online,请填写 $adminUPN 和 $orgName 变量的值(替换引号中的所有文本,包括 < and > 字符),然后在 SharePoint Online Management Shell 命令提示符中运行以下命令:
$adminUPN="<the full email address of an Office 365 administrator account, example: jdoe@contosotoycompany.onmicrosoft.com>"
$orgName="<name of your Office 365 organization, example: contosotoycompany>"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
https://technet.microsoft.com/library/dn568036.aspx
连接到 SharePoint Online PowerShell
在你开始使用 PowerShell 管理 SharePoint Online 之前,请确保安装了 SharePoint Online 命令行管理程序并且已连接到 SharePoint Online。
通过下载并运行 SharePoint Online 命令行管理程序 安装 SharePoint Online 命令行管理程序。只需对你正在从其中运行 SharePoint Online PowerShell 命令的每台计算机执行一次此操作。
若要打开 SharePoint Online 命令行管理程序的命令提示符,请从开始屏幕中键入 sharepoint,然后单击“SharePoint Online 命令行管理程序”。
若要连接到 SharePoint Online,请填写 $adminUPN 和 $orgName 变量的值(替换引号中的所有文本,包括 < and > 字符),然后在 SharePoint Online 命令行管理程序命令提示符中运行以下命令:
$adminUPN="<the full email address of a SharePoint Online global administrator account, example: jdoe@contosotoycompany.onmicrosoft.com>"
$orgName="<name of your Office 365 organization, example: contosotoycompany>"
$userCredential = Get-Credential -UserName $adminUPN -Message "Type the password."
Connect-SPOService -Url https://$orgName-admin.sharepoint.com -Credential $userCredential
系统通过“Windows PowerShell 凭据请求”对话框提示你时,请键入 SharePoint Online 全局管理员帐户的密码。
你现在就可以开始执行 SharePoint Online 命令。
Connect to Office365的更多相关文章
- Azure AD Connect 手动同步
我们目前采用工具Azure AD Connect 目录同步工具将本地域控制器的用户信息同步至office365和Azure 在之前目录同步工具中使用Windows 任务计划程序或单独的 Windows ...
- 广州 office365的开发者训练营交流活动简报
2018年10月13日,在 微软广州办公室(广州市天河区太古汇1座28层微软广州办公室) 成功举办了office365的开发者训练营,本活动在微软官网的地址: https://www.microsof ...
- Aras Innovator如何配置SMTP中转Office365
参考文档:http://www.ebdadvisors.com/blog/2015/7/31/configure-an-smtp-server-in-windows-iis-for-aras-inno ...
- 白嫖Office365
写作不易,资瓷一下呗!个人博客:https://raycoder.me 最近系统升级到1909, 送了我一套Office365. 我也很无奈啊, 送了让我激活也是够了... 用了各种激活软件都无效,比 ...
- Connect() 2016 大会的主题 ---微软大法好
文章首发于微信公众号"dotnet跨平台",欢迎关注,可以扫页面左面的二维码. 今年 Connect 大会的主题是 Big possibilities. Bold technolo ...
- IdentityServer4 使用OpenID Connect添加用户身份验证
使用IdentityServer4 实现OpenID Connect服务端,添加用户身份验证.客户端调用,实现授权. IdentityServer4 目前已更新至1.0 版,在之前的文章中有所介绍.I ...
- 2003-Can't connect to mysql server on localhost (10061)
mysql数据库出现2003-Can't connect to mysql server on localhost (10061)问题 解决办法:查看wampserver服务器是否启动,如果没有启动启 ...
- Error connecting to database [Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13)]
参照 http://stackoverflow.com/questions/4448467/cant-connect-to-local-mysql-server-through-socket-var- ...
- HTTP Method详细解读(`GET` `HEAD` `POST` `OPTIONS` `PUT` `DELETE` `TRACE` `CONNECT`)
前言 HTTP Method的历史: HTTP 0.9 这个版本只有GET方法 HTTP 1.0 这个版本有GET HEAD POST这三个方法 HTTP 1.1 这个版本是当前版本,包含GET HE ...
随机推荐
- 【无私分享:ASP.NET CORE 项目实战(第九章)】创建区域Areas,添加TagHelper
目录索引 [无私分享:ASP.NET CORE 项目实战]目录索引 简介 在Asp.net Core VS2015中,我们发现还有很多不太简便的地方,比如右击添加视图,转到试图页等功能图不见了,虽然我 ...
- 关于Net Core 多平台程序的Framework问题
关于Net Core 多平台程序的Framework问题: (本文只是推测,欢迎大家指正) 最近在研究NetCore的多平台问题,起因是有一个Winform的项目,由于跨平台的要求,想改为NetCor ...
- GJM :Unity集成Leap Motion
Demo演示视频
- 阿里云添加路由的Windows批处理文件
一段很好的学习bat程序的示例代码,如下: @echo off route print -4 "10.0.0.0" | find "10.0.0.0" > ...
- Hibernate框架之Criteria查询 和注解(重点☆☆☆☆☆,难点☆☆☆)
写好一篇博客,不是容易的事.原因是:你要给自己以后看的时候,还能看懂,最重要的是当别人看到你的博客文章的时候,也一样很清楚的明白你自己写的东西.其实这也是一种成就感!! 对于每一个知识点,要有必要的解 ...
- jQuery css3仿游戏网站右键环形菜单
效果展示 http://hovertree.com/texiao/jquery/86/ PC用户右键弹出环形菜单. 手机用户扫描二维码: 长安可以弹出环形菜单. 转自:http://hovertree ...
- nrm NPM源管理工具
nrm NPM源管理工具 工具 前端 npm cnpm 今天经过同事介绍,发现一个好玩的东西——nrm(NPM registry manager) nrm 是一个可以快速切换NPM源的node插件.由 ...
- [转载】——故障排除:Shared Pool优化和Library Cache Latch冲突优化 (文档 ID 1523934.1)
原文链接:https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrlstate=23w4l35u5_4&id=152393 ...
- JavaSe:Properties文件格式
Properties文件格式说明 Properties继承自Hashtable,是由一组key-value的集合. 在Java中,常用properties文件作为配置文件.它的格式是什么样的呢? 下图 ...
- linux 安装mysql数据库——tar.gz包解压安装法
mysql数据库有多种安装方式,本文只介绍在Linux服务器上的tar.gz包解压安装法, 先通过mysql官网或者网络资源下载 mysql-5.7.3-m13-linux-glibc2.5-x86_ ...