简体   繁体   English

如何从特定的OU查找Exchange服务器上的所有用户?

[英]How to find all users on Exchange server from a particular OU?

I need to get a report of all users on an Exchange server who are located at one particular OU in Active Directory. 我需要获取位于Active Directory中某个特定OU的Exchange服务器上所有用户的报告。 Is there a way to do this with Powershell or VBS? 有没有办法使用Powershell或VBS做到这一点?

Thanks 谢谢

Get-Mailbox -ResultSize Unlimited -OrganizationalUnit 'OU=test1,DC=domain,DC=com'

The PS cmdlet will work for versions of Exchange 2007 and later. PS cmdlet将适用于Exchange 2007及更高版本。 Here is how you'd extract the list and dump it in a text file. 这是提取列表并将其转储到文本文件中的方法。 I've added the -IgnoreDefaultScope handle so that you're able to extract the list even though the OU in question is in a subdomain. 我添加了-IgnoreDefaultScope句柄,以便即使有问题的OU在子域中,您也可以提取列表。

Get-Mailbox -IgnoreDefaultScope -ResultSize Unlimited -OrganizationalUnit 'OU=Staff Leavers,DC=my,DC=domain,DC=com' > C:\SysMgr\LeaverMailboxes.txt

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM