Winscripter
  WSH
  Forums
  Downloads
  Books
  Links
  Amazon




Login
Register

© winscripter.com
1998-2004







Script: MAPI - Add SMTP Address to Personal Address Book

Posted by on Sunday, January 18, 2004 (PST)

Script: Adds SMTP address to the personal address book of the opened profile.

 


/**
 *    Script:   addPABEntry.js
 *    Purpose:  Adds an SMTP address to the personal address book
 *              of the profile that is opened.
 *    Author:   Daren Thiel
 *    Date:     23 November 1998
 *
 *    Note:     Rename this file addPABEntry.js
 *
 *    Comments: There a several fields of information that can be
 *              added to the address book, I have only used two.
 **/
/* Create a MAPI Session Object */
omapi = new ActiveXObject("MAPI.Session"); 
/* Open the profile of where we want to store the address */
omapi.Logon("Microsoft Outlook Internet Settings");
/* Create an Address Book Object */
objpab = omapi.AddressLists("Personal Address Book");
/* Add an SMTP address with the display name "John Doe" */
objpabnew = objpab.AddressEntries.Add("SMTP", "John Doe");
/* Set the Email address */
objpabnew.Address = "jdoe@anywhere.com";
/* Save the data with Update() */
objpabnew.Update();
/* Tell the user we are done */
WScript.Echo( "Done" );
 



WSH and ADSI Administrative Scripting

New Articles
  • List installed COM objects and associated ProgIDs
    Script: Lists all COM Objects and their associated ProgIDs (If available). Win32_ClassicCOMClassSetting

  • Script: File Rotator
    Script: Rotate files where the most current file has the lowest number in the archive. When files exceed the retention period, they are deleted. Typically used for log files, backups, etc..

  • Script: Create IIS Website and DNS record
    Script: Dan Casier sent me this script that will create a website and appropriate DNS record. The script is intended for Windows 2000 Server with local DNS and necessary DNS mof installed.


  • Winscripter   |  WSH   |  Forums   |  Downloads   |  Books   |  Links   |  Amazon