#122201 - 2004-07-06 11:58 AM
Accessing users' other properties - Sig maker
|
maiike
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
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
|
Top
|
|
|
|
#122203 - 2004-07-06 12:45 PM
Re: Accessing users' other properties
|
maiike
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
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
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
|
|
|
|
#122208 - 2004-07-07 09:54 PM
Re: Accessing users' other properties
|
NTDOC
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
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
+' '+@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"> '+@CRLF
+'<IMG height=77 src="$logo" width=125 border=0>'+@CRLF
+'<P><FONT face=Arial size=2><STRONG>$ucompany</STRONG></FONT></P></DIV>'+@CRLF
+' '+@CRLF
+'<DIV><FONT face=Arial size=2>$uaddress</FONT></DIV>'+@CRLF
+'<DIV><FONT face=Arial size=2> $uzip $ucity</FONT></DIV>'+@CRLF
+'<DIV><FONT face=Arial size=2></FONT> </DIV>'+@CRLF
+'<DIV><FONT face=Arial size=2>Tél : $uphone</FONT></DIV>'+@CRLF
+'<DIV><FONT face=Arial size=2>Fax : $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
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 420 anonymous users online.
|
|
|