Solved

Need to office 365 commands - Bulk remove autoforward and bulk get DN legacy for all users

Posted on 2014-11-06
5
244 Views
Last Modified: 2014-11-12
i need to turn off auto forward for all users in list and need to get all dn legacy for all users.
0
Comment
Question by:Jorge Ocampo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 5

Expert Comment

by:basil2912
ID: 40426823
Hello,

Since there is no transport settings we can use the RBAC policy to prevent users for messages forwarding question - see http://community.office365.com/en-us/f/148/t/23307.aspx for how to do it.

Get-Mailbox | fl name,legacyExchangedn for the attribute you need.
Can export it to a file by adding > c:\file.txt to the cmdlet or add export-csv switch.
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40426856
i thought to cancel we would use something like

o cancel the email forwarding, you can use the cmdlet below:

Set-Mailbox -Identity <mailbox@mydomain.com> -DeliverToMailboxAndForward $false -ForwardingSMTPAddress $null

This cmdlet should be able to work.

but thats for one user
0
 
LVL 5

Expert Comment

by:basil2912
ID: 40426885
Not very sure if user cannot set it afterwards.

The cmdlet deactivates it only and the delivertomailboxandforward mentions only if in case messages are forwarded they should be or not also kept in the recipient's mailbox.

The RBAC is used because simply the users are forbidden to use the autoforward settings.

You can also create a transport rule to reject all automated messages, but it will include OOF.
0
 
LVL 2

Author Comment

by:Jorge Ocampo
ID: 40426947
i dont want to disable forever just this instance i am migrating to there mailbox and dont want duplicates
0
 
LVL 41

Accepted Solution

by:
Vasil Michev (MVP) earned 500 total points
ID: 40428367
If you want to use it against all mailboxes, do this:

Get-Mailbox  | Set-Mailbox -DeliverToMailboxAndForward $false -ForwardingSMTPAddress $null

Open in new window


To get the LegacyDN for all users, do this:

Get-Mailbox -ResultSize Unlimited | select Name,Alias,UserPrincipalName,LegacyExchangeDN | export-csv -nti c:\legacydn.csv

Open in new window

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enabling the Skype for Business Meeting Scheduler in Hybrid OWA
Unified and professional email signatures help maintain a consistent company brand image to the outside world. This article shows how to create an email signature in Exchange Server 2010 using a transport rule and how to overcome native limitations …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question