Learn about Windows PowerShell
Summary: Use Windows PowerShell to list contacts in Microsoft Outlook.
How can I use Windows PowerShell to programmatically connect to Outlook to get the Contacts list?
Connect by using ComObject, and select the objects you need:
$Outlook=NEW-OBJECT –comobject Outlook.Application
$Contacts | Format-Table FullName,MobileTelephoneNumber,Email1Address
Nope. Too easy. Now load them into SharePoint on O365. It takes about three more steps.
Hello,How can I export this contacts to msg files?THX
How would I delete the contacts? I tried changing the last line to "$Contacts | Remove-Item" but it didn't work. The user has 63,000 contacts that were sync'd with CRM so doing this manually would take too long. Any suggestions?
What I am having problems with is. I am trying to do some data mining, with something like this:
#This is the Outlook "get your inbox" stuff that store it all in a $inbox variable.
$olFolderInbox = 6
$outlook = new-object -com outlook.application;
$ns = $outlook.GetNameSpace("MAPI");
$inbox = $ns.GetDefaultFolder($olFolderInbox)
#Loops through the variable and outputs the fields you select to the CSV.
foreach ($b in $inbox.Items)
$b | select sendername,subject,Senton | export-csv -Path $outputFile -NoTypeInformation -Append
Seems to me that the number 6 equals INBOX.
Just like in your script 10 equals Contacts.
I would like to run a command like what you have here, that will identify the numbers of each folder within a users mailbox.
So a script I would run would tell me what number to use for the subfolder in Inbox called 2014
# loop throughinbox and export selected properties
select sendername,subject,Senton |
export-csv -Path $outputFile -NoTypeInformation -Append
# get all default folder names and get enum for 'Sent Items'
add-type -AssemblyName Microsoft.Office.Interop.Outlook