Solved

Exchange2010 Powershell Disconnect User and put it to new alias

Posted on 2013-06-14
4
286 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_
  • 2
  • 2
4 Comments
 
LVL 52

Accepted Solution

by:
Manpreet SIngh Khatra earned 500 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

Join & Write a Comment

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
In this video we show how to create a mailbox database in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Servers >> Data…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

743 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now