Solved

Exchange2010 Powershell Disconnect User and put it to new alias

Posted on 2013-06-14
4
292 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

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

This article runs through the process of deploying a single EXE application selectively to a group of user.
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
To show how to generate a certificate request 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 >> Certificates…
The basic steps you have just learned will be implemented in this video. The basic steps are shown to configure an Exchange DAG in a live working Exchange Server Environment and manage the same (Exchange Server 2010 Software is used in a Windows Ser…

789 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