![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Exchange 2007: cross org mailbox migration bulk from csv file Hi all I am trying to migrate Exchange 2003 mailboxes in one forest, to exchange 2007 in another forest. I can do it with the following script: get-mailbox -domaincontroller 'sourceDC' -credential $s -identity 'name@xxxxxx' | move-mailbox -Targetdatabase 'EX2007\mailbox database' -sourceforestglobalcatalog 'sourceGC' -globalcatalog 'targetGC' -domaincontroller 'targetDC' -sourcemailboxcleanupoptions none -SourceForestCredential $s-targetforestcredential $t -confirm: $false This script works correctly for single mailboxes. What i need to do now, is get the -identity command to read from either a .csv file or a .txt file (Whichever is easier) so that i can migrate mailboxes in batches. i would also like to wrap it up into a .ps1 script Could someone help me? Cheers Ian |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Exchange 2007: cross org mailbox migration bulk from csv file Create a CSV file with one column named "Identity" and add the names one per line. Import-Csv automatically creates an object with properties that corresponds to the names of the columns. That way you can remove the -identity paramater from the command cause it's going to be piped to get-mailbox from Import-Csv. import-csv names.csv | get-mailbox -domaincontroller 'sourceDC' -credential $s | move-mailbox -Targetdatabase ..... See Recipe 2.5 from "Windows PowerShell Cookbook" by Lee Holmes. http://www.oreilly.com/catalog/9780596528492/index.html ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: > Hi all > > I am trying to migrate Exchange 2003 mailboxes in one forest, to > exchange 2007 in another forest. > > I can do it with the following script: > > get-mailbox -domaincontroller 'sourceDC' -credential $s -identity > 'name@xxxxxx' | move-mailbox -Targetdatabase 'EX2007\mailbox > database' -sourceforestglobalcatalog 'sourceGC' -globalcatalog > 'targetGC' -domaincontroller 'targetDC' -sourcemailboxcleanupoptions > none -SourceForestCredential $s-targetforestcredential $t -confirm: > $false > > This script works correctly for single mailboxes. > > What i need to do now, is get the -identity command to read from > either a .csv file or a .txt file (Whichever is easier) so that i can > migrate mailboxes in batches. > > i would also like to wrap it up into a .ps1 script > > Could someone help me? > > Cheers > > Ian > |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Exchange 2007: cross org mailbox migration bulk from csv file BEWARE, always add the -whatif parameter before applying it in production! Good Luck. ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: > On Jan 9, 12:54 pm, Shay Levi <n...@xxxxxx> wrote: > Quote: >> Create a CSV file with one column named "Identity" and add the names >> one per line. >> >> Import-Csv automatically creates an object with properties that >> corresponds >> to the names of the columns. >> That way you can remove the -identity paramater from the command >> cause it's >> going to be piped >> to get-mailbox from Import-Csv. >> import-csv names.csv | get-mailbox -domaincontroller 'sourceDC' >> -credential $s | move-mailbox -Targetdatabase ..... >> >> See Recipe 2.5 from "Windows PowerShell Cookbook" by Lee >> Holmes.http://www.oreilly.com/catalog/9780596528492/index.html >> >> ----- >> Shay Levi >> $cript Fanatichttp://scriptolog.blogspot.com >> Hebrew weblog:http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: >>> Hi all >>> >>> I am trying to migrate Exchange 2003 mailboxes in one forest, to >>> exchange 2007 in another forest. >>> >>> I can do it with the following script: >>> >>> get-mailbox -domaincontroller 'sourceDC' -credential $s -identity >>> 'n...@xxxxxx' | move-mailbox -Targetdatabase 'EX2007\mailbox >>> database' -sourceforestglobalcatalog 'sourceGC' -globalcatalog >>> 'targetGC' -domaincontroller 'targetDC' -sourcemailboxcleanupoptions >>> none -SourceForestCredential $s-targetforestcredential $t -confirm: >>> $false >>> >>> This script works correctly for single mailboxes. >>> >>> What i need to do now, is get the -identity command to read from >>> either a .csv file or a .txt file (Whichever is easier) so that i >>> can migrate mailboxes in batches. >>> >>> i would also like to wrap it up into a .ps1 script >>> >>> Could someone help me? >>> >>> Cheers >>> >>> Ian- Hide quoted text - >>> >> > > Cheers > > E > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Exchange 2007: cross org mailbox migration bulk from csv file On Jan 9, 12:54*pm, Shay Levi <n...@xxxxxx> wrote: Quote: > Create a CSV file with one column named "Identity" and add the names one > per line. > > Import-Csv automatically creates an object with properties that corresponds > to the names of the columns. > That way you can remove the -identity paramater from the command cause it's > going to be piped > to get-mailbox from Import-Csv. > > import-csv names.csv | get-mailbox -domaincontroller 'sourceDC' -credential > $s | move-mailbox -Targetdatabase ..... > > See Recipe 2.5 from "Windows PowerShell Cookbook" by Lee Holmes.http://www..oreilly.com/catalog/9780...492/index.html > > ----- > Shay Levi > $cript Fanatichttp://scriptolog.blogspot.com > Hebrew weblog:http://blogs.microsoft.co.il/blogs/scriptfanatic > > > Quote: > > Hi all Quote: > > I am trying to migrate Exchange 2003 mailboxes in one forest, to > > exchange 2007 in another forest. Quote: > > I can do it with the following script: Quote: > > get-mailbox -domaincontroller 'sourceDC' -credential $s -identity > > 'n...@xxxxxx' | move-mailbox -Targetdatabase 'EX2007\mailbox > > database' -sourceforestglobalcatalog 'sourceGC' -globalcatalog > > 'targetGC' -domaincontroller 'targetDC' -sourcemailboxcleanupoptions > > none -SourceForestCredential $s-targetforestcredential $t -confirm: > > $false Quote: > > This script works correctly for single mailboxes. Quote: > > What i need to do now, is get the -identity command to read from > > either a .csv file or a .txt file (Whichever is easier) so that i can > > migrate mailboxes in batches. Quote: > > i would also like to wrap it up into a .ps1 script Quote: > > Could someone help me? Quote: > > Cheers Quote: > > Ian- Hide quoted text - > - Show quoted text - Cheers E |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Exchange 2007: cross org mailbox migration bulk from csv file On Jan 9, 12:54*pm, Shay Levi <n...@xxxxxx> wrote: Quote: > Create a CSV file with one column named "Identity" and add the names one > per line. > > Import-Csv automatically creates an object with properties that corresponds > to the names of the columns. > That way you can remove the -identity paramater from the command cause it's > going to be piped > to get-mailbox from Import-Csv. > > import-csv names.csv | get-mailbox -domaincontroller 'sourceDC' -credential > $s | move-mailbox -Targetdatabase ..... > > See Recipe 2.5 from "Windows PowerShell Cookbook" by Lee Holmes.http://www..oreilly.com/catalog/9780...492/index.html > > ----- > Shay Levi > $cript Fanatichttp://scriptolog.blogspot.com > Hebrew weblog:http://blogs.microsoft.co.il/blogs/scriptfanatic > > > Quote: > > Hi all Quote: > > I am trying to migrate Exchange 2003 mailboxes in one forest, to > > exchange 2007 in another forest. Quote: > > I can do it with the following script: Quote: > > get-mailbox -domaincontroller 'sourceDC' -credential $s -identity > > 'n...@xxxxxx' | move-mailbox -Targetdatabase 'EX2007\mailbox > > database' -sourceforestglobalcatalog 'sourceGC' -globalcatalog > > 'targetGC' -domaincontroller 'targetDC' -sourcemailboxcleanupoptions > > none -SourceForestCredential $s-targetforestcredential $t -confirm: > > $false Quote: > > This script works correctly for single mailboxes. Quote: > > What i need to do now, is get the -identity command to read from > > either a .csv file or a .txt file (Whichever is easier) so that i can > > migrate mailboxes in batches. Quote: > > i would also like to wrap it up into a .ps1 script Quote: > > Could someone help me? Quote: > > Cheers Quote: > > Ian- Hide quoted text - > - Show quoted text - thanks for that, i will work, i just have one other question... in the source domain, i only have one 2003 DC, and if the script looks at either of the other 2 2000 DCs, it fails. Could you look at my script above and tell me where i can specify the 2003 DC? Thanks again Ian |
My System Specs![]() |
| | #6 (permalink) |
| | Re: Exchange 2007: cross org mailbox migration bulk from csv file I can see that you already specified it, as in: get-mailbox -domaincontroller 'sourceDC'... or am I missing something? ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: > On Jan 9, 12:54 pm, Shay Levi <n...@xxxxxx> wrote: > Quote: >> Create a CSV file with one column named "Identity" and add the names >> one per line. >> >> Import-Csv automatically creates an object with properties that >> corresponds >> to the names of the columns. >> That way you can remove the -identity paramater from the command >> cause it's >> going to be piped >> to get-mailbox from Import-Csv. >> import-csv names.csv | get-mailbox -domaincontroller 'sourceDC' >> -credential $s | move-mailbox -Targetdatabase ..... >> >> See Recipe 2.5 from "Windows PowerShell Cookbook" by Lee >> Holmes.http://www.oreilly.com/catalog/9780596528492/index.html >> >> ----- >> Shay Levi >> $cript Fanatichttp://scriptolog.blogspot.com >> Hebrew weblog:http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: >>> Hi all >>> >>> I am trying to migrate Exchange 2003 mailboxes in one forest, to >>> exchange 2007 in another forest. >>> >>> I can do it with the following script: >>> >>> get-mailbox -domaincontroller 'sourceDC' -credential $s -identity >>> 'n...@xxxxxx' | move-mailbox -Targetdatabase 'EX2007\mailbox >>> database' -sourceforestglobalcatalog 'sourceGC' -globalcatalog >>> 'targetGC' -domaincontroller 'targetDC' -sourcemailboxcleanupoptions >>> none -SourceForestCredential $s-targetforestcredential $t -confirm: >>> $false >>> >>> This script works correctly for single mailboxes. >>> >>> What i need to do now, is get the -identity command to read from >>> either a .csv file or a .txt file (Whichever is easier) so that i >>> can migrate mailboxes in batches. >>> >>> i would also like to wrap it up into a .ps1 script >>> >>> Could someone help me? >>> >>> Cheers >>> >>> Ian- Hide quoted text - >>> >> > > thanks for that, i will work, i just have one other question... > > in the source domain, i only have one 2003 DC, and if the script looks > at either of the other 2 2000 DCs, it fails. Could you look at my > script above and tell me where i can specify the 2003 DC? > > Thanks again > > Ian > |
My System Specs![]() |
| | #7 (permalink) |
| | Re: Exchange 2007: cross org mailbox migration bulk from csv file On Jan 9, 1:57*pm, Shay Levi <n...@xxxxxx> wrote: Quote: > I can see that you already specified it, as in: > > get-mailbox -domaincontroller 'sourceDC'... > > or am I missing something? > > ----- > Shay Levi > $cript Fanatichttp://scriptolog.blogspot.com > Hebrew weblog:http://blogs.microsoft.co.il/blogs/scriptfanatic > > > Quote: > > On Jan 9, 12:54 pm, Shay Levi <n...@xxxxxx> wrote: Quote: Quote: > >> Create a CSV file with one column named "Identity" and add the names > >> one per line. Quote: Quote: > >> Import-Csv automatically creates an object with properties that > >> corresponds > >> to the names of the columns. > >> That way you can remove the -identity paramater from the command > >> cause it's > >> going to be piped > >> to get-mailbox from Import-Csv. > >> import-csv names.csv | get-mailbox -domaincontroller 'sourceDC' > >> -credential $s | move-mailbox -Targetdatabase ..... Quote: Quote: > >> See Recipe 2.5 from "Windows PowerShell Cookbook" by Lee > >> Holmes.http://www.oreilly.com/catalog/9780596528492/index.html Quote: Quote: > >> ----- > >> Shay Levi > >> $cript Fanatichttp://scriptolog.blogspot.com > >> Hebrew weblog:http://blogs.microsoft.co.il/blogs/scriptfanatic > >>> Hi all Quote: Quote: > >>> I am trying to migrate Exchange 2003 mailboxes in one forest, to > >>> exchange 2007 in another forest. Quote: Quote: > >>> I can do it with the following script: Quote: Quote: > >>> get-mailbox -domaincontroller 'sourceDC' -credential $s -identity > >>> 'n...@xxxxxx' | move-mailbox -Targetdatabase 'EX2007\mailbox > >>> database' -sourceforestglobalcatalog 'sourceGC' -globalcatalog > >>> 'targetGC' -domaincontroller 'targetDC' -sourcemailboxcleanupoptions > >>> none -SourceForestCredential $s-targetforestcredential $t -confirm: > >>> $false Quote: Quote: > >>> This script works correctly for single mailboxes. Quote: Quote: > >>> What i need to do now, is get the -identity command to read from > >>> either a .csv file or a .txt file (Whichever is easier) so that i > >>> can migrate mailboxes in batches. Quote: Quote: > >>> i would also like to wrap it up into a .ps1 script Quote: Quote: > >>> Could someone help me? Quote: Quote: > >>> Cheers Quote: Quote: > >>> Ian- Hide quoted text - Quote: Quote: > >> - Show quoted text - Quote: > > hi again Quote: > > thanks for that, i will work, i just have one other question... Quote: > > in the source domain, i only have one 2003 DC, and if the script looks > > at either of the other 2 2000 DCs, it fails. Could you look at my > > script above and tell me where i can specify the 2003 DC? Quote: > > Thanks again Quote: > > Ian- Hide quoted text - > - Show quoted text - command, but when i run my script it fails with the version needs to be 5.2 or above error, then shows that the SourceDomainController it tried to use was one of our 2000 ones... seems strange cheers E |
My System Specs![]() |
| | #8 (permalink) |
| | Re: Exchange 2007: cross org mailbox migration bulk from csv file Quote: > > thanks for that, i will work, i just have one other question... > > in the source domain, i only have one 2003 DC, and if the script looks > at either of the other 2 2000 DCs, it fails. Could you look at my > script above and tell me where i can specify the 2003 DC? > > Thanks again > > Ian add perhaps another column named "domaincontroller", and have the proper DC in the CSV file associated with each user. Maco |
My System Specs![]() |
| | #9 (permalink) |
| | Re: Exchange 2007: cross org mailbox migration bulk from csv file Can you tell which cmdlet is causing the error? get-mailbox or move-mailbox? Can you post the error? replace the computer names if its confedential. Another thing you can try, run the script on the 2003 DC without specifying source DC parameters? ----- Shay Levi $cript Fanatic http://scriptolog.blogspot.com Hebrew weblog: http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: > On Jan 9, 1:57 pm, Shay Levi <n...@xxxxxx> wrote: > Quote: >> I can see that you already specified it, as in: >> >> get-mailbox -domaincontroller 'sourceDC'... >> >> or am I missing something? >> >> ----- >> Shay Levi >> $cript Fanatichttp://scriptolog.blogspot.com >> Hebrew weblog:http://blogs.microsoft.co.il/blogs/scriptfanatic Quote: >>> On Jan 9, 12:54 pm, Shay Levi <n...@xxxxxx> wrote: >>> >>>> Create a CSV file with one column named "Identity" and add the >>>> names one per line. >>>> >>>> Import-Csv automatically creates an object with properties that >>>> corresponds >>>> to the names of the columns. >>>> That way you can remove the -identity paramater from the command >>>> cause it's >>>> going to be piped >>>> to get-mailbox from Import-Csv. >>>> import-csv names.csv | get-mailbox -domaincontroller 'sourceDC' >>>> -credential $s | move-mailbox -Targetdatabase ..... >>>> See Recipe 2.5 from "Windows PowerShell Cookbook" by Lee >>>> Holmes.http://www.oreilly.com/catalog/9780596528492/index.html >>>> >>>> ----- >>>> Shay Levi >>>> $cript Fanatichttp://scriptolog.blogspot.com >>>> Hebrew weblog:http://blogs.microsoft.co.il/blogs/scriptfanatic >>>>> Hi all >>>>> >>>>> I am trying to migrate Exchange 2003 mailboxes in one forest, to >>>>> exchange 2007 in another forest. >>>>> >>>>> I can do it with the following script: >>>>> >>>>> get-mailbox -domaincontroller 'sourceDC' -credential $s -identity >>>>> 'n...@xxxxxx' | move-mailbox -Targetdatabase 'EX2007\mailbox >>>>> database' -sourceforestglobalcatalog 'sourceGC' -globalcatalog >>>>> 'targetGC' -domaincontroller 'targetDC' >>>>> -sourcemailboxcleanupoptions none -SourceForestCredential >>>>> $s-targetforestcredential $t -confirm: $false >>>>> >>>>> This script works correctly for single mailboxes. >>>>> >>>>> What i need to do now, is get the -identity command to read from >>>>> either a .csv file or a .txt file (Whichever is easier) so that i >>>>> can migrate mailboxes in batches. >>>>> >>>>> i would also like to wrap it up into a .ps1 script >>>>> >>>>> Could someone help me? >>>>> >>>>> Cheers >>>>> >>>>> Ian- Hide quoted text - >>>>> >>>> - Show quoted text - >>>> >>> hi again >>> >>> thanks for that, i will work, i just have one other question... >>> >>> in the source domain, i only have one 2003 DC, and if the script >>> looks at either of the other 2 2000 DCs, it fails. Could you look at >>> my script above and tell me where i can specify the 2003 DC? >>> >>> Thanks again >>> >>> Ian- Hide quoted text - >>> >> > command, but when i run my script it fails with the version needs to > be 5.2 or above error, then shows that the SourceDomainController it > tried to use was one of our 2000 ones... seems strange > > cheers > > E > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Exchange 2007 Remove Mailbox after AD deletion | .NET General | |||
| Exchange 2007 - Mailbox management | PowerShell | |||
| Re: Exchange 2007: cross org mailbox migration bulk from csv file | PowerShell | |||
| Exchange 2007 Bulk Mailbox Creation - Password? | PowerShell | |||
| Creating a new mailbox on Exchange 2007 | PowerShell | |||