In this article we will see how we can utilize Microsoft Flows to copy email attachments from Outlook Emails to SharePoint Document Library.

To continue with this demo we can start with adding a document library to SharePoint site, let’s call it “Outlook Attachments”

Now go to Microsoft Flow designer and start with adding a workflow

As I explained in my earlier articles we need to start with selecting a trigger for this workflow

Since we need to copy the email attachments to document library so we have two Cloud Services “Office 365 Outlook” and “SharePoint Online” to deal with

Select “Office 365 Outlook” as connector and “Office 365 Outlook – When a new email arrives” as trigger to kick off this workflow

Choose the Outlook folder or subfolder that you want to monitor. Here I am selecting “Inbox” as target folder. This means workflow will trigger only if the email arrives in Inbox folder and rest of the emails will be ignored.

Set “Has Attachment” = Yes, this settings will further filter out the incoming emails based on if they have attachments or not.

We are only monitoring only emails with attachments and that’s what these filter will achieve for us.

Set “Include Attachments” = Yes, this is required so that Workflow runtime include the binary information of each the attachments and make it available to be written to SharePoint Library.

Add another action with “SharePoint” as connector

Select “SharePoint – Create file” as trigger, this action will be responsible to write down the attachment binaries to SharePoint Library

Enter Site URL where we have “Outlook Attachments” document library sitting

Select document library name from the lookup in the Folder Path Field

Select “Name” property in the File Name field, this property represents the name of the attachment

Select “Content” in the File Content Field, this property will hold the binary data for the attachment being written to the SharePoint Document Libraries.

Here it is important to note that if we does not set the “Include Attachments” = Yes, then Content property will be null and will cause not write operations takes place

Add another action to the workflow, which will be responsible to send email after the attachment has been copied to the SharePoint Library

In this article we will see how to deal with SharePoint Online List Item update event.

For the demo in this article I will consider a business scenario where on update of any Product in the Product list, an approval process will execute and an email is send to approver for the selection of Price Range for the Product just updated.

To start with a demo I have a Product List in SharePoint Online Site as shown below-

Go to “Flow” Menu and Click on “Create a Flow”

Here we have two choices either we can use any available workflow template that suites our requirements or we can create a new one from scratch

For this demo we will create a Flow using blank template

Go to Flow Site by clicking “See you flow” links

Click on “Create from blank” this will launch Workflow Designer

On the Workflow Designer, Select the Trigger

We can select trigger from the any of the available services as shown highlighted below-

Select SharePoint Online as target service & select for the Trigger “SharePoint-When an existing item is modified”

Provide the Title to the Workflow “Product Details Modification Approval Request”

Create SharePoint context by providing Site URL and List Name as shown-

You can optionally rename the Step by selecting “Rename” option as shown below-

Select “Approver Email” in “To”, since this “Approver” is a People Field on SharePoint,

Workflow designer is intelligent enough to represent each property as a separate field

Add a condition to the workflow by clicking “Add a condition”

In the condition we are check if Approver Approved the Production or not.

If Approved then send approval email to requestor else delete the Product and send Email to requestor

Choose “Created By Email” field in “To” as it will hold the Email Id of the Requestor (Person added the Product)

Choose “Approver Email” field in “CC” to send a copy of the mail to Approver also

If not approved, delete the Product by choosing action “SharePoint – Delete item”

In the “Delete item” action specify SharePoint Site Url and List Name

Select “ID” token for the field “Id”. This token will hold the ID of the List Item that trigged the Workflow

After deleting the item we, send email to Requestor by choosing “Created By Email” in “To” field
Specify the body of email as desired
Choose “Approver Email” field in “CC” to send a copy of the mail to Approver also

Once all the actions are configured as required save the workflow by clicking “Save flow”

With this we are all done and now it is time to test the workflow

To test the Workflow, add a new item in the Product List. Specify Title and Approver and Save the Product.

Save action will trigger the Workflow that we just created

As a result of Workflow execution Approve will get the Email with “Approve” and “Reject” options

Beauty of this implementation is that Email contains clickable options for approver to submit the approver’s choices from within the email

Here Approver rejects the Product

As a result of this Rejection, the workflow will delete the Product from the List and send an Email Notification to Requestor and Approver informing same.

Product has been deleted from the list

Now again add a new Product to the list that will again trigger the event to execute the workflow

Product has been added

As a result of Workflow execution Approve will get the Email with “Approve” and “Reject” options

This time Approver approved the Product

As a result of this Approval, the workflow sends an Email Notification to Requestor and Approver informing same.

Security Groups are the crucial part of any system as they define the Authorization on the available resources for the Users requesting access. They are also important to categorize permission boundaries for the set of users at once. So it is really important to streamline the process of managing Security Groups for any system.

Though the management activities are repetitive and boring if we need to repeat same steps again and again over the period of time.

Thankfully we can automate these repetitive tasks using PowerShell Scripts which can take inputs from the CSV or Text Files for the input values and perform necessary actions.

In this article we will discuss the automation scripts required for managing Security Groups in Office 365 using PowerShell.

If you want to follow along then the prerequisite for this article are:

Once the command gets executed successfully, navigate Admin Center => Groups to verify that new group has been added.

It is worth to note that “Default Group Type” for any group added using the above command will be “Security”

How to export all Security Groups

We can export all the Security Groups from the O365 account by using “Get-MsolGroup” command as shown below

Get-MsolGroup

Once the command is executed successfully we can see the details of all the available Security Groups on the Host Window. Alternatively we can export the results to text files by piping the results to “Out-File” command.

How to export all Security Groups filtered by Group Properties

We can export a filtered set of Security Groups from the O365 account based on any property of the Group. In the following example I am using “DisplayName” property to filter the results as shown below

Command

Usage

This command Adds a new User to the O365 Account specified by parameter “UserPrincipalName” and sets its basic properties like “Display Name, Last Name” and so on. It also assigns the license to the user specified by the parameter “LicenseAssignment”.

It is important to note that passing location information as specified by the parameter “UsageLocation” is mandatory as this is used by Microsoft for tracking the location where the service is consumed. This valid value for this parameter could be a two letter country code like for India it should be “IN”

If I execute this command I would get the following error since a free trail O365 account grant me a Single User license only.

If I am having proper license supporting multiple Users, this command would add a new User to my O365 Account.

Output

Modify Existing Users

Command

Usage

Using this command we can modify an existing User in our O365 Account specified by parameter “UserPrincipalName” and providing its properties like “Display Name, Last Name” and so on that needs to be updated.

Output

Once update is performed it might take a couple of minutes to take effect in O365 Account.

User Properties before update command executed:

User Properties after update command executed:

That all for this article on User Management using PowerShell for O365.

All of the above Operations can be automated and using same PowerShell Development paradigms as we followed for On Premise SharePoint Implementations.

Since most of the SharePoint implementation paradigms are moving fast towards the Cloud based hosting so it is now become crucial to hands on with the respective Cloud counterparts of On Premise SharePoint Implementations.

We will see the details on how to setup machine to start working with “SharePoint Online Management Shell” in the upcoming articles but in this article we will see the details on how to setup machine to start working with PowerShell in O365, since SharePoint Online is the part of Office 365 Platform it is utmost necessary to have some understanding on basic operations on O365 first.

Let’s first discuss the prerequisites for configuring PowerShell for O365

Prerequisites

We need to install the following two components in order to get PowerShell working for O365 right from your Windows PowerShell console or SharePoint Management Shell console