PowershellにてExchangeに接続する。

今日は「Powershellにて、Exchangeサーバに接続する方法」です。

前回 Windows7(64bit)にPowershellをインストールする方法」を
書きましたが、
今回は そこから進んで「Powershell で、Exchangeサーバへアクセス」を
行いたいと思います。

1.Powewrshellアイコンを右クリックし、『管理者として実行』をクリックする。

2.コンピュータで実行できるスクリプトを決定し、”Yes”を選択し、
実行ポリシーを変更する。
Set-ExecutionPolicy RemoteSigned

※上記のコマンドは「スクリプトは信頼できる発行元が署名した場合にのみ実行可能」な
設定値です。

3.Windows PowerShell資格オブジェクトを作成する。
# $UserCredential = Get-Credential

4.下記のような画面が表示されたら 管理者ID・PASSを入力する。
JULY050

5.次に以下のコマンドを実行する。
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

6.操作が終了したら以下のコマンドを入力し、セッションを終了する。
Remove-PSSession $Session

以上
2016年07月