0

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() 

答えて

1

ResolveName https://msdn.microsoft.com/en-us/library/office/dn645423(v=exchg.150).aspxはおそらく、あなたが名前と、その後の復帰を解決する場合はEWS内などということを行います何かに取得する最も近いですディレクトリからの連絡先情報しかし、それだけで、その後の事のこのタイプは、あなたが、例えばhttps://graph.windows.net/youorg.com/me/proxyAddressesを探しているすべての情報を返しますグラフAPIに最も適しているあなたはOffice365を使用している場合

$ncCol = $service.ResolveName("[email protected]", [Microsoft.Exchange.WebServices.Data.ResolveNameSearchLocation]::DirectoryOnly, $true); 
if($ncCol.Count -gt 0){ 
    #Write-output ("Found " + $ncCol[0].Contact) 
} 

をcollection.eg emailaddressesの最初の3つのアドレスを返します。アカウントのすべてのプロキシアドレスを返します

関連する問題