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 ... 
随机推荐
- input输入
			只能输入数字onkeyup='this.value=this.value.replace(/\D/gi,"")'限制文本框只能输入正数,小数onkeyup="value= ... 
- vs2015 已经支持开发asp .net core 1.0 rc2 程序了
			vs2015 已经支持开发asp .net core 1.0 rc2 程序了 http://mp.weixin.qq.com/s?__biz=MzI0MzM1ODczOQ==&mid=2247 ... 
- 记录一次bug解决过程:eclipse Installed JREs 配置引出的问题
			一 总结 eclipse Installed JREs 配置引出的问题:编译以来JDK,不是JRE spring boot内嵌tomcat运行程序,tomcat:run 二 Bug描述:eclipse ... 
- Maven远程仓库的配置
			在很多情况下,默认的中央仓库无法满足项目的需求,可能项目需要的构件存在于另外一个远程仓库中,如JBoss Maven仓库.这时,可以在POM中配置该仓库,见代码如下: <!-- 远程仓库的配置 ... 
- 面向云的.net core开发框架
			目录结构 1 为什么搭建面向云的.Net core云开发框架 2 主要设计思路 3 项目解决方案 4 基础设施层 4.1反射工具 4.2多级可换源的配置(上) 42多级可换源的配置(下) 4.3可配置 ... 
- ArcGIS Engine开发之图形查询
			图形查询是以用户通过鼠标操作生成的图形几何体为输入条件进行查询的查询,其查询结果为该几何体空间范围内的所有要素.常用的查询方式包括点选.线选.多边形选择.圆形选择和矩形选择等. 相关类与接口 图像查询 ... 
- commit(), commitNow()和commitAllowingStateLoss()
			关于FragmentTransaction的各种提交方法: commit(),commitAllowingStateLoss(),commitNow()和commitNowAllowingStateL ... 
- Android 手机卫士--导航界面4的业务逻辑
			本文实现导航界面4的业务逻辑,导航界面4的界面如下: 本文地址:http://www.cnblogs.com/wuyudong/p/5952640.html,转载请注明出处. 相应的代码如下: pri ... 
- 转载一篇React native的props的用法
			注:默认值如何设置 http://www.tuicool.com/articles/uMfYv2q 
- UIView上的控件使用push方法跳转
			有时候在项目中,为了保持前后页面的推进方式跳转方式一致,会在通过UIview上的控件跳到另一个Controller上,所以,这时候就需要用到这种方式了,当然,present方法可以实现跳转但是样式可能 ... 
