Question : Disconnect .PST files / close Personal Folders in Outlook 2007?

Hello,

We are getting ready to migrate data from .PST files into our Exchange 2010 environment.  I am able to use group policy to not allow users to add new .PST files to Outlook, as well as not allow them to add new data into an existing .PST.  However, I am looking for away to automatically disconnect any .PST / close Personal Folders that the user has is use in Outlook 2007.

Is this possible?  

Thanks!

-WEG IS

Answer : Disconnect .PST files / close Personal Folders in Outlook 2007?

Hi, WEG_IS.

The code below will close all open PSTs.  Here's how to use it:

1.  Open Notepad
2.  Copy the code and paste it into Notepad
3.  Save the file with a .vbs extension
4.  Double-click the file to run it

You can integrate the script into an existing logon script or use a policy to run it.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
Const olNotExchange = 3
Dim olkApp, olkSes, olkSto, intIndex
Set olkApp = CreateObject("Outlook.Application")
Set olkSes = olkApp.GetNamespace("MAPI")
olkSes.Logon olkApp.DefaultProfileName
For intIndex = olkSes.Stores.count To 1 Step -1
    Set olkSto = olkSes.Stores.Item(intIndex)
    If olkSto.ExchangeStoreType = olNotExchange Then
        olkSes.RemoveStore olkSto.GetRootFolder
    End If
Next
olkSes.Logoff
olkApp.Quit
Set olkSto = Nothing
Set olkSes = Nothing
Set olkApp = Nothing
Random Solutions  
 
programming4us programming4us