Solved

Exchange2010 Powershell Disconnect User and put it to new alias

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
The Nano Server Image Builder helps you create a custom Nano Server image and bootable USB media with the aid of a graphical interface. Based on the inputs you provide, it generates images for deployment and creates reusable PowerShell scripts that …
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…
how to add IIS SMTP to handle application/Scanner relays into office 365.

756 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