Giter VIP home page Giter VIP logo

ews's Introduction

PowerShell Module: EWS

Image

EWS (Exchange Web Services) is a convenient way to manage mailboxes:

  • on premise (with Exchange 2007+)
  • in the cloud (Office 365)
  • at home (outlook.com/live.com mailboxes)

The purpose of this module is to provide a thin wrapper around EWS objects and methods. That way user can use familiar syntax when communicating with her/his Exchange resources.

This module is far from being feature-complete, but it should be a good starting point.

TODO

Apart from extending functionality, there are few serious problems that need to be addressed first:

  1. Testing (see #3)
  2. Help - basic version created for existing commands (see #2)
  3. Automatic building/ releasing/ publishing (see #4)

ews's People

Contributors

bielawb avatar chirishman avatar pnorms avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ews's Issues

Add support for federated Exchange

I tried using this for a domain which has on-prem exchange but is in the process of migrating to 365 and it blocked the redirect when I tried to use it against a mailbox which had been migrated to the 365 instance.

Exception calling "AutodiscoverUrl" with "1" argument(s): "Autodiscover blocked a potentially insecure redirection to 
https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml. To allow Autodiscover to follow the redirection, use the AutodiscoverUrl(string, 
AutodiscoverRedirectionUrlValidationCallback) overload."

Exception calling "SendAndSaveCopy" with "0" argument(s)

Hi Bartek !

Great Module, love it. A thing that bugs me is that when i try to send an e-Mail to from my OnPrem Exch 2013 Box, it raises an error.

Exception calling "SendAndSaveCopy" with "0" argument(s): "Object reference not set to an
instance of an object."

Any ideas why ?

Thx/R.

Add CONTRIBUTING.md

A few "serious problems" is currently mentioned in the README.

One that is not mentioned is that contribution guidelines are missing.

I believe that a CONTRIBUTING.md file should be added to the root of this project.

Code style guides is something I think should be added to these guidelines.

Further reading/examples: https://blog.github.com/2012-09-17-contributing-guidelines/

Connect-EWSService should support Uri.

Using auto-discovery is convenient, but often it's more efficient to provide url instead.
Approach should be similar to credentials:
If uri -> use it to create service object.
Else -> try autodiscover.

Set-EWSItem?

So far the module has been a great help. I noticed that the property IsRead is settable once I get an item using Get-EWSItem, but I do not see a Set-EWSItem that might allow me to change the status of a message to 'read'. Is there a trick to it?

Bug in New-EWSContact - $Email overwritten.

Looks like I managed to overwrite one of parameters in the body of the function:

param (
# ...
    [hashtable[]]$Email,
)
# ...
    if ($email = $hash.email) {
# ...

This makes $Email parameter useless. Need to rename local variable to avoid collision.

New-EWSMessage: incorrect info in help

In example 2, it shows content being piped into the command and the -body parameter being used, but according to the source code, $Body and $InputObject are the defining required parameters for their respective parameter sets.

Example 2 should not have -Body 'Mic test: 1... 2... 3...'

Finding this module saved me a ton of work, and you make it look so easy! Great Stuff!

Add tests.

PowerShell module without tests is like bike w/o wheels...

Need to add:
-- global test to ensure code quality/ following certain standards
-- individual tests for all functions

Obvious choice for platform - Pester.

New-EWSFolder fails with ParentName

It's a bug that my colleague came across while creating folders in EWS.

It looks like ParentName is not working as expected and creates folders in a different place than expected.

Repro: connect to another mailbox, use ParentName to specify location of new folder.
Result: folder is created in the user mailbox, instead of mailbox that EWS module is connected to.

Get-EWSFolder should fail on non-existing folders.

Bug: ATM when you specify the path to non-existing folder, you will get the parent folder instead. Dangerous if you want to automate folder creation/deletion.

Repro:

Get-EWSFolder -Path Inbox\SomeRandomTextHere

Expected result: error.
Actual result: Inbox will be returned if SomeRandomTextHere folder does not exist.

Prepare for building using CI

Manual publishing module is not the way to go.

Plan to use AppVeyor for building/ automatic tests/ publishing module to gallery.
Latter from master only, former on all branches.

Get-itemview

Trying to view all result in itemview from a filter. But it seems EWS as a default limit of 1,000 and this script does not provide a way to create a filter that will display all the items as part of the filter.

I read that, there is a limit of 2,147,483,647 as it's data type is Int32, and that one can make set a limit.
It just defines page size of search item, if there are more search item results than the view page size, subsequent calls that use ItemView offsets must be performed to return the rest of the results.

Can we refactor the script to add options to display all items in the results if more are available.

please advise.

New-EWSAppointment requires start/duration, but neither is mandatory parameter.

At the moment New-EWSAppointment requires only subject and body.
But boy, bad things happen if you follow this path:

New-Object : The value supplied is not valid, or the property is read-only. Change the value, and then try again.
At line:61 char:24                                                                                               
+ ... pointment = New-Object Microsoft.Exchange.WebServices.Data.Appointmen ...                                  
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                      
    + CategoryInfo          : InvalidData: (:) [New-Object], Exception                                           
    + FullyQualifiedErrorId : SetValueException,Microsoft.PowerShell.Commands.NewObjectCommand                   

The reason is simple: inside code we do assign values to Start/End, leaving start/duration blank will force PowerShell to assign $null to these properties. Not easy task for DateTime's...

Both parameters should be marked as Mandatory to circumvent this.

Issue with Save-EWSAttachment when name of attachment is not a valid file name.

It looks like I assumed sanity on the mail clients side and/or users and I'm not preventing issues with weird names of attached files (e.g. attachments where name is a full path, or contains characters normally used in the paths).

I'm afraid there isn't any golden solution for that one, but I will at least help work around the problem by replacing all special characters with underscore (_) to at least avoid breaking on this.

Importing Type Microsoft.Exchange.WebServices.Auth Fails

Importing Type Microsoft.Exchange.WebServices.Auth Fails. Catching the exception and getting the loader exception leads to the fact that the assemblies Microsoft.IdentityModel.dll and Microsoft.IdentityModel.Extensions.dll are required as well. I was able to acquire the dlls from Nuget packages and include them in the EWS.psd1 required assemblies, correcting the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.