Consolidate Checkpoint file with Transaction Log files folder

We had an independent review of all our Exchange servers and the consultants came back and pointed out that our Checkpoint log location was different than our log files. They wanted us to put the Checkpoint file in the same folder. I did this in 2 parts.

1. Grab all storage groups that currently had different values.

get-storagegroup | ?{$_.systemFolderPath -ne $_.LogFolderPath} | select server, name, logfolderpath, systemfolderpath | export -path c:\Checkpoint.csv

then clean-up the CSV to only include servers I want to fix. I am not concerned with the migration servers as they are all temporary.

2. Set all the SystemFolderPath to match the LogFolderPath values.

$csv = Import-Csv c:\checkpoint.csv
# For precaution, we paused each node before performing the script so it wouldn't
# accidentally roll the CCR node.
#
$list = $csv | ?{$_.server -match "10"}

foreach ($c in $list) {
        $dbname = $c.Name
        $srvr = $c.Server
        $logs = $c.LogFolderPath
       
write-host "Working with "$srvr

        $sg = Get-StorageGroup -Server $srvr | ?{$_.name -match $dbname}
        write-host "working on " $sg.name

        suspend-storagegroupcopy -id $sg.identity
        Move-StorageGroupPath -Identity $sg.Identity -SystemFolderPath $logs -ConfigurationOnly
        write-host "Resuming SG Copy"
        Resume-storagegroupcopy -id $sg.identity

        write-host "mounting database"
        get-mailboxdatabase -storageGroup $sg.identity | mount-database
}

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <blockquote> <center> <hr> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <drupal6>, <html>, <java>, <javascript>, <php>, <posh>.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.