Kaseya Community

Configuring Outlook Adress book option by script?

  • I have alot of customers wich are working with Exchange and a Outlook 2003 / 2007 environment. They use public folders to share contacts with each other and these folders need to be enabled so they will appear below the TO button.

    You can do this by manually going to the properties of the public folder and choose the tab "Outlook Adress Book" and enable the option "show this folder as an e-mail adresbook".

    This isn't funny if the customer has over 10 public folders and you need to enable this user by user.

    Is there anyone wich knows some way to do this unattended?

    If this isn't clear enough let me know and i will post screenshots or a video to show what i mean.

    Legacy Forum Name: Configuring Outlook Adress book option by script?,
    Legacy Posted By Username: RemcoVi
  • I've read that setting MAPIFolder.ShowAsOutlookAB = True via VBS will do the trick. I've never tested it though

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: thirteentwenty
  • thirteentwenty
    I've read that setting MAPIFolder.ShowAsOutlookAB = True via VBS will do the trick. I've never tested it though


    If i google it then yes this should be the way i was looking for, but i am not a vbs person. Thanks for the info and i will use trial and error and hopefully i get it to work.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: RemcoVi
  • I am so happy, it works.

    I found this script:

    ' Address Book Name
    Dim ADDRESSBOOK 'As String
    ADDRESSBOOK = "My Address Book"

    Dim oApp 'As Outlook.Application
    Set oApp = CreateObject("Outlook.Application")

    Dim oNameSpace 'As NameSpace
    Set oNameSpace = oApp.GetNamespace("MAPI")

    Dim oContactFolder 'As Outlook.MAPIFolder
    Set oContactFolder = oNameSpace.Folders("Public
    Folders").Folders("All Public folders").Folders(ADDRESSBOOK)

    If (oContactFolder <> Null) Then
    oContactFolder.ShowAsOutlookAB = True
    End If


    This didn't work at the first time and i have adjusted this part of the code:


    If (oContactFolder <> Null) Then
    oContactFolder.ShowAsOutlookAB = True
    End If


    To


    'If (oContactFolder <> Null) Then
    oContactFolder.ShowAsOutlookAB = True
    'End If


    In other words i disabled the IF statement. I don't know why he fails on that because the option was disabled so it has to be find the statement false, but it didn't.

    I can just create multiple VBS files to execute ones in a loginscript of by kaseya and maybe i can find a way to integrate it in one script, but this works great at saves me alot of time.

    I just post this in the hope if you have the same problem, you don't need to look to far.

    -edit-
    You can easily create it in one script. Just repear the last 2 lines Set oContactFolder = and oContactFolder.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: RemcoVi