Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Powershell Script to Export Contacts Note

$
0
0

I have a script that will export outlook contacts. It seems that I am unable to export the notes field.

$TempPath="$env:Userprofile\appdata\local\microsoft\outlook\"
$strname=$env:username
#New-Item c:\myscripts\output -type directory
New-Item \\x.x.x.x\backupemail\users\$strname -ItemType directory
New-Item \\x.x.x.x\backupemail\users\$strname\contacts -ItemType directory
$Outlook=NEW-OBJECT –comobject Outlook.Application

$Contacts=$Outlook.session.GetDefaultFolder(10).items

## $Contacts | Format-Table FullName,CompanyName,JobTitle,FileAs,Email1Address,WebPage,IMAddress,BusinessTelephoneNumber,BusinessFaxNumber,MobileTelephoneNumber,BusinessAddress,Notes

$properties = 'FullName','CompanyName','JobTitle','FileAs','Email1Address','WebPage','IMAddress','BusinessTelephoneNumber','BusinessFaxNumber','BusinessAddress','MobileTelephoneNumber','HomeTelephoneNumber','Notes'
$Contacts |
Select-Object -Property $properties |
Export-Csv -NoTypeInformation -Path \\x.x.x.x\backupemail\users\$strname\contacts\contacts.csv

Thank you in advance


Viewing all articles
Browse latest Browse all 13067

Trending Articles