'------------------------------------------------------------------------------------------------------------------------ ' VB Script to send email about the new user created in AD with username and password. (cscript email.vbs %username% %password% %mail%) ' Date 22-03-2012 ' Version 1.0 ' Author: ADManager Plus Team '------------------------------------------------------------------------------------------------------------------------ Set objEmail = CreateObject("CDO.Message") objEmail.From = "xxxx@domain.com" 'Specify the From Address objEmail.To = wscript.Arguments(2) 'Specify the To Address objEmail.Subject = "User Created in AD" 'Subject 'Define the body of mail. Use "vbCRLF" for new line.Use "wscript.Arguments(0)" for first argument and "wscript.Arguments(1)" for second argument objEmail.Textbody = "Dear XXXXXX,"& vbCRLF & "The following user is created in AD."& vbCRLF & vbCRLF & "UserName:"&wscript.Arguments(0)& vbCRLF & "Password:"&wscript.Arguments(1) objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTP" 'Specify the SMTP server objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 'Specify the SMTP Port.Default port is 25 objEmail.Configuration.Fields.Update objEmail.Send