CSV (MoveMailboxes.
Bharat Suneja [MVP] posted on Thursday, June 28, 2007 9:08 PM
CSV (MoveMailboxes.csv) fields:
Username, TargetDatabase, TargetOU
(You can leave out the TargetDatabase and TargetOU if all moved mailboxes
will be in the same OU and on the same target Store... and use those
references in the command instead of having them in the CSV).
$SourceCredential = Read-Host "Enter Source Forest
Credentials" -AsSecureString
$TargetCredential = Read-Host "Enter Target Forest
Credentials" -AsSecureString
Import-CSV MoveMailboxes.csv | foreach {Move-Mailbox -Identity
$_.Username -TargetDatabase $_.TargetDatabase -NTAccountOU
_.TargetOU -SourceForestGlobalCatalog "mctdc1.test.net" -GlobalCatalog
$SourceCredential -TargetForestCredential $TargetCredential}
--
Bharat Suneja
MVP - Exchange
www.zenprise.com
NEW blog location:
exchangepedia.com/blog
------------------------------ |
|
Thank you so much Bharat, I have something very similar to this but mine isnt
Amy posted on Thursday, June 28, 2007 10:41 PM
Thank you so much Bharat, I have something very similar to this but mine
isnt as elegant as yours, as I didnt allow for the SourceCredential and
TargetCredential - I was running those manually inside the shell before I
spun off my script.... my one problem, and I think this script here will
have it too... how do you pipe the Yes at the end of each mailbox that it is
going to move? I have tried every trick I know from my batch scripting....
Thanks
amy |
|
|
|
|
Didn't Find The Answer You Were Looking For? |
| EggHeadCafe has experts online right now that may know the answer to your question. We pay them a bonus for answering as many questions as they can. So, why not help them and yourself by becoming a member (free) and ask them your question right now? |
| Create Account & Ask Question In Live Forum |
|
|