LoginSignup
3
4

More than 5 years have passed since last update.

【Exchange】会議室配布グループ

Posted at

会議室一覧

会議室一覧は、配布グループを使用するのと同じ方法で使用できる、特別な配布グループです。ただし、会議室一覧は、Exchange 管理シェルを使用してのみ作成できます。

会議室配布グループに会議室メールボックスを追加する

# 管理者ユーザ名
$userName = 'root@XXXXXXXX.onmicrosoft.com'

# パスワード
$password = 'XXXXXXXX'

$policy = Get-ExecutionPolicy -Scope LocalMachine
if ($policy -ne 'RemoteSigned') {
    Set-ExecutionPolicy RemoteSigned
    Write-Host 'リモートシェルを有効にしました。'
}

$secureStr = ConvertTo-SecureString $password -AsPlainText -force
$pscredential = New-Object System.Management.Automation.PSCredential($userName, $secureStr)
$UserCredential = Get-Credential $pscredential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session -AllowClobber

# ------------------------------------------------------------------------------
$roomListName = '会議室一覧'
$roomListAlias = 'rooms'

# 会議室配布グループ作成
New-DistributionGroup -Name $roomListName -Alias $roomListAlias -RoomList

# 作成確認
Get-DistributionGroup $roomListName

# 会議室メールボックス取得
$mailboxes = Get-Mailbox -ResultSize unlimited -Filter { RecipientTypeDetails -eq 'RoomMailbox' }

# 会議室配布グループに追加
$mailboxes | % { Add-DistributionGroupMember $roomListAlias -Member $_.Alias }

# 追加確認
Get-DistributionGroupMember $roomListName
# ------------------------------------------------------------------------------

Remove-PSSession $Session

参考サイト

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4