RSAT start /w pkgmgr /iu:RemoteServerAdministrationTools-Roles-AD-DS-SnapIns;RemoteServerAdministrationTools-Roles-AD-DS;RemoteServerAdministrationTools-Roles-AD;RemoteServerAdministrationTools-Roles;RemoteServerAdministrationTools join machine to specific OU NETDOM JOIN machine /Domain:domain [/OU:ou path] netdom.exe need to be copied to c:\windows\system32\ netdom.exe.mui need to be copied to C:\Windows\System32\en-US\
2013年7月23日 星期二
enable RSAT component.
2013年7月15日 星期一
embed msg in CDO
sample
Const cdoSendUsingMethod ="http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer ="http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort ="http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout ="http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate ="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName ="http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword ="http://schemas.microsoft.com/cdo/configuration/sendpassword"
Const CdoReferenceTypeName = 1
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
Dim HtmlBody
Set objConfig = CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
With Fields
.Item(cdoSMTPServer) = "smtp.gmail.com"
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSendUsingMethod ) = 2
.Update
End With
Set objMessage = CreateObject("CDO.Message")
Set objBP = objMessage.AddRelatedBodyPart("d:\pwd_chg.png", "pwd_chg.png", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = ""
Set objBP = objMessage.AddRelatedBodyPart("d:\pwd_chg_chg.png", "pwd_chg_chg.png", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = ""
Set objBP = objMessage.AddRelatedBodyPart("d:\pwd_chg_done.png", "pwd_chg_done.png", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = ""
objBP.Fields.Update
Set objMessage.Configuration = objConfig
'HtmlBody="
"
'HtmlBody=HtmlBody & "
"
'HtmlBody=HtmlBody & "Testing the mail"
HtmlBody=Read_Template
With objMessage
.To = "kido.idv.tw@gmail.com"
.From = "kido.idv.tw@gmail.com"
.Subject = "mail subject"
'.TextBody = "SMTP Relay Test Sent @ " & Now()
.HtmlBody=HtmlBody
.Send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
Function Read_Template()
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, MyFile, FileName, TextLine
Set fso = CreateObject("Scripting.FileSystemObject")
FileName = "d:\pwd_notify.template"
Set MyFile = fso.OpenTextFile(FileName, ForReading, True)
Do While MyFile.AtEndOfStream <> True
TextLine = TextLine & MyFile.ReadLine
Loop
MyFile.Close
Read_Template=TextLine
End Function
=========================================================================================================================
Set objBP = objMessage.AddRelatedBodyPart("C:\Users\kido\Pictures\Google Talk\Leaf.bmp", "1.bmp", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "<1 .bmp="">"1>
'objBP.Fields.Update
Set objBP = objMessage.AddRelatedBodyPart("C:\Users\kido\Pictures\Google Talk\Monkey 1.bmp", "monkey.bmp", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = ""
objBP.Fields.Update
HtmlBody="
"
setup image file name mapping first and then use the alias file name in mail content
Const cdoSendUsingMethod ="http://schemas.microsoft.com/cdo/configuration/sendusing"
Const cdoSendUsingPort = 2
Const cdoSMTPServer ="http://schemas.microsoft.com/cdo/configuration/smtpserver"
Const cdoSMTPServerPort ="http://schemas.microsoft.com/cdo/configuration/smtpserverport"
Const cdoSMTPConnectionTimeout ="http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout"
Const cdoSMTPAuthenticate ="http://schemas.microsoft.com/cdo/configuration/smtpauthenticate"
Const cdoBasic = 1
Const cdoSendUserName ="http://schemas.microsoft.com/cdo/configuration/sendusername"
Const cdoSendPassword ="http://schemas.microsoft.com/cdo/configuration/sendpassword"
Const CdoReferenceTypeName = 1
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
Dim HtmlBody
Set objConfig = CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
With Fields
.Item(cdoSMTPServer) = "smtp.gmail.com"
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSendUsingMethod ) = 2
.Update
End With
Set objMessage = CreateObject("CDO.Message")
Set objBP = objMessage.AddRelatedBodyPart("d:\pwd_chg.png", "pwd_chg.png", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "
Set objBP = objMessage.AddRelatedBodyPart("d:\pwd_chg_chg.png", "pwd_chg_chg.png", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "
Set objBP = objMessage.AddRelatedBodyPart("d:\pwd_chg_done.png", "pwd_chg_done.png", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "
objBP.Fields.Update
Set objMessage.Configuration = objConfig
'HtmlBody="
"
'HtmlBody=HtmlBody & "
"
'HtmlBody=HtmlBody & "Testing the mail"
HtmlBody=Read_Template
With objMessage
.To = "kido.idv.tw@gmail.com"
.From = "kido.idv.tw@gmail.com"
.Subject = "mail subject"
'.TextBody = "SMTP Relay Test Sent @ " & Now()
.HtmlBody=HtmlBody
.Send
End With
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
Function Read_Template()
Const ForReading = 1, ForWriting = 2, ForAppending = 8
Dim fso, MyFile, FileName, TextLine
Set fso = CreateObject("Scripting.FileSystemObject")
FileName = "d:\pwd_notify.template"
Set MyFile = fso.OpenTextFile(FileName, ForReading, True)
Do While MyFile.AtEndOfStream <> True
TextLine = TextLine & MyFile.ReadLine
Loop
MyFile.Close
Read_Template=TextLine
End Function
=========================================================================================================================
Set objBP = objMessage.AddRelatedBodyPart("C:\Users\kido\Pictures\Google Talk\Leaf.bmp", "1.bmp", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "<1 .bmp="">"1>
'objBP.Fields.Update
Set objBP = objMessage.AddRelatedBodyPart("C:\Users\kido\Pictures\Google Talk\Monkey 1.bmp", "monkey.bmp", CdoReferenceTypeName)
objBP.Fields.Item("urn:schemas:mailheader:Content-ID") = "
objBP.Fields.Update
HtmlBody="
"
setup image file name mapping first and then use the alias file name in mail content
訂閱:
文章 (Atom)