Page 1 of 1 1
Topic Options
#122201 - 2004-07-06 11:58 AM Accessing users' other properties - Sig maker
maiike Offline
Fresh Scripter

Registered: 2002-11-27
Posts: 25
Loc: France
Hey all,

I've started using ADSI in my script to create a signature for Outlook and thus retrieving users' values from AD, thing is I can't get the properties I want (like Phone, Address...) All I can get is Description, FullName. Where could I find a reference containing all the properties of the objects ?

PS : I'm currently using this code :

$LDAP = "WinNT://"+@LDOMAIN+"/"+@USERID+",user"
$oUser = GetObject($LDAP)

$uname = $oUser.FullName

Maybe I should be using the LDAP Method...


A link I've found :

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/adsi/adsi/iadsuser.asp

For others' benefit hopefully


Thanks in advance

Michael



Edited by maiike (2004-07-20 04:35 PM)

Top
#122202 - 2004-07-06 12:28 PM Re: Accessing users' other properties
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
http://www.kixtart.org/ubbthreads/showflat.php?Cat=&Board=UBB1&Number=32606&Forum=All_Forums&Words=office%20adsi&Match=And&Searchpage=0&Limit=25&Old=allposts&Main=32595&Search=true#Post32606
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#122203 - 2004-07-06 12:45 PM Re: Accessing users' other properties
maiike Offline
Fresh Scripter

Registered: 2002-11-27
Posts: 25
Loc: France
Thanks for the quick answer
Top
#122204 - 2004-07-06 04:15 PM Re: Accessing users' other properties
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Maiike,

How are you actually creating the signatures? Pulling the info from AD I'm happy with, but wouldn't know how to go about creating the autosignature for each user - would like to do this, though, as one of the things management are getting quite hot on is the correct format of things like signatures, fax templates, letterheads, etc...

Please post your code/method when it is complete, for everyone's benefit, as you say. And mine, as well!
_________________________
================================================
Breaker


Top
#122205 - 2004-07-06 05:36 PM Re: Accessing users' other properties
maiike Offline
Fresh Scripter

Registered: 2002-11-27
Posts: 25
Loc: France
Well, well, it's harder than I thought it'd be...I want to automate the signature creation (that's not the hard part) just an html file where I pull my info from AD for each user but I can't find where to set it for Outlook to actually use the signature as a default one...I'll keep on working on my script and will post when effective.

Cheers

PS : after searching a lot of ressources it looks like it was indeed not that hard the key is here :

HKEY_USERS\Software\Microsoft\Office\10.0\Common\MailSettings

Look for NewSignature

Three files will be created an .htm a txt and an rtf

Michael -yourbirthdayboyfortoday


Edited by maiike (2004-07-07 09:58 AM)

Top
#122206 - 2004-07-06 06:06 PM Re: Accessing users' other properties
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Breaker,
You need to change your sig... someone gave you stars.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#122207 - 2004-07-07 04:58 PM Re: Accessing users' other properties
Breaker Offline
Hey THIS is FUN
*****

Registered: 2001-06-15
Posts: 268
Loc: Yorkshire, England
Les,

I'm as surprised as everyone else, believe me!

Yeah, I noticed that yesterday, but unlike with the old board I couldn't see who the culprit was!

I thought of changing the sig to "The Man With 5 Stars All Of A Sudden For No Explicable Reason", but it just doesn't have that same ring about it, does it?

Ah, well....
_________________________
================================================
Breaker


Top
#122208 - 2004-07-07 09:54 PM Re: Accessing users' other properties
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11625
Loc: CA
Okay Okay.... I broke down and gave you the stars.

Sorry, didn't mean to break your sig

Top
#122209 - 2004-07-12 02:48 PM Re: Accessing users' other properties
maiike Offline
Fresh Scripter

Registered: 2002-11-27
Posts: 25
Loc: France
For Breaker and everyone else in the world, I give you the signature maker :

The signatures are stored here :

$signature_location = "%appdata%/Microsoft/Signatures"


;**** Outlook Profile Creation ****

shell "%comspec% /c $tools\richprofile.exe @Lserver @UserID Exchange N D"



;**** Signature creation ****

$LDAP = "LDAP://CN=@FullName,OU=UsersOU,DC=domain,DC=lan"
$oUser = GetObject($LDAP)

$uname = $oUser.FullName
$udescription = $oUser.Description
$utitle = $oUser.Title
$ucompany = $oUser.Company
$uphone = $oUser.TelephoneNumber
$ufacsimile = $oUser.facsimileTelephoneNumber
$uaddress = $oUser.StreetAddress
$uzip = $oUser.PostalCode
$ucity = $oUser.l
$umobile = $oUser.Mobile
$uemail = $oUser.mail
$udepartment = $oUser.department
$uweb = $oUser.homepage

if exist ("$signature_location\$signaturefile.htm") = 0

copy "$logorepositery\$logo" "$signature_location"

if open(1,"$signature_location\$signaturefile.htm",5) = 0

$write = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">'+@CRLF
+'<HTML><HEAD><TITLE>Company Signature</TITLE>' +@CRLF
+'<META http-equiv=Content-Type content="text/html; charset=windows-1252">'+@CRLF
+'<META content="kix logon script" name=GENERATOR></HEAD>'+@CRLF
+'<BODY>'+@CRLF
+'&nbsp;'+@CRLF
+'<P><STRONG><FONT face=Arial size=2>'+$uname+'</FONT></STRONG><BR>'+@CRLF
+'<FONT face=Arial size=2><STRONG><BR></STRONG>$utitle</FONT></P>'+@CRLF
+'<DIV style="WIDTH: 160px; HEIGHT: 116px">&nbsp;'+@CRLF
+'<IMG height=77 src="$logo" width=125 border=0>'+@CRLF
+'<P><FONT face=Arial size=2><STRONG>$ucompany</STRONG></FONT></P></DIV>'+@CRLF
+'&nbsp;'+@CRLF
+'<DIV><FONT face=Arial size=2>$uaddress</FONT></DIV>'+@CRLF
+'<DIV><FONT face=Arial size=2>&nbsp;$uzip $ucity</FONT></DIV>'+@CRLF
+'<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>'+@CRLF
+'<DIV><FONT face=Arial size=2>Tél :&nbsp;&nbsp; &nbsp;$uphone</FONT></DIV>'+@CRLF
+'<DIV><FONT face=Arial size=2>Fax :&nbsp;&nbsp; $ufacsimile</FONT></DIV>'+@CRLF
+'<DIV><FONT face=Arial size=2>email : <A href="mailto:'+$uemail+'">'+$uemail+'</A></FONT></DIV>'+@CRLF
+'<DIV><FONT face=Arial size=2>web : <A href="http://'+$uweb+'">http://'+$uweb+'</A></FONT></DIV>'+@CRLF

$write=writeline(1,$write)

close(1)

endif

;Specify the signature as the default signature

("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common\MailSettings","NewSignature") > 0

WriteValue ("HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common\MailSettings","NewSignature","$signaturefile","REG_EXPAND_SZ")

;Outlook XP (Version 10.0)

endif


Edited by maiike (2004-07-12 03:05 PM)

Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 569 anonymous users online.
Newest Members
min_seow, Audio, Hoschi, Comet, rrosell
17881 Registered Users

Generated in 0.059 seconds in which 0.024 seconds were spent on a total of 12 queries. Zlib compression enabled.

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