Powershell to create Mass Mailboxes in Exchange 2007 from CSV input file

Powershell to create the Mass mailboxes in Exchange 2007 orginisation from CSV input file. Below is the CSV file format which need to have the following header and details in the below mentioned format

Csv Format
Firstname, Lastname,Aliasname,Database,OUPath
Krishna, kumar,krishnakumar,server\storagegroup\store,Users

 

Below is the powershell script to create the mass mailbox by reading the csv file and and create the mailbox. First it take the password as input and reads the csv file and create the mailbox with the information in the csv file

 
$Password=Read-Host “Enter Password” -AsSecureString
Import-CSV C:\CreateNewmailbox.csv |
foreach {
$userprincipalname = $_.Firstname + “.” +  $_.Lastname + “@domain.com”
new-mailbox -name $_.name -alias $_.alias -FirstName $_.Firstname -LastName $_.Lastname -userPrincipalName  $userprincipalname -database $_.Database -OrganizationalUnit  $_.OUpath -Password $Password
}

Powershell to perform Messaging Tracking and Export the Messages details into CSV file

Powershell to perform Messaging Tracking and Export the export the Message details into CSV file

Get-MessageTrackingLog -Sender Krishna.k@domain.com -Start “6/1/09” -End “6/3/09” |select Sender,@{Name=”Recipients”;Expression={$_.recipients}},Recipients,MessageSubject,MessageId,Timestamp| Export-Csv MessagingTracking.csv

Above command can be used to result to the csv file. Multiple option for quering the Messagetrack logs is given below. Modify the query and export the result

Timestamp
ClientIp
ClientHostname
ServerIp
ServerHostname
SourceContext
ConnectorId
Source
EventId
InternalMessageId
MessageId
Recipients
RecipientStatus
TotalBytes
RecipientCount
RelatedRecipientAddress
Reference
MessageSubject
Sender
ReturnPath
MessageInfo