?
Solved

Exchange2010 Powershell Disconnect User and put it to new alias

Posted on 2013-06-14
4
Medium Priority
?
297 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

Office 365 Training for Admins - 7 Day Trial

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

Question has a verified solution.

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

This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
A couple of months ago we ran into an issue that necessitated re-creating our Edge Subscriptions. However, when we attempted to execute the command: New-EdgeSubscription -filename C:\NewEdgeSub_01.xml we received an error indicating that the LDAP se…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses
Course of the Month9 days, 1 hour left to enroll

764 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