EWS managed APIを使用しているときに、PowerShellで基本的な所有権を取得する方法を理解するのが難しいです。ほとんどのタスクを実行するPowershell 。EWS Managed API 2.2を使用してユーザーのアカウントのエイリアスのリストを取得する
本当に見たいのは、ユーザーのアカウント内のすべてのエイリアスです。しかし、私はまたそこに記載されているいくつかの特定のフィールドを取得する方法を理解していない例えばMicrosoft.Exchange.WebServices.Data.AlternateId
$Email = '[email protected]'
$Pass = 'example4321'
#path for the Exchange WebServices DLL
$EWSPath = "C:\path\Microsoft.Exchange.WebServices.dll"
#Connecting with EWS/Exchange
[Reflection.Assembly]::LoadFile($EWSPath) | Out-Null
$service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService([Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2013_SP1)
$service.Credentials = New-Object Microsoft.Exchange.WebServices.Data.WebCredentials($Email,$Pass)
$service.Url = new-object Uri("https://outlook.office365.com/EWS/Exchange.asmx");
$service.traceenabled = "true"
#Defining the Root folder
$RootFolderId = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$email)
$RootFolder = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($Service,$RootFolderId)
# ################
# Here I want to list all the user's aliases.
##################
$Mailbox = $RootFolder.getMailbox()