0

Hy Guys, I Trying Get list of Outlook Favorite Item via Powershell, but i couldn't, I have created the script for Inbox and others, it's working, but having trouble with favorite item, can anyone help to do same for Favorite, really apricated if you can

$Outlook = New-Object -com Outlook.Application $Namespace = $outlook.GetNamespace("MAPI") $PublicFolder = $Namespace.Folders.Item("Favoirets - Parmeshwar.Jadhao@Email.com.au")

enter image description here

Biren
  • 31
  • 1
  • 9

2 Answers2

1

This code will list Favorites

$ol = New-Object -ComObject Outlook.Application
$ex = $ol.Application.ActiveExplorer()
$mm = $ex.NavigationPane.Modules.GetNavigationModule(0)
$favorites = $mm.NavigationGroups.GetDefaultNavigationGroup(4)
$favorites.NavigationFolders | Select-Object -ExpandProperty folder | Select-Object FolderPath
jfrmilner
  • 406
  • 2
  • 6
  • Yes it's working, Can we achieve below one....... Script look for file, where the my all favorites store in file, and validate name with outlook all folder in app, once all matched, make those folder are favorites – Biren Nov 30 '20 at 13:40
1

I found a similar thread for your reference: Get list of Outlook Favorite Item via Powershell

The script to fix your problem is similar with jfrmilner's:

$OutlookObject=New-Object -ComObject Outlook.Application
$ActiveExplorer=$OutlookObject.Application.ActiveExplorer()
$NModule=$ActiveExplorer.NavigationPane.Modules.GetNavigationModule(0)
$FavFolder=$NModule.NavigationGroups.GetDefaultNavigationGroup(4)
$FavFolder.NavigationFolders|select -expand folder|select Name | Out-File -FilePath "C:\Favourite.txt"
Ivan_Wang
  • 1,323
  • 1
  • 3
  • 4