Hi all,

I have inherited ownership of a Kix login script on our work domain, and need to make some slight modifications.

This is the current script for the Outlook signature section

 Quote:
;Set outlook email signature
;

? " "
? "SET EMAIL SIGNATURE"
? " "
$appData = ExpandEnviromentVars(%appdata%)
DEL $appData + "\Microsoft\Signatures\AD Signature.*" /c /f

$objSysInfo = CreateObject("ADSystemInfo")
$strUser = $objSysInfo.UserName
$objUser = GetObject("LDAP://" + $strUser)
$strName = $objUser.FullName
$strTitle = $objUser.Title
$strDepartment = $objUser.Department
$strCompany = $objUser.Company
$strPhone = $objUser.telephoneNumber
$strMail = $objUser.mail
$strMobile = $objUser.mobile
$strFax = $objUser.facsimileTelephoneNumber
$strPost = $objUser.postalCode
$strStreet = $objUser.streetAddress
$strStreet = REPLACE($strStreet, CHR(10), " ")
$strStreet = REPLACE($strStreet, CHR(11), " ")
$strStreet = REPLACE($strStreet, CHR(12), " ")
$strStreet = REPLACE($strStreet, CHR(13), " ")
$strCity = $objUser.l
$strOffice = $objUser.physicalDeliveryOfficeName
$strWebsite = $objUser.wWWHomePage
$strAddress = $strStreet + " " + $strCity + " " + $strPost

$objWord = CreateObject("Word.Application")

$objDoc = $objWord.Documents.Add()
$objSelection = $objWord.Selection

$objEmailOptions = $objWord.EmailOptions
$objSignatureObject = $objEmailOptions.EmailSignature
$objSignatureEntries = $objSignatureObject.EmailSignatureEntries

$objSelection.Font.Name = "Arial"
$objSelection.Font.Size = "9"
$objSelection.Font.Bold = "1"
$objSelection.Font.Color = "6710886"
$objSelection.TypeText($strName)
$objSelection.TypeText(Chr(11))
$objSelection.TypeText($strTitle)
$objSelection.Font.Size = "8"
$objSelection.TypeText(Chr(11))
$objSelection.TypeText(Chr(11))
$objSelection.TypeText($strCompany)
$objSelection.TypeText(Chr(11))
$objSelection.Font.Bold = "0"
$objSelection.TypeText($strAddress)
$objSelection.TypeText(Chr(11))
if $strPhone <> ""
$objSelection.TypeText("T: " + $strPhone)
$objSelection.TypeText(Chr(11))
endif
if $strMobile <> ""
$objSelection.TypeText("M: " + $strmobile)
$objSelection.TypeText(Chr(11))
endif
if $strWebsite <> ""
$objSelection.TypeText("W: " + $strWebsite)
endif

$objSelection = $objDoc.Range()

$objSignature=$objSignatureEntries.Add("AD Signature", $objSelection)
$objSignatureObject.NewMessageSignature = "AD Signature"
$objSignatureObject.ReplyMessageSignature = "AD Signature"

$objDoc.Saved = 1
$objWord.Quit


I have two additions I need to make

1. If a user is in a certain AD container or group (e.g. IT), I want the script to only input the users NAME and job title, and then some set text that is to be defined in the script.

2. As you can see from the script, it sets the created signature as both the New and Reply signature. I need the script to set a Reply signature that includes only the Users name and job title.

Is the above possible?

Any help is greatly appreciated

Thanks