none
import appointments to the outlook calendar from csv RRS feed

  • Question

  • hi,
    We have an excel spreadsheet with the appointments.I have EWS installed on my Exchange Server 2010. Is there anyway to import the appointments to the Outlook non-default calendar using powershell.

    I have followed this http://blogs.msdn.com/b/emeamsgdev/archive/2012/02/13/exchange-2007-2010-powershell-import-calendar-items-from-csv-file.aspx and I can successfully import it to the default calendar.

    Any help would be much appreciated, thank you.

    Friday, December 4, 2015 11:09 AM

All replies

  • Hello,

    You may consider automating Outlook and adding required Calendar items programmatically. For more information please visit the following pages where you can find a sample source code:

    C# app automates Outlook (CSAutomateOutlook)

    How To: Create a new Outlook Appointment item

    Working with Calendar Items

    Friday, December 4, 2015 12:15 PM
  • Hi abudha,

    This forum is for Developer discussions and questions involving Microsoft Outlook, your requirement is more related with powershell in EWS, I will move this thread to the more related forum.

    Reference: https://social.technet.microsoft.com/Forums/exchange/en-us/home?forum=exchangesvrdevelopment

    Thanks for your understanding.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, December 7, 2015 7:28 AM
  • You will need to replace the following section

    try {
    	$CalendarFolder = [Microsoft.Exchange.WebServices.Data.CalendarFolder]::Bind($service, [Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Calendar);
    } catch {
    	throw;
    }

    with something like this

    function Get-FolderFromPath{
    	param (
    			[Parameter(Position=0, Mandatory=$true)] [string]$FolderPath,
    			[Parameter(Position=1, Mandatory=$true)] [string]$MailboxName,
    			[Parameter(Position=2, Mandatory=$true)] [Microsoft.Exchange.WebServices.Data.ExchangeService]$service,
    			[Parameter(Position=3, Mandatory=$false)] [Microsoft.Exchange.WebServices.Data.PropertySet]$PropertySet
    		  )
    	process{
    		## Find and Bind to Folder based on Path  
    		#Define the path to search should be seperated with \  
    		#Bind to the MSGFolder Root  
    		$folderid = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::MsgFolderRoot,$MailboxName)   
    		$tfTargetFolder = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$folderid)  
    		#Split the Search path into an array  
    		$fldArray = $FolderPath.Split("\") 
    		 #Loop through the Split Array and do a Search for each level of folder 
    		for ($lint = 1; $lint -lt $fldArray.Length; $lint++) { 
    	        #Perform search based on the displayname of each folder level 
    	        $fvFolderView = new-object Microsoft.Exchange.WebServices.Data.FolderView(1) 
    			if(![string]::IsNullOrEmpty($PropertySet)){
    				$fvFolderView.PropertySet = $PropertySet
    			}
    	        $SfSearchFilter = new-object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo([Microsoft.Exchange.WebServices.Data.FolderSchema]::DisplayName,$fldArray[$lint]) 
    	        $findFolderResults = $service.FindFolders($tfTargetFolder.Id,$SfSearchFilter,$fvFolderView) 
    	        if ($findFolderResults.TotalCount -gt 0){ 
    	            foreach($folder in $findFolderResults.Folders){ 
    	                $tfTargetFolder = $folder                
    	            } 
    	        } 
    	        else{ 
    	           # Write-host ("Error Folder Not Found check path and try again")  
    	            $tfTargetFolder = $null  
    	            break  
    	        }     
    	    }  
    		if($tfTargetFolder -ne $null){
    			return [Microsoft.Exchange.WebServices.Data.Folder]$tfTargetFolder
    		}
    		else{
    			throw ("Folder Not found")
    		}
    	}
    }
    
    $PathToFolder = "\Calendar\Folder1"
    
    try {
    	$CalendarFolder = Get-FolderFromPath -FolderPath $PathToFolder -MailboxName $EmailAddress -service $service
    	
    } catch {
    	throw;
    }

    Where $PathToFolder = "\Calendar\Folder1"

    Is the path to the folder you want to access it if you want this to be a variable the pass it in another parameter from the script

    Cheers
    Glen

    Tuesday, December 8, 2015 5:09 AM