Scripting: Remove all PST files in an outlook profile
Building on, this code will remove the mapping that has been done in outlook for ALL PST files.
'On Error resume next
Dim objOutlook 'As Outlook.Application
Dim Session 'As Outlook.NameSpace
Dim Store 'As Outlook.Store
Dim Stores 'As Outlook.Stores
Dim objFolder 'As Outlook.Folder
Set objOutlook = CreateObject("Outlook.Application")
Set Session = objOutlook.Session
Set Stores = Session.Stores
For Each Store In Stores
If Store.ExchangeStoreType = 3 then
Set objFolder = store.GetRootFolder
Session.RemoveStore objFolder
End If
Next