#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: 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
|
|
|
|
#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
|
|
|
|
#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
|
|
|
|
#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: 4396
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:$NewName = ReadProfileString('path\to\translate.ini', 'NAME', $UserID) ; read name translation
$Name = IIf($NewName, $NewName, $Name) ; replace Name if NewName is defined The INI file would look like this:[NAME]
WThornton=Billy Bob Thornton
JSmith=Juli Smythe Basically, 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:
$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:
[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.
|
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:
[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:
; 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
|
|
|
|
#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
|
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.
|
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
|
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.
|
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
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 248 anonymous users online.
|
|
|