Figure 1: Syntax of the New-StorageGroup command
For example, create a new storage group called MyNewGroup on a folder, you need to have the following syntax:
Figure 2: Create a new Storage Group
We have seen that it is quite simple to create a new storage group. To remove existing groups, you can be done using the remove-storagegroup command, as shown in the figure below:
Figure 3: Syntax of Remove-StorageGroup command
If you look at some of the parameters of this command, you will see the syntax of the command quite simple. If you want to remove an existing storage group called MyNewGroup, you must use the code below:
Figure 4: Remove MyNewGroup Storage Group
If you created a new storage group and now need to change some of its settings (such as enabling logging mode) then you need to use the Set-StorageGroup command with the following syntax:
Figure 5: Syntax of the Set-StorageGroup command
For storage group tasks, we'll look at how to change the path of the StorageGroupPath group with the command. You may need this task when configuring a new storage for the server and then want to transfer this entire storage group to another server.
Figure 6: Syntax of Move-StorageGroupPath command
For example, to move the log directory to another path, you must follow the command below:
Figure 7: Move the path of the log file directory with Move-StorageGroupPath command
As you can see in the picture, working with storage groups with the command is quite simple and you don't have to know much about parameters and other syntax. If you work with more powerful tools in the near future, you may find them easier to use than the Exchange management interface.
The reason for this is in the mailbox database
In the second part of this article series, I will show you more about managing mailbox databases. If you are using Exchange Server 2007 Enterprise version, you can create 50 databases for 50 storage groups. That will allow you to configure your mail system in the way that best fits your organization. With Standard Exchange Server 2007, you can only create 5 split databases for 5 maximum storage groups.
Exchange Server 2007 will only support a public folder database. However, generally you will not need this public folder database because they need to be migrated to Windows SharePoint Services or Microsoft Office SharePoint Server 2007.
We will look at how to create a new mailbox database on Exchange Server 2007 using the New-Mailbox command. This command has the following syntax:
Figure 8: Syntax of the New-MailboxDatabase command
If you need to create a new mailbox database called 'MyMailboxDB' in the existing 'MyNewGroup' storage group, then you need the following command.
Figure 9: Create a new Mailbox database using the New-MailboxDatabase command
If you have created a mailbox database, then want to change some of its properties, then you need to use the Set-MailboxDatabase command as shown below:
Figure 10: Syntax of the Set-MailboxDatabase command
With this command, you can create restrictions for databases, indexing, keeping deleted items and lots of other properties.
If you need to delete a mailbox database on Exchange Server 2007, follow these commands:
Figure 11: Syntax of Remove-MailboxDatabase command
If you need to remove an existing Mailbox database called 'MyMailboxDB' you need to follow the following syntax:
Figure 12: Remove the mailbox database using the Remove-MailboxDatabase command
If you want to move the mailbox database files to a new location on the server storage drive, you need to use Move-DatabasePath using the following command:
Figure 13: Syntax of Move-DatabasePath command
As you can see from this first part, perhaps managing databases using Powershell is quite simple.
Lastly
In this article, I have shown you how to manage Exchange Server 2007 using commands to perform everyday tasks more efficiently. If you need to perform some of these tasks multiple times, you can save these commands into a .ps1 file and run them as needed. If you are an advisor or have to set up many Exchange servers with the same basic configuration, these scripts will help you significantly reduce the amount of work and time.