Monthly Archives: February 2012

C#.NET – List all mailboxes

C#.NET – List all mailboxes

Since I promised to put the source code and the application here on the blog, so here it is.

The source code can be downloaded here.

It’s not any kind of advanced application, it lists all mailboxes in the environment it’s connected to.
The connection is done by using Remote PowerShell and can be configured in the Settings tab.

The importance to get the application working is to have Remote PowerShell configured for the connecting user.
And don’t forget if you’re using HTTPS the certificate names needs to be in place, or else it won’t work.

Feel free to use the code and customize it.
Just notify me or have a link the my blog.

There is a barrier before getting started and really learn and understand C#.Net so I want to thank Peter Ericsson, Martin Sundström and Mike Pfeiffer for some kind tips and tricks.
(Press their names for being redirected to their blogs.)

Thanks for your help

Exchange 2010 SP2 Update Rollup 1 is released

Exchange 2010 SP2 Update Rollup 1 is released

Yesterday Microsoft announced on their Exchange Team blog (URL: http://bit.ly/ynvrHT) that Update Rollup 1 has been released for Exchange 2010 SP2.

 

Read about what the update roll will fix:
http://support.microsoft.com/kb/2645995

Download link
http://www.microsoft.com/download/en/details.aspx?id=28809

Make sure you deploy this update into a test environment before deploying it into production!
If you’re looking for feedback, check in the comments field or go to the team blog link above and read the comments.
Leave feedback around the update in the comments field, thanks

 

Cheers

Search for PST files on clients

Search for PST files on clients

Wrote a basic PowerShell script that searches all computers listed in the clients.txt file.

Saving the pst files into the destination path.

For each computer, a folder is created with the corresponding computer name so that the PST files is collected per client.

Before the PST Capture Tool was released I wrote a post about “How to consolidate PST” files.
This script is just a little adjustment of that one.

Also have a look at the PST Capture Tool, it can be found here.

Anyway, feel free to use the script below and comment on it

#############################################################################
# Search.ps1
# Description:
# This PowerShell script searches for *.pst files on the clients listed in
# the clients.txt file (one hostname per row). Then saves them on the path specified
# in $SavePath, one folder per computer is created in the destionationpath.
#
# Jonas Andersson, MCC 2011
# http://www.testlabs.se/blog
# Twitter @jonand82
#############################################################################

$data = Get-Content .\clients.txt
$Date = Get-Date -Format yyyyMMddHHmm
$Log = "log_{0:yyyyMMdd-HHmm}.txt" -f (Get-Date)

#Writes to log file
Function WriteLog ([string] $sLogMsg) {
$sLogLine=(get-date).Tostring("yyyy-MM-dd-HHmm")+","+$sLogMsg
$sLogLine| out-file $log -noclobber -append
}

foreach ($row in $data)
{
WriteLog "Starting the search for PST files on $row."
$FindPath = "\\$row\c$"
$SavePath = "\\destionaionpath\pstshare"

$PSTFiles = Get-ChildItem -Path $FindPath -Recurse -Filter "*.pst"

if ($PSTFiles.count -eq $null) {
WriteLog "No PST files were found on computer $row."
}
else {
$PSTFiles | New-Item -path $SavePath -name $row -itemtype directory -force
$PSTFiles | Copy-Item -Destination "$SavePath\$row"
WriteLog "PST files was found and copied successfully on computer $row."
}
}

WriteLog "Script completed!"

Download link