Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Exchange2010 Powershell Disconnect User and put it to new alias

Posted on 2013-06-14
4
Medium Priority
?
298 Views
Last Modified: 2013-07-03
hi,

i like to disconnect a user from his mailbox and connect his mailbox to other Alias


First i like to save all Data like company, smtp-adress, used database, phone number
custom attribute1 to a csv with columns like
#csv
smtp    database    phonenumber     customerAttribute1,   company


Then i like to hangup the mailbox
Disable-Mailbox -Identity User1 -Database DB01

???? how can i get the information with powershell on which server the database is mounted?

Then i like to add the information like smtp from user1 to user2 from the CSV


How could i manage that?

appreciate for your help


#write infos to a CSV
Get-ADUser -identity user1 -properties * 
Get-Mailbox -Identity user1 -properties Database


Disable-Mailbox -Identity User1 -Database DB01

clean-mailboxdatabase DB01
Get-MailboxStatistics -server SRV2001 | Where {$_.DisconnectDate -ne $null}

Connect-Mailbox -Identity user1 -Database DB01 -User user2
#add data from user1 to user2

Open in new window

0
Comment
Question by:Mandy_
[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
4 Comments
 
LVL 52

Accepted Solution

by:
Manpreet SIngh Khatra earned 1000 total points
ID: 39251462
CSVDE -f "location of .csv"

this file will have all attributes of all objects in the entire environment ..... with the below you can tell the command what attributes just to capture and just have that data
-L "Attribute, Attribute, etc, etc"

#write infos to a CSV
Get-ADUser -identity user1 | FL
Get-Mailbox -Identity user1 | FL

- Rancy
0
 
LVL 2

Author Comment

by:Mandy_
ID: 39251662
csvde -f    and if i just want to store the information of only one user?

for example:  i have 2 aliases one with the old mailbox and one without any mailbox

User1, User2

1. User1 store all data like smtp, custom attributes, company, old used database, Membership of any groups and distribution lists,

2. User1 disconnect the   mailbox

3.User2 attach the mailbox from user1 to new alias
4.User2 add the data from point 1 to user2

What you thing could be the best way to do this?

thx
mandy
0
 
LVL 52

Expert Comment

by:Manpreet SIngh Khatra
ID: 39253533
If its just 2 users you can simply use LDP tool a simple and easy to get all info in one place tool .... you can use CSVDE as well but will be some hardwork

- Rancy
0
 
LVL 2

Author Comment

by:Mandy_
ID: 39266734
Could you give me an example how to do this with ldap tool?
0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

One-stop solution for Exchange Administrators to address all MS Exchange Server issues, which is known by the name of Stellar Exchange Toolkit.
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
In this Micro Video tutorial you will learn the basics about Database Availability Groups and How to configure one using a live Exchange Server Environment. The video tutorial explains the basics of the Exchange server Database Availability grou…
how to add IIS SMTP to handle application/Scanner relays into office 365.
Suggested Courses

610 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