views:

2964

answers:

4

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

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

thanks in advance

A: 

I'm pretty sure the error message is accurate - it cannot perform searches outside the current default scope. You would need to change the scope you're running the command in.

Don Jones
+1  A: 

Try to set this global variable:

$AdminSessionADSettings.ViewEntireForest = $true

Or set it on a cmdlet level:

Get-Mailbox -ignonreDefaultScope

Shay Levy
will i have to set this variable every time i run the script?
phill
A: 

If you use the second option(-ignoredefaultscope), make sure to pass the DN of the object as a parameter to -Identity.

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

Thanks, Sitaram Pamarthi

www.techibee.com

Sitaram Pamarthi
A: 

FYI - in 2010 the command to change the scope is "Set-AdServerSettings -ViewEntireForest $True"

jedi