How to use ULSViewer for SharePoint 2010

ULSviewer.exe is the perfect tool to monitor ULS logs. By applying filters on the ULS logs you can view the error that has occurred.

ULSViewer.exe can be downloaded at http://archive.msdn.microsoft.com/ULSViewer

In this blog I show a way to identifiy correlation ID’s

Open ULSViewer

image

Click on ‘File -> Open From –> ULS

image

Select the location where you store ULS Logs

image

Press on the filter button

image

Enter the following information: ‘Correlation equals <Correlation ID>

image

You will then find the related information. You have to recreate the error so that it will be logged when you are filtering the realtime data.

image

This way you can identify the error and perhaps find the solution

If you post a question on technet it is recommended to add the results from the ULS logs so people can answer the question faster and better.

SharePoint Storage Manager – Storman.aspx

Storman.aspx was a feature in SharePoint installations but it was not implemented in the RTM version of SharePoint 2010. Service Pack 1 implements StorMan.aspx again for site collections.

StorMan.aspx can be used for the management of documents size and pagesize. You can see the pages and documents which require the most disk space in SharePoint 2010. Administrators can easily spot documents that require high disk space.

You can find StorMan.aspx under ‘Site Settings –> Storage Metrics’

 image

image

It is possible that you won’t see any changes when you view it for the first time. The information will be visible when you have browsed a few pages, otherwise you can re-open internet explorer.

Send Email with images in PowerShell

Last week we had to send 200 mails using a CSV file. I have created a script that reads the information from the CSV file and add it in the mail.  In this blog I stripped the script down to a minimum.

It may look like a large script but it is possible to combine the commands.

<#
.SYNOPSIS
This function sends mail that can be included with an image
.DESCRIPTION
Use this script to easily send multiple mails to customers using powershell and use an HTML layout.
.NOTES
if you want to add more images you can copy/paste the embed image and assign a new variable and ID
.LINK
http://www.maartenpeeters.nl
#>
function SendMail
{
#Mail Variables
$EmailFrom = “NoReply@maartenpeeters.nl”
$EmailSubject = “Email including images in HTML”
$smtpServer = “<SMTP Server>”
$SendTo = “<SendToMail>”
$Image = “C:\scripts\MailScript\TestImage.png”

#Embed Image
$att1 = new-object Net.Mail.Attachment($Image)
$att1.ContentType.MediaType = “image/png”
$att1.ContentId = “Attachment”

#More information on Mailmessage on http://technet.microsoft.com/en-us/library/dd347693.aspx
$mailmessage = New-Object system.net.mail.mailmessage

#Add attachment to the mail
$mailmessage.Attachments.Add($att1)

#Mail body
$body = “<p style=’font-family: Calibri, sans-serif’>
<img src=’cid:Attachment’ /><br />
This is a demonstration mail.
</p>”

#Mail info
$mailmessage.from = $emailfrom
$mailmessage.To.add($sendto)
$mailmessage.Subject = $emailsubject
$mailmessage.Body = $body
$mailmessage.IsBodyHTML = $true
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 25)
$SMTPClient.Send($mailmessage)

#Dispose attachments
$att1.dispose()

}
SendMail

 

Any comments or improvements on this script are welcome.

 

Result:

image