Stratos Develekos Posted May 20, 2009 Report Share Posted May 20, 2009 Καλησπέρα σε όλους! Πως μπορώ να επισυνάψω σε όλα τα εξερχόμενα mail μια υπογραφή χωρίς να χρειάζεται να ρυθμίσω όλα τα Outlook; Κάτι διάβασα για Registry καταχωρήσεις απο Group Policy, κάτι για VBScript... Το έχει κάνει κανείς να με πει; Ευχαριστώ.... Link to comment Share on other sites More sharing options...
Blackman Posted May 20, 2009 Report Share Posted May 20, 2009 άσε να του ρίξουμε μία ματιά Link to comment Share on other sites More sharing options...
Blackman Posted May 20, 2009 Report Share Posted May 20, 2009 δες τα παρακάτω... http://robwhitehouse.com/windows/script-auto-generate-outlook-signature/ http://cwashington.netreach.net/depo/view.asp?Index=1079 Link to comment Share on other sites More sharing options...
Blackman Posted May 20, 2009 Report Share Posted May 20, 2009 δες και αυτό.... 1:2:3:4:5:6:7:8:9:10:11:12:13:14:15:16:17:18:19:20:21:22:23:24:25:26:27:28:29:30:31:32:33:34:35:36:37:38:39:40:41:42:43:44:45:46:47:48:49:50:51:52:53:54:55:56:57:58:59:60:61:62:63:64:65:66:67:68:69:70:71:72:73:74:75:76:77:78:79:80:81:82:83:84:85:86:87:88:89:90:91:92:93:94:95:96:97:98:99:100:101:102:103:104:105:106:107:108:109:110:111:112:113:114:115:116:117:118:119:120:121:122:123:124:125:126:127:128:129:130:131:132:133:134:135:136:137:138:139:140:141:142:143:144:145:146:147:148:149:150:151:152:153:154:155:156:157:158:159:160:161:162:163:164:165:166:167:168:169:170:171:172:173:174:175:176:177:178:179:180:181:182:183:184:185:186:187:188:189:190:191:192:193:194:195:196:197:198:199:200:201:202:203:204:205:206:207:208:209:210: '===================='' VBScript: <Signatures.vbs>' AUTHOR: Peter Aarts' Contact Info: [email protected]' Version 2.04' Date: January 20, 2006''===================='Option ExplicitOn Error Resume NextDim qQuery, objSysInfo, objuserDim FullName, EMail, Title, PhoneNumber, MobileNumber, FaxNumber, OfficeLocation, DepartmentDim web_address, FolderLocation, HTMFileString, StreetAddress, Town, State, CompanyDim ZipCode, PostOfficeBox, UserDataPath' Read LDAP(Active Directory) information to asigns the user's info to variables.'====================Set objSysInfo = CreateObject("ADSystemInfo")objSysInfo.RefreshSchemaCacheqQuery = "LDAP://" & objSysInfo.UsernameSet objuser = GetObject(qQuery)FullName = objuser.displaynameEMail = objuser.mailCompany = objuser.CompanyTitle = objuser.titlePhoneNumber = objuser.TelephoneNumberFaxNumber = objuser.FaxNumberOfficeLocation = objuser.physicalDeliveryOfficeNameStreetAddress = objuser.streetaddressPostofficeBox = objuser.postofficeboxDepartment = objUser.DepartmentZipCode = objuser.postalcodeTown = objuser.lMobileNumber = objuser.TelephoneMobileweb_address = "http://www..com/"' This section creates the signature files names and locations.'====================' Corrects Outlook signature folder location. Just to make sure that' Outlook is using the purposed folder defined with variable : FolderLocation' Example is based on Dutch version.' Changing this in a production enviremont might create extra work' all employees are missing their old signatures'====================Dim objShell, RegKey, RegKeyParmSet objShell = CreateObject("WScript.Shell")RegKey = "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\General"RegKey = RegKey & "\Signatures"objShell.RegWrite RegKey , "Handtekeningen"UserDataPath = ObjShell.ExpandEnvironmentStrings("%appdata%")FolderLocation = UserDataPath &"\Microsoft\Handtekeningen\"HTMFileString = FolderLocation & "L1-Handtekening.htm"' This section disables the change of the signature by the user.'====================objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings\NewSignature" , "L1-Handtekening"objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Common\MailSettings\ReplySignature" , "L1-Handtekening"objShell.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\Outlook\Options\Mail\EnableLogging" , "0", "REG_DWORD"' This section checks if the signature directory exits and if not creates one.'====================Dim objFS1Set objFS1 = CreateObject("Scripting.FileSystemObject")If (objFS1.FolderExists(FolderLocation)) ThenElseCall objFS1.CreateFolder(FolderLocation)End if' The next section builds the signature file'====================Dim objFSODim objFile,afileDim aQuoteaQuote = chr(34)' This section builds the HTML file version'====================Set objFSO = CreateObject("Scripting.FileSystemObject")' This section deletes to other signatures.' These signatures are automaticly created by Outlook 2003.'====================Set AFile = objFSO.GetFile(Folderlocation&"L1-Handtekening.rtf")aFile.DeleteSet AFile = objFSO.GetFile(Folderlocation&"L1-Handtekening.txt")aFile.DeleteSet objFile = objFSO.CreateTextFile(HTMFileString,True)objFile.CloseSet objFile = objFSO.OpenTextFile(HTMFileString, 2)objfile.write "<!DOCTYPE HTML PUBLIC " & aQuote & "-//W3C//DTD HTML 4.0 Transitional//EN" & aQuote & ">" & vbCrLfobjfile.write "<HTML><HEAD><TITLE>Microsoft Office Outlook Signature</TITLE>" & vbCrLfobjfile.write "<META http-equiv=Content-Type content=" & aQuote & "text/html; charset=windows-1252" & aQuote & ">" & vbCrLfobjfile.write "<META content=" & aQuote & "MSHTML 6.00.3790.186" & aQuote & " name=GENERATOR></HEAD>" & vbCrLfobjfile.write "<BODY link=#FFFFFF alink=#FFCC00 vlink=#FFFFFF>" & vbCrLfobjfile.write "<FONT size=2 face=" & aQuote & "Arial" & aQuote & " color=black>THIS IS THE TEXT<br>"& vbCrLfobjfile.write "<BR>" & vbCrLfobjfile.write "<B><FONT size=2>"& FullName & "</B><BR>" & vbCrLfobjfile.write Department& " " & title & "<BR><BR>" & vbCrLfobjfile.write "<FONT size=2 face=" & aQuote & "Arial" & aQuote & " color=Navy><B>"& Company & "</B><BR>" & vbCrLfobjfile.write "<FONT size=2 color=black>" & StreetAddress&", "&PostOfficeBox&", "&ZipCode&", "&town&"<BR>"& vbCrLfobjfile.write "<B><FONT size=2 color=navy>T</B><FONT size=2 color=black> " & PhoneNumber & " | " & "<B><FONT size=2 color=navy>M</B><FONT size=2 color=black> " & MobileNumber & " | " & "<B><FONT size=2 color=navy>F</B><FONT size=2 color=black> " & FaxNumber & "<BR>" & vbCrLfobjfile.write "<B><FONT size=2 color=navy>E</B><FONT size=2 color=black> " & Email &" | " & "<B><FONT size=2 color=navy>I</B><FONT size=2 color=black> " & web_address & vbCrLfobjfile.write "</FONT></BODY></HTML>" & vbCrLfobjFile.Close' ===========================' This section readsout the current Outlook profile and then sets the name of the default Signature' ===========================' Use this version to set all accounts' in the default mail profile' to use a previously created signatureCall SetDefaultSignature("L1-Handtekening","")' Use this version (and comment the other) to' modify a named profile.'Call SetDefaultSignature _' ("Signature Name", "Profile Name")Sub SetDefaultSignature(strSigName, strProfile)Const HKEY_CURRENT_USER = &H80000001strComputer = "."If Not IsOutlookRunning ThenSet objreg = GetObject("winmgmts:" & _"{impersonationLevel=impersonate}!\\" & _strComputer & "\root\default:StdRegProv")strKeyPath = "Software\Microsoft\Windows NT\" & _"CurrentVersion\Windows " & _"Messaging Subsystem\Profiles\"' get default profile name if none specifiedIf strProfile = "" Thenobjreg.GetStringValue HKEY_CURRENT_USER, _strKeyPath, "DefaultProfile", strProfileEnd If' build array from signature namemyArray = StringToByteArray(strSigName, True)strKeyPath = strKeyPath & strProfile & _"\9375CFF0413111d3B88A00104B2A6676"objreg.EnumKey HKEY_CURRENT_USER, strKeyPath, _arrProfileKeysFor Each subkey In arrProfileKeysstrsubkeypath = strKeyPath & "\" & subkeyobjreg.SetBinaryValue HKEY_CURRENT_USER, _strsubkeypath, "New Signature", myArrayobjreg.SetBinaryValue HKEY_CURRENT_USER, _strsubkeypath, "Reply-Forward Signature", myArrayNextElsestrMsg = "Please shut down Outlook before " & _"running this script."MsgBox strMsg, vbExclamation, "SetDefaultSignature"End IfEnd SubFunction IsOutlookRunning()strComputer = "."strQuery = "Select * from Win32_Process " & _"Where Name = 'Outlook.exe'"Set objWMIService = GetObject("winmgmts:" _& "{impersonationLevel=impersonate}!\\" _& strComputer & "\root\cimv2")Set colProcesses = objWMIService.ExecQuery(strQuery)For Each objProcess In colProcessesIf UCase(objProcess.Name) = "OUTLOOK.EXE" ThenIsOutlookRunning = TrueElseIsOutlookRunning = FalseEnd IfNextEnd FunctionPublic Function StringToByteArray _(Data, NeedNullTerminator)Dim strAllstrAll = StringToHex4(Data)If NeedNullTerminator ThenstrAll = strAll & "0000"End IfintLen = Len(strAll) \ 2ReDim arr(intLen - 1)For i = 1 To Len(strAll) \ 2arr(i - 1) = CByte _("&H" & Mid(strAll, (2 * i) - 1, 2))NextStringToByteArray = arrEnd FunctionPublic Function StringToHex4(Data)' Input: normal text' Output: four-character string for each character,' e.g. "3204" for lower-case Russian B,' "6500" for ASCII e' Output: correct characters' needs to reverse order of bytes from 0432Dim strAllFor i = 1 To Len(Data)' get the four-character hex for each characterstrChar = Mid(Data, i, 1)strTemp = Right("00" & Hex(AscW(strChar)), 4)strAll = strAll & Right(strTemp, 2) & Left(strTemp, 2)NextStringToHex4 = strAllEnd Function Link to comment Share on other sites More sharing options...
GSimos Posted May 20, 2009 Report Share Posted May 20, 2009 Το θέμα έχει ξαναερωτηθεί και απαντηθεί.... Ψάξτε λίγο στο forum και θα το βρείτε. Ορίστε και το Link http://autoexec.gr/forums/thread/14857.aspx Link to comment Share on other sites More sharing options...
Blackman Posted May 21, 2009 Report Share Posted May 21, 2009 καλή φάση George...να το έχεις στο σπίτι σου και να ψάχνεις αλλού... και έλεγα ότι κάπου το έχω διαβάσει... Link to comment Share on other sites More sharing options...
Stratos Develekos Posted May 22, 2009 Author Report Share Posted May 22, 2009 Και το έψαξα πριν ποστάρω αλλά προφανώς δεν έψαξα καλά... Ευχαριστώ όλους για τις απαντήσεις... Link to comment Share on other sites More sharing options...
Recommended Posts