PowerShell、Exchange 2010 地址簿
是否可以从客户端上运行的 PowerShell 脚本访问 Exchange 2010 地址簿? 我想访问地址簿、按属性搜索并处理结果。
我还没有找到任何有关 EWS 和 PowerShell 的教程。
[Reflection.Assembly]::LoadFrom("path to ews.dll")
$ExchangeService = new-object ExchangeServiceBinding
$paramName = New-Object UserConfigurationNameType
$paramName.Item = New-Object FolderIdType
$paramName.Name = "CategoryList"
$params = New-Object GetUserConfigurationType
$params.UserConfigurationName = $paramName
$params.UserConfigurationProperties = [UserConfigurationPropertyType]::ALL
$ExchangeService.UseDefaultCredentials
$ExchangeService.Url = "https://path.to.exchange/EWS/Exchange.asmx"
$ExchangeService.GetUserConfiguration($params)
It is possible to access Exchange 2010 Addressbook from a PowerShell Script which is running on a client?
I want to access the addressbook, search by properties and work with the results.
I have not found any tutorial for the EWS and PowerShell.
[Reflection.Assembly]::LoadFrom("path to ews.dll")
$ExchangeService = new-object ExchangeServiceBinding
$paramName = New-Object UserConfigurationNameType
$paramName.Item = New-Object FolderIdType
$paramName.Name = "CategoryList"
$params = New-Object GetUserConfigurationType
$params.UserConfigurationName = $paramName
$params.UserConfigurationProperties = [UserConfigurationPropertyType]::ALL
$ExchangeService.UseDefaultCredentials
$ExchangeService.Url = "https://path.to.exchange/EWS/Exchange.asmx"
$ExchangeService.GetUserConfiguration($params)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不了解 PowerShell,但您可以在 Exchange Management Shell (EMC) 中完成此操作。 PowerShell v2.0+ 可以运行远程会话,因此可以从客户端使用 EMC 命令。当然,他们需要一些 Exchange 权限才能做到这一点。在 Exchange 2010 中,RBAC 允许您向用户授予极小的 Exchange 权限,这很方便。如果这不是一个选项,您可以执行 LDAP 查询(这就是 Outlook 所做的),但我不确定确切的过程。
但是,如果可以选择:
之后,请尝试以下操作之一:
注意:请参阅 http://www.msexchange.org/articles_tutorials/exchange-server-2007/management-administration/address-lists-exchange-2007-part1.html 对此有更好的解释。
--或--
注意:这将显示所有启用邮件的用户,因此它可能不完全是您要查找的内容。
I don't know about PowerShell, but you can accomplish this in Exchange Management Shell (EMC). PowerShell v2.0+ can run remote sessions, so the EMC commands can be used from your clients. Of course they'll need some Exchange rights to do this. Conveniently in Exchange 2010, RBAC allows you to give miniscule Exchange rights to your users. If this is not an option, you could do an LDAP query (that's what Outlook does) but I'm not sure of the exact procedure.
However, if it is an option:
After that, try one of the following:
Note: See http://www.msexchange.org/articles_tutorials/exchange-server-2007/management-administration/address-lists-exchange-2007-part1.html for a better explanation of this.
--OR--
Note: This will show all Mail-Enabled users, so it might not be exactly what you're looking for.
您需要 Exchange EWS 托管 API:
http://msdn.microsoft.com/en -us/library/dd637749.aspx
You need the Exchange EWS Managed API:
http://msdn.microsoft.com/en-us/library/dd637749.aspx