Powershell exchange: get-mailbox out of default limits

how to run the "get-mailbox" cmdlet outside the current default scope of the current domain?

When I run get-mailbox -OrganizationalUnit bob.com/bobsage I get the error: Get-mailbox: The requested search root "rss.com/rsstoilet" is not in the current default "ens.com". Cannot search outside the current default scope.

early

+1


source to share


3 answers


Try setting this global variable:

$AdminSessionADSettings.ViewEntireForest = $True

Or use Set-ADServerSettings -ViewEntireForest $True



Or set it at the cmdlet level:

Get-Mailbox -IgnoreDefaultScope

+2


source


I'm pretty sure the error message is accurate - it can't search beyond the current scope by default. You will need to change the scope in which you are executing the command.



0


source


If you are using the second option (-ignoredefaultscope), be sure to pass the object DN as a parameter to -Identity.

ex: Get-Mailbox -IgnoreDefaultScope -Identity "cn = username, ou = ouname, dc = domainname, dc = com"

Thank you, Sitaram Pamarti

www.techibee.com

0


source







All Articles