header1   header
header
header Register : : Login header
header
connector   connector
menuleft menuright
submenu   submenu
left
Set Forwarding for an OU based on matching contacts
Last Post 06 Apr 2010 09:01 AM by jk2ny. 0 Replies.
Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Not Resolved
jk2nyUser is Offline
New Member
New Member
Posts:23
Avatar

--
06 Apr 2010 09:01 AM
    I am trying to do something like this:

    for each mailbox in $OU

    Find its matching contact in $OU2 - set mailbox forwarding of mailbox to its matching contact


    I have tried to do the following but it doesnt work....



    # Unhides all mail contacts in OU2, sets all mailboxes in OU1 to its matching contact in OU2

    $orgu2 = ''

    $orgu1 = ''

    get-mailcontact -OrganizationalUnit $orgu2 |Set-Mailcontact -HiddenFromAddressListsEnabled $false

    Get-User -OrganizationalUnit $orgu1 -RecipientTypeDetails UserMailbox | Foreach-Object{

    $contact2 = (get-contact $_.Name -OrganizationalUnit $orgu2 ).DistinguishedName

    $_|Get-Mailbox| Set-Mailbox -ForwardingAddress $contact2 -DeliverToMailboxAndForward $false}

    You are not authorized to post a reply.


    Active Forums 4.3
    right
    footer   footer
    footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
    footer   footer