shopify traffic stats

If you’re running Exchange 2010 and you need to export just contacts to individual .PST files then I have 2 scripts you can run via the Exchange Management Shell.

If you need to export all contacts from the Domain then the command below will do that for ya:

foreach ($i in (Get-Mailbox)) { New-MailboxExportRequest -Mailbox $i -FilePath “\\localhost\pst\$($i.Alias).pst” -IncludeFolders “#Contacts#” -ExcludeDumpster}

If you just want to export individual user contacts then use the command below:

New-MailboxExportRequest -Mailbox user1 -IncludeFolders “#Contacts#” -ExcludeDumpster -filepath \\server\share\user1.pst

New-MailboxExportRequest -Mailbox user2 -IncludeFolders “#Contacts#” -ExcludeDumpster -filepath \\server\share\user2.pst

New-MailboxExportRequest -Mailbox user3 -IncludeFolders “#Contacts#” -ExcludeDumpster -filepath \\server\share\user3.pst

You can schedule these commands too.  Save the commands above to a .ps1 file (like export-contacts.ps1) and then call the .ps1 via a batch file.  Here is a sample batch file (I called mine launcher.bat)

PowerShell.exe -command “. ‘C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1’; Connect-ExchangeServer -auto; c:\export-contacts\export-contacts.ps1”

Use the Windows task scheduler to run the launcher.bat at whatever time you desire.

Share This
%d bloggers like this: