PS script needed to export and change default public folder database for a mailbox database using csv import file for few servers only.
I need to first export the information of few exchange 2007 servers default PF database associated to MB databases.
After that i want to assigne different default PF database for a MB database.
Is it possible to get the PS script to achieve this task. Doesn't matter if i get two different scripts for this.
I need this script(s) within this as next weekend i need to perform this change.
Thanks in advance.
Shahid
October 1st, 2011 2:43am
Hello Shahid,
If you want to get the public folder database associated to MB databases, you can use this:
get-mailboxdatabase|foreach-object{
$DatabaseName=$_.Name
get-mailboxdatabase -identity $DatabaseName|Select-Object @{Name="Mailbox Database";Expression={$DatabaseName}}, PublicFolderDatabase|out-file c:\report.txt -append
}
When you want to change the public folder for mailbox, you can create a csv file like this:
MailboxDatabase
PublicFolder
MailboxDatabase1
public folder1
MailboxDatabase2
public fodler2
….
…….
Save this file at a path (I saved it this path c:\PublicFolder.csv), run below commands to change the default public folder database:
Import-csv c:\PublicFolder.csv| foreach-object{
$Database=$_.MailboxDatabase
$PublicFolder=$_.PublicFolder
Set-MailboxDatabase -Identity $Database -PublicFolderDatabase $PublicFolder
}
Here are some related documents for you:
Get-MailboxDatabase
http://technet.microsoft.com/en-us/library/bb124924(EXCHG.80).aspx
How to Change the Default Public Folder Database for a Mailbox Database
http://technet.microsoft.com/en-us/library/bb629522(EXCHG.80).aspx
Thanks,
Evan
Free Windows Admin Tool Kit Click here and download it now
October 3rd, 2011 2:18am
Hello Shahid,
If you want to get the public folder database associated to MB databases, you can use this:
get-mailboxdatabase|foreach-object{
$DatabaseName=$_.Name
get-mailboxdatabase -identity $DatabaseName|Select-Object @{Name="Mailbox Database";Expression={$DatabaseName}}, PublicFolderDatabase|out-file c:\report.txt -append
}
When you want to change the public folder for mailbox, you can create a csv file like this:
MailboxDatabase
PublicFolder
MailboxDatabase1
public folder1
MailboxDatabase2
public fodler2
….
…….
Save this file at a path (I saved it this path c:\PublicFolder.csv), run below commands to change the default public folder database:
Import-csv c:\PublicFolder.csv| foreach-object{
$Database=$_.MailboxDatabase
$PublicFolder=$_.PublicFolder
Set-MailboxDatabase -Identity $Database -PublicFolderDatabase $PublicFolder
}
Here are some related documents for you:
Get-MailboxDatabase
http://technet.microsoft.com/en-us/library/bb124924(EXCHG.80).aspx
How to Change the Default Public Folder Database for a Mailbox Database
http://technet.microsoft.com/en-us/library/bb629522(EXCHG.80).aspx
Thanks,
Evan
October 3rd, 2011 9:16am
i am testing it in my lab. will update you with results.Shahid
Free Windows Admin Tool Kit Click here and download it now
October 4th, 2011 2:11am
Any updates?
Thanks,
Evan
October 6th, 2011 3:00am
Your script worked fine. Thanks again Evan for coming to my rescue.Shahid
Free Windows Admin Tool Kit Click here and download it now
October 6th, 2011 7:44am