You are not logged in. [Log In] KiXtart.org website » Forums » KiXtart » Basic Scripting » Dynamic Outlook Signature from the Script Vault Register User       Forum List       Calendar       FAQ
 Page 1 of 1 1
 Topic Options
 #201381 - 2011-01-13 03:40 PM Dynamic Outlook Signature from the Script Vault ddady Getting the hang of it Registered: 2006-09-03 Posts: 98 I recieve the following message:  Code:Error opening template file: The system cannot find the path specified.Link to the post here Hope somone will know what i did wrong :-) Top
 #201383 - 2011-01-13 03:51 PM Re: Dynamic Outlook Signature from the Script Vault [Re: ddady] Mart KiX Supporter Registered: 2002-03-27 Posts: 4636 Loc: The Netherlands Did you copy the template example from the post you linked to or not? _________________________ Mart- Chuck Norris once sold ebay to ebay on ebay. Top
 #201384 - 2011-01-13 03:56 PM Re: Dynamic Outlook Signature from the Script Vault [Re: Mart] ddady Getting the hang of it Registered: 2006-09-03 Posts: 98 Yep!I created an HTM file according to the template example and put it in the folder with the INI file Top
 #201385 - 2011-01-13 05:10 PM Re: Dynamic Outlook Signature from the Script Vault [Re: ddady] Glenn Barnas KiX Supporter Registered: 2003-01-28 Posts: 4256 Loc: New Jersey Check the definition of $RootPath. It should point to the server\share where your script, config, and template files exist.In the vault example, there are two declarations, one that points to the real location and a second that points to the current folder, used for debugging. Code:$RootPath = '\\lgfileserver1\libgo\EMailSigs\' ; ====================================================================== $RootPath = '.\' ; for debugging You need to edit the first one to point to your network location and comment out the second one.This, aside from defining the template and config file, is the only customization that should be needed.Glenn _________________________ Actually I am a Rocket Scientist! Top  #201386 - 2011-01-13 08:12 PM Re: Dynamic Outlook Signature from the Script Vault [Re: Glenn Barnas] ddady Getting the hang of it Registered: 2006-09-03 Posts: 98 Thanks Glenn,That was the problem, i should've comment out the second one :-)It works perfectly.Now, two more questions.1)Is there a way to force this signature to be the default one?2)Where i do the changes in order to arrange the signature structure? Top  #201393 - 2011-01-14 06:14 PM Re: Dynamic Outlook Signature from the Script Vault [Re: ddady] Glenn Barnas KiX Supporter Registered: 2003-01-28 Posts: 4256 Loc: New Jersey The set the default sig, look at the OutlookSignature UDF - the latest version is on my web site in the Kixtart Functions section. You can either use the Set Default logic or modify the script to use this function.As for the signature structure, just move things around in the BODY section of the template file. Lines that have replacement macros for which there is no data are ignored, so something like "Cell: &CELLPHONE&" would display only if the user's AD account had a cell # defined. Further - Office: &Phone&Cell: &CellPhone&would display asOffice: 201-555-1234 Cell: 201-555-9874only if both the phone and cellphone values were defined, otherwise the word "Cell:" and the cell # would not display. Point is - you need to thing about how you want data to display, and what fields (and descriptions) might be optional.FYI - we have a commercial version available for$50 that includes a management GUI. We've deployed that product at several sites with as few as 10 users to over 5000, with unique signatures for each of over 400 departments. PM me for details if you are interested.Glenn _________________________ Actually I am a Rocket Scientist! Top
 #201397 - 2011-01-16 12:56 PM Re: Dynamic Outlook Signature from the Script Vault [Re: Glenn Barnas] ddady Getting the hang of it Registered: 2006-09-03 Posts: 98 Thanks Glenn,I have a new problem which i don't think can be solve.Our main language is Hebrew.I have managed to add the "RTL" in the html which moves everything to rhe right, but all the details are in English in the AD.I have put for an example the CITY detail in Hebrew but i get in the signature not good even though i have put the Hebrew code in the html.The only way i can think of that will solve that problem, is creating a Excel or any text file that will hold every user information in Hebrew.When a user will login the script will go to the excel file and will retreview the data from it.If such a thing can be done, or any other solution, i will be glad to get some guidance. Top
 #201398 - 2011-01-16 01:59 PM Re: Dynamic Outlook Signature from the Script Vault [Re: ddady] Glenn Barnas KiX Supporter Registered: 2003-01-28 Posts: 4256 Loc: New Jersey Using Excel will significantly complicate your script. Consider an INI file to translate key fields, since INI processing is built-in to Kix. For example: Code:$NewName = ReadProfileString('path\to\translate.ini', 'NAME',$UserID) ; read name translation $Name = IIf($NewName, $NewName,$Name) ; replace Name if NewName is definedThe INI file would look like this: Code:[NAME] WThornton=Billy Bob Thornton JSmith=Juli SmytheBasically, right after you gather all of the data from AD, you use the UserID to replace selected fields from the lookup table. The table has sections for all critical data such as name, address, city, etc. You can likely do direct translations of City to NewCity to reduce the number of replacements, but user name replacements should be done on a userID to User Name basis to account for duplicates.Using the IIF only replaces the AD data if replacement data exists.Note that using INI file lookups during login can significantly impact login time over WAN connections, so keep the number of reads minimal. You might use a CSV record - UserID=name,address... - so only one read is required. Use the CSV UDF to break it into an array and use the IIF to replace specific fields. This method requires a full set of replacement data for every user but results in faster performance.Glenn _________________________ Actually I am a Rocket Scientist! Top
 #201399 - 2011-01-16 07:07 PM Re: Dynamic Outlook Signature from the Script Vault [Re: Glenn Barnas] ddady Getting the hang of it Registered: 2006-09-03 Posts: 98 So basically if i understood correct, the code will look something like this: Code:$NewName = ReadProfileString ('path\to\translate.ini', 'NAME',$UserID) $NewCity = ReadProfileString ('path\to\translate.ini', 'CITY',$UserID)and so on for every detail...And the INI file will look like this: Code:[NAME] JDavid=James David CTony=Cool Tony [CITY] JDavid=Tel-Aviv CTony=JerusalemAnd so on with the rest of the details...I didn't quite understand the IIF code line.I understand what it does but that only in a case where there is no data at the required field, correct?If that so, i only have to make sure that all the necessary fields in the AD are filled. Top
 #201400 - 2011-01-16 10:19 PM Re: Dynamic Outlook Signature from the Script Vault [Re: ddady] Glenn Barnas KiX Supporter Registered: 2003-01-28 Posts: 4256 Loc: New Jersey Yup - the IIF basically says "if there is NEW data, use it, otherwise use the original AD data. This way, you only have to define what needs to be changed in the INI file.Glenn _________________________ Actually I am a Rocket Scientist! Top
 #201443 - 2011-01-25 08:29 AM Re: Dynamic Outlook Signature from the Script Vault [Re: Glenn Barnas] ddady Getting the hang of it Registered: 2006-09-03 Posts: 98 Sorry for my late response.I have created a new INI file (translate.ini) and just for the test i put this code in it: Code:[NAME] dady=Full Name name in Hebrew [CITY] dady=City name in Hebrewi re-configured the kix file for the test, only 2 lines, i left the rest intact: Code:; Get the remaining user info $sName = ReadProfileString ("\\crystal\netlogon\sig\translate.ini", "NAME",$UserDN) $sCity = ReadProfileString ("\\crystal\netlogon\sig\translate.ini", "CITY",$UserDN)When i run the script i get nothing. I see the the signature file is created but it's empty.What am i doing wrong?? Top
 #201444 - 2011-01-25 12:56 PM Re: Dynamic Outlook Signature from the Script Vault [Re: ddady] ChristopheM Hey THIS is FUN Registered: 2002-05-13 Posts: 304 Loc: STRASBOURG, France what contains $UserDN ? may be you can use @UserID instead of$userDN.userDN seems to be u user distinguished name and the classical form is CN=xxxx, OU=xxxx, dc=xxxx, dc=xxxx this is not the form of the keyword in you ini file. _________________________ Christophe Top
 #201445 - 2011-01-25 01:08 PM Re: Dynamic Outlook Signature from the Script Vault [Re: ChristopheM] ddady Getting the hang of it Registered: 2006-09-03 Posts: 98 Originally Posted By: ChristopheMwhat contains $UserDN ? may be you can use @UserID instead of$userDN.userDN seems to be u user distinguished name and the classical form is CN=xxxx, OU=xxxx, dc=xxxx, dc=xxxx this is not the form of the keyword in you ini file. I used the this script from the forum Scrip Vault. When i have tried to replace it to $UserID i get error about it. Top  #201446 - 2011-01-25 06:00 PM Re: Dynamic Outlook Signature from the Script Vault [Re: ddady] Glenn Barnas KiX Supporter Registered: 2003-01-28 Posts: 4256 Loc: New Jersey Please read the entire article and not just the script. The information describes the logic of the script to (hopefully) make it easier to modify.ChristopheM is correct -$UserDN is the LDAP DN String, not a user ID. You cannot simply replace a "ADSIUserInfo($UserDN, 'ObjectID')" function call with a ReadProfileString() function. I would allow the script to complete the creation of the variables from the many ADSIUserInfo() calls, and THEN use the various values to determine IF a replacement value exists, then use it (my earlier IIF() example). Also, creating a lookup of values by userid creates many duplicates. Use a single "REPLACEMENTS" section so you only list things like City, State(Region) and names once.Glenn _________________________ Actually I am a Rocket Scientist! Top  #201447 - 2011-01-25 10:17 PM Re: Dynamic Outlook Signature from the Script Vault [Re: ddady] ShaneEP MM club member Registered: 2002-11-29 Posts: 2071 Loc: Tulsa, OK Originally Posted By: ddadyWhen i have tried to replace it to$UserID i get error about it.I think he was referring to @UserID (built in kix macro,@ not $), and not a variable$UserID. Edited by CitrixMan (2011-01-25 10:17 PM) Top
 #201448 - 2011-01-26 09:58 AM Re: Dynamic Outlook Signature from the Script Vault [Re: ShaneEP] ddady Getting the hang of it Registered: 2006-09-03 Posts: 98 Originally Posted By: CitrixMan Originally Posted By: ddadyWhen i have tried to replace it to $UserID i get error about it.I think he was referring to @UserID (built in kix macro,@ not$), and not a variable \$UserID. That's correct :-)Any how, i have found a solution to my problem.I use the Full name as a parameter in my INI file.I prefer to use the @UserID macro since the user name is unique.If anyone can direct me how to do it, i will be most appreciate. Top
 #201449 - 2011-01-27 02:54 PM Re: Dynamic Outlook Signature from the Script Vault [Re: ddady] ddady Getting the hang of it Registered: 2006-09-03 Posts: 98 OK, i mange to work it out with the @UserID macro.Now my last question regarding this matter is:Let say for an example users have their own signatures which they made by themselves.Is there a way i can force the signature from the script to be the default one? Top
 Page 1 of 1 1

Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Arend_, Mart
 Hop to: KiXtart ------   Kixforms   KiXtart FAQ & How to's   Basic Scripting   Advanced Scripting   COM Scripting   Suggestions   BetaRepository ------   KiXtart Learning
 Shout Box
 Who's Online 0 registered and 189 anonymous users online.
 Newest Members Steff, phanhuyen, Jeroen_Ruijter, Tienn, tmvngocdung42 17545 Registered Users

Generated in 0.152 seconds in which 0.058 seconds were spent on a total of 13 queries. Zlib compression enabled.

 Search the board with: superb Board Search or try with google: Web kixtart.org