Reputation: 13844
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
Upvotes: 2
Views: 29489
Reputation: 126702
Try to set this global variable:
$AdminSessionADSettings.ViewEntireForest = $True
Or use Set-ADServerSettings -ViewEntireForest $True
Or set it on a cmdlet level:
Get-Mailbox -IgnoreDefaultScope
Upvotes: 4
Reputation: 459
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
Upvotes: 0
Reputation: 9497
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.
Upvotes: 0