How to get all users from Exchange with EWS

前端 未结 2 1847
梦如初夏
梦如初夏 2021-01-24 19:40

I would like to get all users from xchange server with EWS. I have figured out how to get all rooms and all appointments. But I specifically need all users thus I can CRUD users

2条回答
  •  爱一瞬间的悲伤
    2021-01-24 20:05

    In response to some of your comments:

    A good way to work with Exchange 2010 (And this method works here in my network, where we run E2010) is through interactive Powershell sessions with your hub exchange server that has Exchange Management Tools installed, running powershell version 2.0.

    The goal is as follows:

    1. Create a new interactive session with New-PSSession
    2. Import that session to make the remote cmdlets native to your local host.

    .

    $session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://YOURFQDNOFTHEEXCHANGESERVERHERE/powershell
    Import-PSSession $session | out-null
    

    Then you will be able to use things (cmdlets) available to Exchange Management Shell/EMC as if you were remotely logged into the exchange server itself.

    This method was extracted directly from the Exchange Management Tools installation directory itself, which is how the Exchange Management Shell actually imports the modules/functions/extended cmdlet functionality to the regular powershell host.

    From that point forward, I'd highly recommend for you to google/search Exchange 2010 powershell commandlets, as they are extremely useful and powerful (no pun intended) tools to help manage AD objects, Exchange objects, etc.

提交回复
热议问题