Advertisement

04.28.2008 at 11:01AM PDT, ID: 23359591
[x]
Attachment Details

Powershell Command to locate the Domain Membership of an Exchange Mailbox

Asked by asdlkf in Exchange Email Server, Computer Servers, Scripting Languages

Tags: Microsoft, Powershell, V1.0, Powershell Domain Mailbox Finder, Exchange Powershell Script LDAP

I am an admin in a multi domain environment. (Names Changed, but here's what it's like:)

Domain1.forest1.com
DomainA.Domain1.forest1.com
Domain2.forest1.com

Sample Users:
Login: Domain1\User1 - Mailbox: Domain2\User1
Login: DomainA\UserA - Mailbox: Domain2\UserA
Login: Domain2\User2 - Mailbox: Domain1\User2

So, you can see there are users with mailboxes in separate domains within the forest.
If I change scope to forest view, I can get-mailbox and set-mailbox and enable-ummailbox etc... however, for the purpose of this business task, this is impractical.

What I need is a way to get the name (either FQDN or just CN or what ever) of the domain that hosts the mailbox for a user. This does not need to be in any specific format (such as a cmdlet). A function or a single command would be great too.

Example of what I would like to work:
c:\$adminsessionsettings.viewentireforest = $true
C:\get-mailboxLocation User1
Domain2
C:\get-mailboxLocation UserA
DomainA.Domain1.Forest1.com


I have tried looking at get-mailbox <alias> | fl and get-user <alias> | fl, but none of the attributes are definative answers to "what domain does the mailbox belong to". Unfortunately, We also have Server1.domain1.com that hosts mailboxes from all 3 domains so looking at get-mailbox <alias> | select-object MailServer won't help either.

500 Points up for grabs on this.

Thanks,

ChrisStart Free Trial
[+][-]04.29.2008 at 07:07AM PDT, ID: 21462378

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Exchange Email Server, Computer Servers, Scripting Languages
Tags: Microsoft, Powershell, V1.0, Powershell Domain Mailbox Finder, Exchange Powershell Script LDAP
Sign Up Now!
Solution Provided By: Chris-Dent
Participating Experts: 1
Solution Grade: A
 
 
[+][-]04.30.2008 at 02:00PM PDT, ID: 21474494

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628