|
|
|||||||
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 :-) |
||||||||
|
|
|||||||
Did you copy the template example from the post you linked to or not? |
||||||||
|
|
|||||||
Yep! I created an HTM file according to the template example and put it in the folder with the INI file |
||||||||
|
|
|||||||
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 This, aside from defining the template and config file, is the only customization that should be needed. Glenn |
||||||||
|
|
|||||||
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? |
||||||||
|
|
|||||||
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 as Office: 201-555-1234 Cell: 201-555-9874 only 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 |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
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 defined Code: [NAME] WThornton=Billy Bob Thornton JSmith=Juli Smythe 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 |
||||||||
|
|
|||||||
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=Jerusalem And 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. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
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 Hebrew i 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?? |
||||||||
|
|
|||||||
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. |
||||||||
|
|
|||||||
Originally Posted By: ChristopheM 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. I used the this script from the forum Scrip Vault. When i have tried to replace it to $UserID i get error about it. |
||||||||
|
|
|||||||
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 |
||||||||
|
|
|||||||
Originally Posted By: ddady When 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. |
||||||||
|
|
|||||||
Originally Posted By: CitrixMan Originally Posted By: ddady When 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. |
||||||||
|
|
|||||||
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? |