PowerShellのセットアップ
モジュールのインストール
モジュールをインストールします
Azure Active Directory の PowerShell モジュール
PowerShellの設定
PowerShell接続ポリシーを RemoteSigned に設定する。
# Set-ExecutionPolicy RemoteSigned
設定の確認
# Get-ExecutionPolicy
Office365へ接続
管理者権限でPowerShellを起動し、下記コマンドを実行します。「Windows PowerShell資格情報の要求」ダイアログが表示されるので、接続したいOffice365管理者権限のユーザーID・パスワードを入力します。
Office365へ接続
# $msolcred = Get-Credential # Import-Module MsOnline # Connect-MsolService -Credential $msolcred
Exchange Onlineへ接続
# $PSSessionOption = New-PSSessionOption -ProxyAuthentication Negotiate -SkipRevocationCheck # $ExOnlineSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection -SessionOption $PSSessionOption # Import-PSSession $ExOnlineSession