Accueil > > > SIGNATURE STANDARDISÉE DANS OUTLOOK VIA PARAMÈTRES ACTIVE DIRECTORY DE L'UTILISATEUR
SIGNATURE STANDARDISÉE DANS OUTLOOK VIA PARAMÈTRES ACTIVE DIRECTORY DE L'UTILISATEUR
Information sur la source
Description
Ecriture d'une signature pour Outlook (2002 et 2003 testés) afin que tous les utilisateur d'une même organisation Active Directory aient la même forme.
Source
- '---------------------------------------------------------------------------------------------------------
- 'Définition de la signature Outlook via paramètres utilisateur Active Directory
- '
- ' ### PREMIER SCRIPT ### LE SECOND SE TROUVE A LA FIN DE CELUI-CI ###
- '---------------------------------------------------------------------------------------------------------
- '
- '
- 'Définition des variables et vérification de l'existance du dossier ....\Microsoft\Signatures
- set netw=createobject("wscript.network")
- Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
- set oshell = createobject("wscript.shell")
- if not FileSystem.folderexists (oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures") then
- FileSystem.CreateFolder(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures")
- End If
- Set OutPutFileTxt = FileSystem.CreateTextFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\Ma_Signature.txt", True)
- Set OutPutFileHtml = FileSystem.CreateTextFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\Ma_Signature.htm", True)
- 'Suppression du fichier RTF si existant
- if FileSystem.fileexists (oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\Ma_Signature.rtf") then
- FileSystem.DeleteFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\Ma_Signature.rtf")
- End If
- 'Send START Message
- WScript.Echo "Creation signature Outlook en cours ... Veuillez patientez, s'il vous plait"
- 'Définition des OU Active Directory
- '
- '
- '
- '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- '!!!! xxxx = A définir suivant votre configuration AD !!!!!
- '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- '
- '
- '
- Set oContainer=GetObject("LDAP:// ou=xxxx,dc=xxxx,dc=xxxx,dc=com")
- EnumerateUsers oContainer
- '
- '
- '
- '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- '!!!! xxxx = A définir suivant votre configuration AD !!!!!
- '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
- '
- ' Si plusieurs OU de recherche
- '
- '
- ' Set oContainer=GetObject("LDAP:// ou=xxxx,dc=xxxx,dc=xxxx,dc=com")
- ' EnumerateUsers oContainer
- '
- '
- '
- '
- 'Message de fin de procédure sur Erreur
- WScript.Echo "Erreur: utilisateur inconnu ou mauvaise definition Active Directory ..."
- WScript.Quit(0)
- 'Sub Programme de recherche "EnumerateUsers"
- Sub EnumerateUsers(oCont)
- Dim oUser
- For Each oUser In oCont
- Select Case LCase(oUser.Class)
- Case "user"
- If oUser.sAMAccountName=netw.username Then
- 'Affichage des paramètres de l'utilisateur
- BtnCode = oshell.Popup("Nom: " & oUser.description & chr(13) & "Title: " &oUser.title & chr(13) & "Departement: " & oUser.department & chr(13) & "Adresse: " & oUser.postOfficeBox & ", " & oUser.streetAddress & ", " & oUser.postalCode & " " & oUser.l & chr(13) & "Phone: " & oUser.telephoneNumber & chr(13) & "Mobil: " & oUser.mobile & chr(13) & "Fax: " & oUser.facsimileTelephoneNumber & chr(13) & "Mail: " & oUser.mail & chr(13) & chr(13), 0, "Voulez-vous continuer: ?", 4 + 64)
- If BtnCode=6 then
- ' Création du fichier au format TXT
- OutPutFileTxt.WriteLine "Salutations / Best regards"
- OutPutFileTxt.WriteLine " "
- OutPutFileTxt.WriteLine oUser.description
- OutPutFileTxt.WriteLine "--"
- OutPutFileTxt.WriteLine oUser.title
- OutPutFileTxt.WriteLine oUser.department
- OutPutFileTxt.WriteLine oUser.postOfficeBox & ", " & oUser.streetAddress & ", " & oUser.postalCode & " " & oUser.l
- If Not IsEmpty(oUser.telephoneNumber) Then
- OutPutFileTxt.WriteLine "Phone " & oUser.telephoneNumber
- End If
- If Not IsEmpty(oUser.mobile) Then
- OutPutFileTxt.WriteLine "Mobile " & oUser.mobile
- End If
- If Not IsEmpty(oUser.facsimileTelephoneNumber) Then
- OutPutFileTxt.WriteLine "Fax " & oUser.facsimileTelephoneNumber
- End If
- OutPutFileTxt.WriteLine "Mailto:" & oUser.mail
- OutPutFileTxt.WriteLine "http://VotresiteWEB"
- OutPutFileTxt.Close
- 'Création du fichier au format HTML
- OutPutFileHtml.WriteLine "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">"
- OutPutFileHtml.WriteLine "<HTML><HEAD>"
- OutPutFileHtml.WriteLine "<META http-equiv=Content-Type content=""text/html; charset=windows-1252"">"
- OutPutFileHtml.WriteLine "<META content=""MSHTML 6.00.2800.1459"" name=GENERATOR></HEAD>"
- OutPutFileHtml.WriteLine "<BODY>"
- OutPutFileHtml.WriteLine "<DIV align=left>"
- OutPutFileHtml.WriteLine "<TABLE id=table1"
- OutPutFileHtml.WriteLine "style=""BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px"""
- OutPutFileHtml.WriteLine "height=194 width=500 border=1>"
- OutPutFileHtml.WriteLine " <TBODY>"
- OutPutFileHtml.WriteLine " <TR>"
- OutPutFileHtml.WriteLine " <TD"
- OutPutFileHtml.WriteLine " style=""BORDER-RIGHT: medium none; PADDING-RIGHT: 0px; BORDER-TOP: medium none; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; "
- OutPutFileHtml.WriteLine " BORDER-LEFT: medium none; PADDING-TOP: 0px; BORDER-BOTTOM: medium none"""
- OutPutFileHtml.WriteLine " vAlign=bottom><SPAN lang=fr><FONT face=Arial size=2>Salutations / Best regards<BR>"
- OutPutFileHtml.WriteLine "<BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.description & "</FONT><BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>--</FONT><BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.title & "</FONT><BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.department & "</FONT><BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.postOfficeBox & ", " & oUser.streetAddress & ", " & oUser.postalCode & " " & oUser.l & "</FONT><BR>"
- If Not IsEmpty(oUser.telephoneNumber) Then
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>Phone " & oUser.telephoneNumber & "</FONT><BR>"
- End If
- If Not IsEmpty(oUser.mobile) Then
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2><FONT face=Arial size=2>Mobile " & oUser.mobile & "</FONT><BR>"
- End If
- If Not IsEmpty(oUser.facsimileTelephoneNumber) Then
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>Fax " & oUser.facsimileTelephoneNumber & "</FONT><BR>"
- End If
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2><A href=""mailto:"
- OutPutFileHtml.WriteLine oUser.mail
- OutPutFileHtml.WriteLine """>mailto:" & oUser.mail & "</A></FONT><BR>"
- OutPutFileHtml.WriteLine " </SPAN><A href=""http://votresiteWEB""><SPAN"
- OutPutFileHtml.WriteLine " lang=fr><U><FONT face=Arial color=#0000ff"
- OutPutFileHtml.WriteLine " size=2>http://votresiteWEB</FONT></U></SPAN></A></P></TD>"
- OutPutFileHtml.WriteLine " </TR></TBODY></TABLE></DIV></BODY></HTML>"
- OutPutFileHtml.Close
- 'Message de FIN normale de la procédure
- WScript.Echo "Définition signature terminée"
- WScript.Quit(0)
- else
- 'Message de d'ABANDON de la procédure
- WScript.Echo "Procédure annulée"
- WScript.Quit(0)
- End If
- End If
- Case "organizationalunit", "container"
- EnumerateUsers oUser
- End Select
- Next
- End Sub
- '
- ' Fin de la première version
- '
-
-
-
- '########################################################################
- '# #
- '# Automatic Outlook Signature with LDAP Parameters #
- '# #
- '########################################################################
- '
- 'Find the current LDAP Name
- '
- '#############################
- Set oRootDSE = GetObject("LDAP://RootDSE")
- Set oShell = WScript.CreateObject("WScript.Shell")
- sUserName = oShell.Environment("PROCESS").Item("username")
- Const ADS_PROPERTY_CLEAR = 1
- Const ADS_NAME_INITTYPE_GC = 3
- Const ADS_NAME_TYPE_NT4 = 3
- Const ADS_NAME_TYPE_1779 = 1
- strDNSDomain = oRootDSE.Get("defaultNamingContext")
- Set objTrans = CreateObject("NameTranslate")
- objTrans.Init ADS_NAME_INITTYPE_GC, ""
- objTrans.Set ADS_NAME_TYPE_1779, strDNSDomain
- strNetBIOSDomain = objTrans.Get(ADS_NAME_TYPE_NT4)
- strNetBIOSDomain = Left(strNetBIOSDomain, Len(strNetBIOSDomain) - 1)
- strUserNTName = Trim(LogonAccount)
- objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain & "\" & strUserNTName
- If Err.Number <> 0 Then
- On Error GoTo 0
- Wscript.Echo "ERROR: Login not found in Active Directory: " & strUserNTName
- Else
- On Error GoTo 0
- strUserDN = objTrans.Get(ADS_NAME_TYPE_1779)
- LDAP_Name = "LDAP://" & strUserDN
- End If
- '#############################
- '
- 'Find the current User in this LDAP
- '
- '#############################
- On error resume next
- Set objConnection = CreateObject("ADODB.Connection")
- objConnection.Open "Provider=ADsDSOObject;"
- Set objCommand = CreateObject("ADODB.Command")
- objCommand.ActiveConnection = objConnection
- objCommand.CommandText = "SELECT adspath FROM '" & LDAP_Name & "' WHERE objectCategory='user' AND sAMAccountName='" & sUserName & "'"
- Set objRecordSet = objCommand.Execute
- if (objRecordset.Fields("adspath") <> "") then
- GetAdsPath = objRecordset.Fields("adspath")
- end if
- objConnection.Close
- LDAP_Path_User = GetAdsPath
- '#############################
- '
- 'Wrtite files for this Outlook Signature
- '
- '#############################
- Set oUser=GetObject(LDAP_Path_User)
- Set oShell = WScript.CreateObject("WScript.Shell")
- Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
- if not FileSystem.folderexists (oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures") then
- FileSystem.CreateFolder(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures")
- End If
- Set OutPutFileTxt = FileSystem.CreateTextFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\efqm.txt", True)
- Set OutPutFileHtml = FileSystem.CreateTextFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\efqm.htm", True)
- if FileSystem.fileexists (oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\efqm.rtf") then
- FileSystem.DeleteFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\efqm.rtf")
- End If
- '=============================
- 'File with extension .TXT
- '=============================
- OutPutFileTxt.WriteLine " "
- OutPutFileTxt.WriteLine "Salutations / Best regards"
- OutPutFileTxt.WriteLine " "
- OutPutFileTxt.WriteLine oUser.description
- OutPutFileTxt.WriteLine "--"
- OutPutFileTxt.WriteLine oUser.company
- OutPutFileTxt.WriteLine oUser.title
- OutPutFileTxt.WriteLine oUser.department
- OutPutFileTxt.WriteLine oUser.postOfficeBox & ", " & oUser.streetAddress & ", " & oUser.postalCode & " " & oUser.l
- If Not IsEmpty(oUser.telephoneNumber) Then
- OutPutFileTxt.WriteLine "Phone " & oUser.telephoneNumber
- End If
- If Not IsEmpty(oUser.mobile) Then
- OutPutFileTxt.WriteLine "Mobile " & oUser.mobile
- End If
- If Not IsEmpty(oUser.facsimileTelephoneNumber) Then
- OutPutFileTxt.WriteLine "Fax " & oUser.facsimileTelephoneNumber
- End If
- OutPutFileTxt.WriteLine "Mailto:" & oUser.mail
- '
- '
- 'Put your WEB Site instead of www.xxxxxxxxx.com
- '
- '
- OutPutFileTxt.WriteLine "http://www.xxxxxxxxx.com.com"
- OutPutFileTxt.Close
- '=============================
- 'File with extension .HTM
- '=============================
- OutPutFileHtml.WriteLine "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">"
- OutPutFileHtml.WriteLine "<HTML><HEAD>"
- OutPutFileHtml.WriteLine "<META http-equiv=Content-Type content=""text/html; charset=windows-1252"">"
- OutPutFileHtml.WriteLine "<META content=""MSHTML 6.00.2800.1459"" name=GENERATOR></HEAD>"
- OutPutFileHtml.WriteLine "<BODY>"
- OutPutFileHtml.WriteLine "<DIV align=left>"
- OutPutFileHtml.WriteLine "<TABLE id=table1"
- OutPutFileHtml.WriteLine "style=""BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px"""
- OutPutFileHtml.WriteLine "height=194 width=500 border=1>"
- OutPutFileHtml.WriteLine " <TBODY>"
- OutPutFileHtml.WriteLine " <TR>"
- OutPutFileHtml.WriteLine " <TD"
- OutPutFileHtml.WriteLine " style=""BORDER-RIGHT: medium none; PADDING-RIGHT: 0px; BORDER-TOP: medium none; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; "
- OutPutFileHtml.WriteLine " BORDER-LEFT: medium none; PADDING-TOP: 0px; BORDER-BOTTOM: medium none"""
- OutPutFileHtml.WriteLine " vAlign=bottom><SPAN lang=fr>"
- OutPutFileHtml.WriteLine "<BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>Salutations / Best regards<BR>"
- OutPutFileHtml.WriteLine "<BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.description & "</FONT><BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>--</FONT><BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.company & "</FONT><BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.title & "</FONT><BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.department & "</FONT><BR>"
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.postOfficeBox & ", " & oUser.streetAddress & ", " & oUser.postalCode & " " & oUser.l & "</FONT><BR>"
- If Not IsEmpty(oUser.telephoneNumber) Then
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>Phone " & oUser.telephoneNumber & "</FONT><BR>"
- End If
- If Not IsEmpty(oUser.mobile) Then
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2><FONT face=Arial size=2>Mobile " & oUser.mobile & "</FONT><BR>"
- End If
- If Not IsEmpty(oUser.facsimileTelephoneNumber) Then
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2>Fax " & oUser.facsimileTelephoneNumber & "</FONT><BR>"
- End If
- OutPutFileHtml.WriteLine "<FONT face=Arial size=2><A href=""mailto:"
- OutPutFileHtml.WriteLine oUser.mail
- OutPutFileHtml.WriteLine """>mailto:" & oUser.mail & "</A></FONT><BR>"
- '
- '
- 'Put your WEB Site instead of www.xxxxxxxxx.com (twice)
- '
- '
- OutPutFileHtml.WriteLine " </SPAN><A href=""http://www.xxxxxxxxx.com""><SPAN"
- OutPutFileHtml.WriteLine " lang=fr><U><FONT face=Arial color=#0000ff"
- OutPutFileHtml.WriteLine " size=2>http://www.xxxxxxxxx.com</FONT></U></SPAN></A></P></TD>"
- OutPutFileHtml.WriteLine " </TR></TBODY></TABLE></DIV></BODY></HTML>"
- OutPutFileHtml.Close
- WScript.Quit(0)
-
-
'---------------------------------------------------------------------------------------------------------
'Définition de la signature Outlook via paramètres utilisateur Active Directory
'
' ### PREMIER SCRIPT ### LE SECOND SE TROUVE A LA FIN DE CELUI-CI ###
'---------------------------------------------------------------------------------------------------------
'
'
'Définition des variables et vérification de l'existance du dossier ....\Microsoft\Signatures
set netw=createobject("wscript.network")
Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
set oshell = createobject("wscript.shell")
if not FileSystem.folderexists (oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures") then
FileSystem.CreateFolder(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures")
End If
Set OutPutFileTxt = FileSystem.CreateTextFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\Ma_Signature.txt", True)
Set OutPutFileHtml = FileSystem.CreateTextFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\Ma_Signature.htm", True)
'Suppression du fichier RTF si existant
if FileSystem.fileexists (oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\Ma_Signature.rtf") then
FileSystem.DeleteFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\Ma_Signature.rtf")
End If
'Send START Message
WScript.Echo "Creation signature Outlook en cours ... Veuillez patientez, s'il vous plait"
'Définition des OU Active Directory
'
'
'
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'!!!! xxxx = A définir suivant votre configuration AD !!!!!
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'
'
'
Set oContainer=GetObject("LDAP:// ou=xxxx,dc=xxxx,dc=xxxx,dc=com")
EnumerateUsers oContainer
'
'
'
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'!!!! xxxx = A définir suivant votre configuration AD !!!!!
'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
'
' Si plusieurs OU de recherche
'
'
' Set oContainer=GetObject("LDAP:// ou=xxxx,dc=xxxx,dc=xxxx,dc=com")
' EnumerateUsers oContainer
'
'
'
'
'Message de fin de procédure sur Erreur
WScript.Echo "Erreur: utilisateur inconnu ou mauvaise definition Active Directory ..."
WScript.Quit(0)
'Sub Programme de recherche "EnumerateUsers"
Sub EnumerateUsers(oCont)
Dim oUser
For Each oUser In oCont
Select Case LCase(oUser.Class)
Case "user"
If oUser.sAMAccountName=netw.username Then
'Affichage des paramètres de l'utilisateur
BtnCode = oshell.Popup("Nom: " & oUser.description & chr(13) & "Title: " &oUser.title & chr(13) & "Departement: " & oUser.department & chr(13) & "Adresse: " & oUser.postOfficeBox & ", " & oUser.streetAddress & ", " & oUser.postalCode & " " & oUser.l & chr(13) & "Phone: " & oUser.telephoneNumber & chr(13) & "Mobil: " & oUser.mobile & chr(13) & "Fax: " & oUser.facsimileTelephoneNumber & chr(13) & "Mail: " & oUser.mail & chr(13) & chr(13), 0, "Voulez-vous continuer: ?", 4 + 64)
If BtnCode=6 then
' Création du fichier au format TXT
OutPutFileTxt.WriteLine "Salutations / Best regards"
OutPutFileTxt.WriteLine " "
OutPutFileTxt.WriteLine oUser.description
OutPutFileTxt.WriteLine "--"
OutPutFileTxt.WriteLine oUser.title
OutPutFileTxt.WriteLine oUser.department
OutPutFileTxt.WriteLine oUser.postOfficeBox & ", " & oUser.streetAddress & ", " & oUser.postalCode & " " & oUser.l
If Not IsEmpty(oUser.telephoneNumber) Then
OutPutFileTxt.WriteLine "Phone " & oUser.telephoneNumber
End If
If Not IsEmpty(oUser.mobile) Then
OutPutFileTxt.WriteLine "Mobile " & oUser.mobile
End If
If Not IsEmpty(oUser.facsimileTelephoneNumber) Then
OutPutFileTxt.WriteLine "Fax " & oUser.facsimileTelephoneNumber
End If
OutPutFileTxt.WriteLine "Mailto:" & oUser.mail
OutPutFileTxt.WriteLine "http://VotresiteWEB"
OutPutFileTxt.Close
'Création du fichier au format HTML
OutPutFileHtml.WriteLine "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">"
OutPutFileHtml.WriteLine "<HTML><HEAD>"
OutPutFileHtml.WriteLine "<META http-equiv=Content-Type content=""text/html; charset=windows-1252"">"
OutPutFileHtml.WriteLine "<META content=""MSHTML 6.00.2800.1459"" name=GENERATOR></HEAD>"
OutPutFileHtml.WriteLine "<BODY>"
OutPutFileHtml.WriteLine "<DIV align=left>"
OutPutFileHtml.WriteLine "<TABLE id=table1"
OutPutFileHtml.WriteLine "style=""BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px"""
OutPutFileHtml.WriteLine "height=194 width=500 border=1>"
OutPutFileHtml.WriteLine " <TBODY>"
OutPutFileHtml.WriteLine " <TR>"
OutPutFileHtml.WriteLine " <TD"
OutPutFileHtml.WriteLine " style=""BORDER-RIGHT: medium none; PADDING-RIGHT: 0px; BORDER-TOP: medium none; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; "
OutPutFileHtml.WriteLine " BORDER-LEFT: medium none; PADDING-TOP: 0px; BORDER-BOTTOM: medium none"""
OutPutFileHtml.WriteLine " vAlign=bottom><SPAN lang=fr><FONT face=Arial size=2>Salutations / Best regards<BR>"
OutPutFileHtml.WriteLine "<BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.description & "</FONT><BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>--</FONT><BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.title & "</FONT><BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.department & "</FONT><BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.postOfficeBox & ", " & oUser.streetAddress & ", " & oUser.postalCode & " " & oUser.l & "</FONT><BR>"
If Not IsEmpty(oUser.telephoneNumber) Then
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>Phone " & oUser.telephoneNumber & "</FONT><BR>"
End If
If Not IsEmpty(oUser.mobile) Then
OutPutFileHtml.WriteLine "<FONT face=Arial size=2><FONT face=Arial size=2>Mobile " & oUser.mobile & "</FONT><BR>"
End If
If Not IsEmpty(oUser.facsimileTelephoneNumber) Then
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>Fax " & oUser.facsimileTelephoneNumber & "</FONT><BR>"
End If
OutPutFileHtml.WriteLine "<FONT face=Arial size=2><A href=""mailto:"
OutPutFileHtml.WriteLine oUser.mail
OutPutFileHtml.WriteLine """>mailto:" & oUser.mail & "</A></FONT><BR>"
OutPutFileHtml.WriteLine " </SPAN><A href=""http://votresiteWEB""><SPAN"
OutPutFileHtml.WriteLine " lang=fr><U><FONT face=Arial color=#0000ff"
OutPutFileHtml.WriteLine " size=2>http://votresiteWEB</FONT></U></SPAN></A></P></TD>"
OutPutFileHtml.WriteLine " </TR></TBODY></TABLE></DIV></BODY></HTML>"
OutPutFileHtml.Close
'Message de FIN normale de la procédure
WScript.Echo "Définition signature terminée"
WScript.Quit(0)
else
'Message de d'ABANDON de la procédure
WScript.Echo "Procédure annulée"
WScript.Quit(0)
End If
End If
Case "organizationalunit", "container"
EnumerateUsers oUser
End Select
Next
End Sub
'
' Fin de la première version
'
'########################################################################
'# #
'# Automatic Outlook Signature with LDAP Parameters #
'# #
'########################################################################
'
'Find the current LDAP Name
'
'#############################
Set oRootDSE = GetObject("LDAP://RootDSE")
Set oShell = WScript.CreateObject("WScript.Shell")
sUserName = oShell.Environment("PROCESS").Item("username")
Const ADS_PROPERTY_CLEAR = 1
Const ADS_NAME_INITTYPE_GC = 3
Const ADS_NAME_TYPE_NT4 = 3
Const ADS_NAME_TYPE_1779 = 1
strDNSDomain = oRootDSE.Get("defaultNamingContext")
Set objTrans = CreateObject("NameTranslate")
objTrans.Init ADS_NAME_INITTYPE_GC, ""
objTrans.Set ADS_NAME_TYPE_1779, strDNSDomain
strNetBIOSDomain = objTrans.Get(ADS_NAME_TYPE_NT4)
strNetBIOSDomain = Left(strNetBIOSDomain, Len(strNetBIOSDomain) - 1)
strUserNTName = Trim(LogonAccount)
objTrans.Set ADS_NAME_TYPE_NT4, strNetBIOSDomain & "\" & strUserNTName
If Err.Number <> 0 Then
On Error GoTo 0
Wscript.Echo "ERROR: Login not found in Active Directory: " & strUserNTName
Else
On Error GoTo 0
strUserDN = objTrans.Get(ADS_NAME_TYPE_1779)
LDAP_Name = "LDAP://" & strUserDN
End If
'#############################
'
'Find the current User in this LDAP
'
'#############################
On error resume next
Set objConnection = CreateObject("ADODB.Connection")
objConnection.Open "Provider=ADsDSOObject;"
Set objCommand = CreateObject("ADODB.Command")
objCommand.ActiveConnection = objConnection
objCommand.CommandText = "SELECT adspath FROM '" & LDAP_Name & "' WHERE objectCategory='user' AND sAMAccountName='" & sUserName & "'"
Set objRecordSet = objCommand.Execute
if (objRecordset.Fields("adspath") <> "") then
GetAdsPath = objRecordset.Fields("adspath")
end if
objConnection.Close
LDAP_Path_User = GetAdsPath
'#############################
'
'Wrtite files for this Outlook Signature
'
'#############################
Set oUser=GetObject(LDAP_Path_User)
Set oShell = WScript.CreateObject("WScript.Shell")
Set FileSystem = WScript.CreateObject("Scripting.FileSystemObject")
if not FileSystem.folderexists (oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures") then
FileSystem.CreateFolder(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures")
End If
Set OutPutFileTxt = FileSystem.CreateTextFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\efqm.txt", True)
Set OutPutFileHtml = FileSystem.CreateTextFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\efqm.htm", True)
if FileSystem.fileexists (oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\efqm.rtf") then
FileSystem.DeleteFile(oshell.expandenvironmentstrings("%userprofile%") & "\Application Data\Microsoft\Signatures\efqm.rtf")
End If
'=============================
'File with extension .TXT
'=============================
OutPutFileTxt.WriteLine " "
OutPutFileTxt.WriteLine "Salutations / Best regards"
OutPutFileTxt.WriteLine " "
OutPutFileTxt.WriteLine oUser.description
OutPutFileTxt.WriteLine "--"
OutPutFileTxt.WriteLine oUser.company
OutPutFileTxt.WriteLine oUser.title
OutPutFileTxt.WriteLine oUser.department
OutPutFileTxt.WriteLine oUser.postOfficeBox & ", " & oUser.streetAddress & ", " & oUser.postalCode & " " & oUser.l
If Not IsEmpty(oUser.telephoneNumber) Then
OutPutFileTxt.WriteLine "Phone " & oUser.telephoneNumber
End If
If Not IsEmpty(oUser.mobile) Then
OutPutFileTxt.WriteLine "Mobile " & oUser.mobile
End If
If Not IsEmpty(oUser.facsimileTelephoneNumber) Then
OutPutFileTxt.WriteLine "Fax " & oUser.facsimileTelephoneNumber
End If
OutPutFileTxt.WriteLine "Mailto:" & oUser.mail
'
'
'Put your WEB Site instead of www.xxxxxxxxx.com
'
'
OutPutFileTxt.WriteLine "http://www.xxxxxxxxx.com.com"
OutPutFileTxt.Close
'=============================
'File with extension .HTM
'=============================
OutPutFileHtml.WriteLine "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">"
OutPutFileHtml.WriteLine "<HTML><HEAD>"
OutPutFileHtml.WriteLine "<META http-equiv=Content-Type content=""text/html; charset=windows-1252"">"
OutPutFileHtml.WriteLine "<META content=""MSHTML 6.00.2800.1459"" name=GENERATOR></HEAD>"
OutPutFileHtml.WriteLine "<BODY>"
OutPutFileHtml.WriteLine "<DIV align=left>"
OutPutFileHtml.WriteLine "<TABLE id=table1"
OutPutFileHtml.WriteLine "style=""BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px"""
OutPutFileHtml.WriteLine "height=194 width=500 border=1>"
OutPutFileHtml.WriteLine " <TBODY>"
OutPutFileHtml.WriteLine " <TR>"
OutPutFileHtml.WriteLine " <TD"
OutPutFileHtml.WriteLine " style=""BORDER-RIGHT: medium none; PADDING-RIGHT: 0px; BORDER-TOP: medium none; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; "
OutPutFileHtml.WriteLine " BORDER-LEFT: medium none; PADDING-TOP: 0px; BORDER-BOTTOM: medium none"""
OutPutFileHtml.WriteLine " vAlign=bottom><SPAN lang=fr>"
OutPutFileHtml.WriteLine "<BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>Salutations / Best regards<BR>"
OutPutFileHtml.WriteLine "<BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.description & "</FONT><BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>--</FONT><BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.company & "</FONT><BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.title & "</FONT><BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.department & "</FONT><BR>"
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>" & oUser.postOfficeBox & ", " & oUser.streetAddress & ", " & oUser.postalCode & " " & oUser.l & "</FONT><BR>"
If Not IsEmpty(oUser.telephoneNumber) Then
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>Phone " & oUser.telephoneNumber & "</FONT><BR>"
End If
If Not IsEmpty(oUser.mobile) Then
OutPutFileHtml.WriteLine "<FONT face=Arial size=2><FONT face=Arial size=2>Mobile " & oUser.mobile & "</FONT><BR>"
End If
If Not IsEmpty(oUser.facsimileTelephoneNumber) Then
OutPutFileHtml.WriteLine "<FONT face=Arial size=2>Fax " & oUser.facsimileTelephoneNumber & "</FONT><BR>"
End If
OutPutFileHtml.WriteLine "<FONT face=Arial size=2><A href=""mailto:"
OutPutFileHtml.WriteLine oUser.mail
OutPutFileHtml.WriteLine """>mailto:" & oUser.mail & "</A></FONT><BR>"
'
'
'Put your WEB Site instead of www.xxxxxxxxx.com (twice)
'
'
OutPutFileHtml.WriteLine " </SPAN><A href=""http://www.xxxxxxxxx.com""><SPAN"
OutPutFileHtml.WriteLine " lang=fr><U><FONT face=Arial color=#0000ff"
OutPutFileHtml.WriteLine " size=2>http://www.xxxxxxxxx.com</FONT></U></SPAN></A></P></TD>"
OutPutFileHtml.WriteLine " </TR></TBODY></TABLE></DIV></BODY></HTML>"
OutPutFileHtml.Close
WScript.Quit(0)
Fichier Zip
Historique
- 10 janvier 2007 20:22:17 :
- Désolé, mais j'ai oublié l'extension du fichier Ma_Signature.HTM
- 12 janvier 2007 08:38:10 :
- Après quelques recherches à droite et à gauche, j'ai trouvé le moyen de réduire le temps de recherche et de rendre ce script exécutable dans tous les domaines LDAP (demande pour nos collègues des autres sites).
Seul l'écriture des fichiers reste à paramétrer suivant vos besoins (exemple, votre site WWW).
Sources du même auteur
Sources de la même categorie
Commentaires et avis
Discussions en rapport avec ce code source dans le forum
Outlook Public Folder [ par Briaeros ]
En ce bon mercredi, j'aimerai soliciter votre aide. Voila j'aimerai savoir comment faire le lien entre des contacts contenu dans active directory et l
Problème script LDAP [ par william the new ]
Bonjour à tousje voudrais créer des utilisateurs dans active directory avec un script LDAP ( en vbs)mais g l'erreur suivante à la ligne
utilisation d'active directory ldap [ par moyou ]
bonjour,j'ai besoin de savoir le nom et le prénom d'un utilisateur apartir de son login, et pour ça j'ai besoin de développer un script
impasse : droit AD et connexion ldap [ par Cybertat ]
Bonjour à tous,Il y a deux choses que je cherche à faire sans y parvenir complétement : J'ai trouvé sur le site de microsoft un script permettant d'af
LDAP & ACTIVE DIRECTORY [ par fatimahcha ]
salut tout le monde! SVP si qlq peut m'orienter; j'ai un projet sur LDAP/L'ACTIVE DIRECTORY et l'authentification du mot de passe/login..SVP si qlq a
Accès à Active Directory en VBS [ par Troy34 ]
Bonjour tout le monde :), Je fais actuellement un script en VBS chargé d'interroger Active Directory et j'ai un bloc de code qui me retourne une erre
Problème création Utilisateur active directory automatique [ par Benjyii ]
Bonjour, Je voudrais créer des utilisateus Active Directory automatiquement à partir d'un csv. Mon problème est lors de la configuration du TSE je r
Signature commune pour outlook [ par sinex ]
Bonjour J'ai développé une macro pour outlook afin de rajouter une signature commune a tout les utilisateurs, le principe est de rajouter le code h
Active Directory et Exchange [ par Briaeros ]
Salutation,Voila j'ai un probleme, je cherche à récupérer les contacts d'exchange par Active Directory. Je peux récupérer les users, group et computer
Authentification Active Directory sous VB6 [ par Dante27 ]
Bonjour à tous, Je travaille actuellement sur un projet dans lequel il y aura une authentification par le biais du compte local windows; il faut donc
|
Derniers Blogs
XNA IS DEAD!XNA IS DEAD! par richardc
Depuis la semaine dernière (et grâce aux TechDays 2012), je me penche activement sur la nouvelle version de Windows, aka Windows 8. Vous me direz, il était temps puisque la première preview date de Septembre dernier.
OK. Remarquez, on n'en est qu'aux...
Cliquez pour lire la suite de l'article par richardc TECHDAYS PARIS 2012 : WINDOWS SERVER "8" QUOI DE 9 !TECHDAYS PARIS 2012 : WINDOWS SERVER "8" QUOI DE 9 ! par ROMELARD Fabrice
Speakers: Fabrice Meillon et Stanislas Quastana Cette session est basée entièrement sur celle donnée lors de la BUILD cet hiver. Il n'y a pas d'ajout d'information en rapport avec cet évènement passé. Windows 8 Server sera intégralem...
Cliquez pour lire la suite de l'article par ROMELARD Fabrice [HTML5] AUTOUR DU W3C : NOUVEAUX STANDARDS ET WEB MOBILE (LILLE)[HTML5] AUTOUR DU W3C : NOUVEAUX STANDARDS ET WEB MOBILE (LILLE) par Gio
Je m'y prends un peu tard je sais, mais bon je suis développeur web et donc hyper fainéant ! Toujours dans le cadre des technologies émergentes, ici HTML5, parce qu'on aime HTML5 chez Wyg , nous seront présent, le vieux ( Aurélien V.) et moi, pour pr...
Cliquez pour lire la suite de l'article par Gio [WP7] DYNAMICALLY CHANGE STARTUP PAGE[WP7] DYNAMICALLY CHANGE STARTUP PAGE par KooKiz
Let's say that you want to allow the user to customize the startup page of your application. You can easily change the startup page by editing the 'NavigationPage' attribute in the manifest file. But the manifest cannot be modified once the applicatio...
Cliquez pour lire la suite de l'article par KooKiz
Logiciels
DocTranslate (V3.1.0.0)DOCTRANSLATE (V3.1.0.0)DocTranslate est un traducteur de document Microsoft Word, PowerPoint et Excel. Il permet d'autom... Cliquez pour télécharger DocTranslate Tribler (2012)TRIBLER (2012)Tribler est un client pair à pair (P2P/Peer-to-Peer) open source avec la capacité de regarder des... Cliquez pour télécharger Tribler OneSwarm (2012)ONESWARM (2012)Le peer-to-peer qui protège votre vie privée, c'est OneSwarm.
Ce logiciel de peer-to-peer crypté... Cliquez pour télécharger OneSwarm PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO (V8.4)PONAMEDIA TV DEVIENS HELLLOOO FLASH
LA TV SUR VOTRE ORDINATEUR.
Toute une plateforme Multi... Cliquez pour télécharger PONAMEDIA PREMIUM - HELLLOOO FLASH DEMO Academy System (17.2.1.0)ACADEMY SYSTEM (17.2.1.0)Logiciel de gestion des établissements.
- élèves/étudiants (inscription, dossier, absence...)
-... Cliquez pour télécharger Academy System
|