none
How to import/export Exchange appointment

    Question

  • Hello,

    I search how I can create several appointments in Exchange 2010 any tools exist ? Like import/export csv ? Or create appointment for specific user form a command line like script bash ?

    Thank you very much and best regards,

    Adrien

    Saturday, December 07, 2013 8:45 PM

All replies

  • Hi

    Are you wanting to create meeting requests for a user? Using OWA or Outlook might be quicker?

    Sunday, December 08, 2013 3:28 PM
  • No I want to create appointment to specific date in order to (I think is the solution but not sure) make a script bash (or other program which can be execute by command line). My purpose is to create several appointments to test my java program which request one Exchange 2010 by EWS. A kind of integration test which can be run that can be executed every day starting on a new appointments
    Sunday, December 08, 2013 5:55 PM
  • If you stick with Windows, Powershell and the EWS Managed API then its easy here are few samples of script for different people

    http://www.mikepfeiffer.net/2011/01/creating-calendar-items-with-powershell-and-the-ews-managed-api/

    http://gallery.technet.microsoft.com/office/Create-Appointments-for-779b55ad

    or a script like

    ## Get the Mailbox to Access from the 1st commandline argument
    
    $MailboxName = $args[0]
    
    ## Load Managed API dll  
    Add-Type -Path "C:\Program Files\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebServices.dll"  
      
    ## Set Exchange Version  
    $ExchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP2  
      
    ## Create Exchange Service Object  
    $service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService($ExchangeVersion)  
      
    ## Set Credentials to use two options are availible Option1 to use explict credentials or Option 2 use the Default (logged On) credentials  
      
    #Credentials Option 1 using UPN for the windows Account  
    $psCred = Get-Credential  
    $creds = New-Object System.Net.NetworkCredential($psCred.UserName.ToString(),$psCred.GetNetworkCredential().password.ToString())  
    $service.Credentials = $creds      
      
    #Credentials Option 2  
    #service.UseDefaultCredentials = $true  
      
    ## Choose to ignore any SSL Warning issues caused by Self Signed Certificates  
      
    ## Code From http://poshcode.org/624
    ## Create a compilation environment
    $Provider=New-Object Microsoft.CSharp.CSharpCodeProvider
    $Compiler=$Provider.CreateCompiler()
    $Params=New-Object System.CodeDom.Compiler.CompilerParameters
    $Params.GenerateExecutable=$False
    $Params.GenerateInMemory=$True
    $Params.IncludeDebugInformation=$False
    $Params.ReferencedAssemblies.Add("System.DLL") | Out-Null
    
    $TASource=@'
      namespace Local.ToolkitExtensions.Net.CertificatePolicy{
        public class TrustAll : System.Net.ICertificatePolicy {
          public TrustAll() { 
          }
          public bool CheckValidationResult(System.Net.ServicePoint sp,
            System.Security.Cryptography.X509Certificates.X509Certificate cert, 
            System.Net.WebRequest req, int problem) {
            return true;
          }
        }
      }
    '@ 
    $TAResults=$Provider.CompileAssemblyFromSource($Params,$TASource)
    $TAAssembly=$TAResults.CompiledAssembly
    
    ## We now create an instance of the TrustAll and attach it to the ServicePointManager
    $TrustAll=$TAAssembly.CreateInstance("Local.ToolkitExtensions.Net.CertificatePolicy.TrustAll")
    [System.Net.ServicePointManager]::CertificatePolicy=$TrustAll
    
    ## end code from http://poshcode.org/624
      
    ## Set the URL of the CAS (Client Access Server) to use two options are availbe to use Autodiscover to find the CAS URL or Hardcode the CAS to use  
      
    #CAS URL Option 1 Autodiscover  
    $service.AutodiscoverUrl($MailboxName,{$true})  
    "Using CAS Server : " + $Service.url   
       
    #CAS URL Option 2 Hardcoded  
      
    #$uri=[system.URI] "https://casservername/ews/exchange.asmx"  
    #$service.Url = $uri    
      
    ## Optional section for Exchange Impersonation  
      
    #$service.ImpersonatedUserId = new-object Microsoft.Exchange.WebServices.Data.ImpersonatedUserId([Microsoft.Exchange.WebServices.Data.ConnectingIdType]::SmtpAddress, $MailboxName) 
    
    ##Create a Calendar Appointment  
      
    $Appointment = New-Object Microsoft.Exchange.WebServices.Data.Appointment -ArgumentList $service  
    #Set Start Time  
    $Appointment.Start = [system.DateTime]::Now.AddDays(7)  
    #Set End Time  
    $Appointment.End = [system.DateTime]::Now.AddDays(7).AddHours(1)  
    #Set Subject  
    $Appointment.Subject = "Drink Coffee with Friend"  
    #Set the Location  
    $Appointment.Location = "Good Coffee Shop"  
    #Set any Notes  
    $Appointment.Body = "Dont forget to mention X and Y"  
    #Create Appointment will save to the default Calendar  
    $Appointment.Save()  
    Cheers
    Glen

    Monday, December 09, 2013 3:15 AM
  • Oh great thank I copy/paste your solution and try this in the week, I can just use it in PowerShell ?
    Monday, December 09, 2013 8:54 AM