• Sendmail via VBscript

    This is a fun one, you can find numerous examples of this script all over the internet. Figured I’d share…

    
    Set objEmail = CreateObject("CDO.Message")
    objEmail.From = "from@domain.com"
    objEmail.To = "to@domain.com"
    objEmail.Subject = "My Subject"
    objEmail.Textbody = "Only use if you want to send a text email and not an HTML email"
    objEmail.HTMLBody = "" &_
    "
    " &_ "HTMLPretty Font lalallala " &_ "
    AIS-IUS" &_ "More pretty font HTML woot
    " objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = _ "{your mail server}" objEmail.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = {mail server port} objEmail.Configuration.Fields.Update objEmail.Send

    This sends a pretty simple text email. If you want to send an HTML email simple craft your HTML in your favorite text editor and copy and past it to the line:

    
    
    objEmail.HTMLBody = "HTMLCODE" 
    

    Use &_ to append to the next line.

  • Batch removal of single file from server list….

    Since I posted how to deploys splash page using VBscript I figured it was only appropriate to post an article on how to remove it. Original post here.


    Requirements:
    1. VBscripting skills.
    2. splash.html (HTML file that will be removed).
    3. servers.txt (txt file listing each server to delete/remove the splash.html file from).
    4. Assumes you have appropriate user privileges.

    [Read More…]

  • Batch file copy using VBscripting…

    One of my jobs long ago was to maintain the process for deploying splash pages to MS terminal server users when planned maintenance would be performed. The creation of the splash HTML page was simply a white page with red and black text informing the user when the service would be down. Pretty basic right? The opportunity I saw was to automatically deploy it, rather than remoting in or remotely copying each splash file to each Terminal Server. I wrote the following script to copy the splash page to a list of servers identified in a txt file.“


    Requirements:
    1. VBscripting skills
    2. splash.html (HTML file that will be deployed)
    3. servers.txt (txt file listing each server to push the splash.html file to)
    4. Assumes you have appropriate user privileges.

    [Read More…]

↓