Scribblings of a TechnoBuff

Exchange IIS ASP.NET OCS Sharepoint Windows

Archive for August, 2009

Set up Outlook signature with logo, hyperlink and Active Directory information

Posted by Sujeeth on August 21, 2009

I prefer to use Notepad++ for writing scripts like these as it has good syntax highlighting. Create a vbscript file as outlook_signature.vbs

Store this file in a network share accessible by everyone. Get the company logo in a jpg format and store it in the same network share. You could use NETLOGON folder for which all users will have read access.

The following script will work for Outlook 2003 and above. Please note that if you are using Outlook 2000, the script needs to be changed.

———————-
On
Error Resume Next

Set objSysInfo = CreateObject(“ADSystemInfo”)
strUser = objSysInfo.UserName

Set
objUser = GetObject(“LDAP://” & strUser)

strName = objUser.FullName
strTitle = objUser.Title

’strDepartment = objUser.Department

’strCompany = objUser.Company

’strPhone = objUser.telephoneNumber

Set objWord = CreateObject(“Word.Application”)
Set
objDoc = objWord.Documents.Add()
Set
objSelection = objWord.Selection
objSelection.Style =
“No Spacing”
Set
objEmailOptions = objWord.EmailOptions
Set
objSignatureObject = objEmailOptions.EmailSignature
Set
objSignatureEntries = objSignatureObject.EmailSignatureEntries

‘Name of Staff
objSelection.Font.Name =
“Calibri”
objSelection.Font.Bold =
True
objSelection.Font.Size =
“12″
objSelection.Font.Color = RGB(
15,36,62)

objSelection.TypeText strName

objSelection.TypeText(Chr(
11))

‘Role of Staff
objSelection.Font.Name =
“Calibri”
objSelection.Font.Bold =
False
objSelection.Font.Size =
“11″
objSelection.Font.Color =
0

objSelection.TypeText strTitle

objSelection.TypeText(Chr(
11))

‘Company Logo (stored in network share accessed by everyone)
objSelection.InlineShapes.AddPicture(
“\\servername\netlogon\signature.jpg”)

objSelection.TypeParagraph()

‘Company Contact details
objSelection.Font.Color = RGB(
38,38,38)
objSelection.TypeText
“Tel +44 (0) 744 525 5214″
objSelection.TypeText(Chr(
11))
objSelection.TypeText
“Fax +44 (0) 744 524 2244″
objSelection.TypeText(Chr(
11))
objSelection.Font.Color = RGB(
23,54,93)
objLink = objSelection.Hyperlinks.Add(objSelection.Range,
“http://www.sujeeth.net/”,,“Sujeeth Home Page”,“www.sujeeth.net”)

objSelection.TypeParagraph()

objSelection.TypeParagraph()

‘environment message
objSelection.Font.Name =
“Webdings”
objSelection.Font.Size =
“14″
objSelection.Font.Color = RGB(
115,155,63)
objSelection.TypeText
“P “
objSelection.Font.Name =
“Calibri”
objSelection.Font.Size =
“9″
objSelection.TypeText
“Please consider the environment before printing this e-mail.”

Set objSelection = objDoc.Range()

objSignatureEntries.Add “Standard Signature”, objSelection
objSignatureObject.NewMessageSignature =
“Standard Signature”
objSignatureObject.ReplyMessageSignature =
“Standard Signature”

objDoc.Saved = True
objWord.Quit

———————-

You can download the above script from pastebin

After you save the script in the network share, you can call this file from users’ Logon script or directly on the user machine using cscript

cscript \\servername\netlogon\outlook_signature.vbs

Once you run the script, check your Outlook if it has been properly setup. When you open a new email message, the signature should automatically append.

The signature files are usually stored in Application Data\Microsoft\Signatures folder

If you get problems with line spacing, use vbNewline instead of Chr(11)

You can check for Outlook 2000 version as following.

set outlook = createobject(“outlook.application”)

If outlook.version = “9.0.0.2711″ or outlook.version = “9.0.0.3011″ or outlook.version = “9.0.0.3821″ or outlook.version = “9.0.0.4105″ or outlook.version = “9.0.0.4201″
or outlook.version = “9.0.0.4527″ or outlook.version = “9.0.0.5414″ Then
Outlook2000 =
True
End
If

Posted in Active Directory, Office 2007, Outlook | Tagged: , | 4 Comments »

Use Remote SMTP server for MOSS Incoming e-mail settings

Posted by Sujeeth on August 19, 2009

If Microsoft Office Sharepoint Server is installed on a server that doesn’t have a local SMTP server or you could not install SMTP service becuase Exchange 2007 runs on the same server, you could use the remote SMTP server as follows:

First find the account that Windows SharePoint Services Timer runs under.

Then login to the remote SMTP server (a local server that’s part of the same domain as your MOSS server)

I assume you have already installed SMTP service on the remote computer. Browse to the default SMTP mail directory (usually C:\Inetpub\mailroot) and setup a share for the mailroot folder called MossMailRoot


Add the service account (uk\sharepoint) for the mailroot folder with full permissions.

Now open Central Administration à Operations page on your MOSS server

Open Incoming e-mail settings and set E-mail Server Display address as sharepoint.local and the E-mail drop folder as \\<servername>\<sharename>\Drop

You need to update your DNS server records to point sharepoint.local to the remote SMTP server

On the Remote server, Open IIS console and drill down to Default SMTP Virtual Server. Add new Alias domain for sharepoint.local

The server setup is complete. Now browse to your Intranet page and setup Incoming E-Mail Settings for one of the libraries.

Now When the users send an email from their Outlook client to announcements@sharepoint.local the email will be received by your Exchange. Assuming you have Exchange 2007, you need to configure a Send Connector so that Exchange knows where to forward that email.

The Send Connector will have the following configuration

Once this send connector is configured, Exchange 2007 will forward all emails with sharepoint.local domain to the remote SMTP server. The email will be stored in the Drop folder.

The Windows SharePoint Services Timer service monitors this folder at regular intervals as the network path is given in its configuration. If it finds any emails, it will check for the recipient email address and routes the email to appropriate Sharepoint library. After that it deletes the email message from the Drop folder. That’s why you need to give modify permissions for the service account on the mailroot folder.

Posted in Exchange, Sharepoint | Tagged: , , | 1 Comment »