zoukankan      html  css  js  c++  java
  • 使用Powershell链接到Office 365

    今天主要讲使用Powershell管理Office 365 可以分为office365用户管理,Exchange Online的管理等

    1. 使用Powershell 链接到office 365 用户管理界面

    需要先安装登陆助手及Azure AD模块

    在windows powershell 下运行:

    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

    或者采用综合代码

    $User = "admin@conston.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

    2.  使用Powershell 链接到office 365 Exchange Online 管理界面

    在windows powershell 下运行:

    Set-ExecutionPolicy RemoteSigned
    $UserCredential = Get-Credential //(获取office365的登录凭据)
    $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://partner.outlook.cn/PowerShell -Credential $UserCredential -Authentication Basic –AllowRedirection // 国际版本URL为; https://outlook.office365.com/powershell-liveid/
    Import-PSSession $Session

    或者采用综合代码

  • 相关阅读:
    GetSystemMetrics SM_** 系统消息
    Direct3D中的HLSL
    Delphi TStream 详细介绍
    VI命令详解(大全)
    Delphi中messagedlg
    Windows中的消息详细列表
    SharePoint2007深入浅出——开发环境配置
    深入浅出InfoPath——预备式
    SharePoint术语对照表
    深入浅出Nintex——判断当前用户的角色
  • 原文地址:https://www.cnblogs.com/junjiany/p/6062969.html
Copyright © 2011-2022 走看看