Monday, 16 November 2020

Azure AD app via Graph API

 Using an Azure AD app via Graph API - Access SharePoint Data using Postman 

Step-1 : Register an app in Azure AD  

  • Go to ADD in azure portal  

  • Navigate to App registrations --> New Registration --> Provided the proper name --> Create. 

  • Open the created new App  --> go to Certificates & secrets section --> create a new client Secret and save the Value  

 

 

  • Open the create new app again --> go to API permissions --> set the permission  

 

 

  • Finally copy the Directory (tenant) ID & Application (client) ID for overview 

 

Step-2: Postman to generate the token using POST request 

  • Create an environment variables. 
     

Variable        Initial Value 

azureApp_clientId   

  application id copied earlier 

azureApp_clientSecret   

  key copied earlier 

directoryId        

 Id of the Azure Active Directory 

 

  • Access Token Request 

Now that the environment is set up, it’s time to send a POST request to get the token. Create a new request in Postman, name it as “Get Access Token For Graph” and change it’s request type to “POST”. 

The URL will be 

{{directoryId}} is an environment variable. So when we send the request {{directoryId}} will be replaced with the value we specified earlier. 

Click on the “Body” tab of the request and add the following Key Value pairs 

  

KEY        VALUE 

grant_type  

   client_credentials 

client_id     

{{azureApp_clientId}} 

client_secret  

   {{azureApp_clientSecret}} 

scope        

 https://graph.microsoft.com/.default 

 

Now click on “Tests” tab in the request and add the following javascript. 

  

var json = JSON.parse(responseBody); 

postman.setEnvironmentVariable("azureApp_bearerToken", json.access_token); 

  

This code runs after the request is made. It extracts the “access token” from the response, creates an environment variable called “azureApp_bearerToken” and assigns it’s value to the retrieved access token. 

This should have created a variable called “azureApp_bearerToken” in the environment and assigned the value of it to the retrieved token 

 

Step-4 : Postman Get query with Site ID, List ID and access token 

 

Now that we have the site id and list id, let’s create a couple more postman environment variables to store those. 

Variable        Initial Value 

siteId_ModernTeam    

 the site id obtained from graph 

listId_Test       

  List    the list id obtained from graph 

  

We are now ready to make the request to get the list items. To do that create a new GET request in Postman with the name “Get List Items Using Graph”. The URL will be 

  

This should return all the items in the list with their title. 

To specify the access token for the request, click on the “Headers” tab and add the following 

  

KEY        VALUE 

Authorization  

   Bearer {{azureApp_bearerToken}} 

 


Friday, 31 July 2020

Microsoft Lists


Your smart information tracking app across Microsoft 365

 

Microsoft 365 apps - with the broader notion of difference between work management and task management:

 

• Microsoft Lists [Work management, work tracking] | Create, share and track structured information with the ability to create, collect, view, filter, sort, collaborate, share, etc. across status, life cycle, ownership, etc. Lists can further integrate with the Power Platform to design and build productivity apps alongside Power Apps (custom forms) and Power Automate (custom flows); think of Lists then as the underlying database for IW-led 'productivity apps.'

 

• Microsoft To Do [Task management] | For individuals - a complete view of all their tasks, including tasks assigned to them. It is their view on their tasks. When completed, tasks disappear.

 

• Microsoft Planner [Task management] | For the team; task management for the team; tasks assigned to individuals on the team. When completed, tasks disappear.

 

• Microsoft Tasks [Task management] | an app within Teams to help users manage and prioritize their work generated, aggregated tasks from across Microsoft’s portfolio of productivity and collaboration tools: Office docs, Planner plans, emails, chats, and more.

 

• Microsoft Excel [Analysis tool] | Create spreadsheets using built-in tools to help turn data into insights and to visualize via charts and graphs – to help calculate, analyze and predict. In Excel, the individual cell is the focus; related information sits next to each other. With Lists, an entire row is the collective focus; related information with each other. Note: You can import data from Excel, manage with the list and one-way export up-to-date info back in Excel or Power BI for further analysis.

 

On May 20, at the Build 2020 developer conference, Microsoft revealed “Lists,” the newest app for the Microsoft 355 subscription service.

 

Vision for Lists – to highlight how you use it to track issues, manage inventory, build out event agendas, report status, manage FAQs, and more.

 

  • Microsoft Lists home (web) and mobile app – Create new lists, share and access recent and favorite lists in one location

  • Microsoft Teams  Microsoft Lists – Create a new list or embed an existing list directly in a Teams channel - combining lists with side-by-side conversation


  • Ready-made templates help you get started quickly – Jumpstart common scenarios with preconfigured structure, forms, views, and formatting


  • Customizable views, smart rules, and sharing keep everyone in sync – Visualize your information, build if/then rules, and share with confidence



Videos

    





Demo List


Reference

 


Sunday, 16 February 2020

Incoming Email + SharePoint Online


Option 1: Site Mailboxes
This option allows for setting up an Exchange mailbox used to collaborate between team members.  Emails can be sent to the mailbox to be shared among team members.
Advantages
  • Allows end users to create these mailboxes from the SharePoint online ‘Add an app’ page.
  • Permissions set on the SharePoint site are also applied to the mailbox.
Disadvantages
  • Only one mailbox can be created per site.
  • Mail and documents do not live in SharePoint. Data is accessed through Outlook Web Access.
  • Site Mailbox is chosen for you based on the SharePoint site name.
  • Cannot set up event receivers or workflows on the data.
  • Documents and emails are opened in outlook web access, and not SharePoint

Option 2: Office 365 Groups
Uses the Office 365 group functionality to set up a shared work space for collaboration.
Advantages
  • A collaboration space is created to share documents, calendars, conversations.
  • Feature is integrated with your OneDrive for Business site.
Disadvantages
  • Every group creates a new hidden site collection.
  • No workflow options.

Option 3: Azure Logic Apps
Azure Logic Apps can be used to set up connectors between an Office 365 mailbox and a SharePoint list.
Advantages
  • Processes email within a mailbox to the associated SharePoint list.
Disadvantages
  • Must have an Azure subscription.
  • Must pay licensing fee for Logic Apps.
  • Requires setting up a new user and mailbox for each list (requires user to be licensed for Exchange Online and SharePoint Online).

Option 4: Microsoft Flow
Microsoft Flow is a feature offered in Office 365 to allow processing email messages in Office 365 to SharePoint libraries.
Advantages
  • Can process email attachments from an Office 365 mailbox into SharePoint.
  • Can configure to use one mailbox to process to many different lists.
Disadvantages
  • Requires setting up a user to go with a mailbox in Office 365 (requires user to be licensed for Exchange Online and SharePoint Online).
  • Only has template for email attachment. No current offering to save the email itself.
  • Additional cost per user for Microsoft Flow Licensing.


Other More Option:- 

Nintex Workflow - CodeBinaryOperatorExpression


. NET security patch (KB 4457035) was installed into SharePoint servers due to this patch all the SharePoint workflows stop working.





Error Message:-
0x22FC SharePoint Foundation Workflow Infrastructure 72fs Unexpected RunWorkflow: Microsoft.SharePoint.SPException: System.CodeDom.CodeBinaryOperatorExpression is not marked as authorized in the application configuration file."
/>

The error suggest that System.CodeDom.CodeBinaryOperatorExpression is not in the authorized types. The type is already there and even if you include when it is missing, the error will not go away.

Solution :-
The solution is to add explicitly the namespace to the all web applications' web.config:
       

Reference :-




Saturday, 15 February 2020

Accessible Tables for Nintex Workflow History


  • WorkflowInstance - One record for each workflow instance that runs
  • WorkflowProgress - Two records for each action that runs in an instance. There is a 'before' and 'after' record for each action to record how long it takes. WorkflowProgress records link back to WorkflowInstance by an InstanceID.
  • HumanWorkflow - One record for each workflow action that creates user tasks (request approval, flexi task, etc). Links back to a workflowprogress record.
  • HumanWorkflowApprovers - One record for each individual approver assigned to a task. Links back to a HumanWorkflow record.
  • DelegationHistory - One record for each time a task is delegated. Links back to an HumanWorkflowApprovers record.

PS: SharePoint Update the Document Set


Content types that are available to this Document Set have been added or removed. Update the Document Set.

Sometimes when we click on a document set and within the same we see a yellow line reading
Content types that are available to this Document Set have been added or removed. Update the Document Set.
The reason behind it is that this document set is not created using the OOB way but using some kind of code practices. Ideal way to create document set is by using

– DocumentSet.CreateDocumentSet

which sets the docset_LastRefresh property.

Also if you are using any custom code to create the Document Set then during creation of the doc set sometime properties not setup properly so for this type of case you can easily update the doc set for the below script :-

 Add-PsSnapin Microsoft.SharePoint.PowerShell
  $webUrl="http://sitecoll/site/ABC"
    $web = Get-SPWeb -Identity $webUrl
    $lib=$web.Lists["ABC"]
       foreach($item in $lib.Items | Where-Object {$_.Folder -ne $null -and $_.ID -eq "18"})
        {
         Write-Host "Provisioning " $item.Name
         Write-Host $item.Folder.Properties["docset_LastRefresh"]
            if ($item.Folder.Properties["docset_LastRefresh"] -eq $Null) 
            {
                Write-Host "Provisioning " $item.Name   -ForegroundColor Green
                $ds = [Microsoft.Office.DocumentManagement.DocumentSets.DocumentSet]::GetDocumentSet($item.Folder)
                $ds.Provision()
            }
        }
    $web.Dispose()


In case, if you are not sure about the last refresh for document set happened or not then just update the document set without condition check:-

Add-PsSnapin
Microsoft.SharePoint.PowerShell
  $webUrl="http://sitecoll/site/ABC"
    $web = Get-SPWeb -Identity $webUrl
    $lib=$web.Lists["ABC"]
       foreach($item in $lib.Items | Where-Object {$_.Folder -ne $null -and $_.ID -eq "18"})
        {
         Write-Host "Provisioning " $item.Name
         Write-Host $item.Folder.Properties["docset_LastRefresh"]
                Write-Host "Provisioning " $item.Name   -ForegroundColor Green
                $ds = [Microsoft.Office.DocumentManagement.DocumentSets.DocumentSet]::GetDocumentSet($item.Folder)
                $ds.Provision()
        }
    $web.Dispose()

Nintex Workflow Deployment - Retract & GAC


Instructions for Nintex Workflow only:-

•Go to Services.msc » Stop these services on all servers where it is running.

- Nintex Live Relay Service (Not user Live Service in our regions)

- Nintex Live Workflow Queue Service (Not user Live Service in our regions)

- Nintex Workflow Start Service

•In Cent. Admin, retract all Nintex Workflow solutions in the following order, waiting for each one to retract before moving to the next:

1. nintexworkflow2013enterprisefeaturesbackwardscompat.wsp (Used if you have any sites running in 2010 mode, Retracts from each web app, then Central Admin web app).

2. nintexworkflow2013backwardscompatibilityui.wsp (Retracted globally, used if you have any sites running in 2010 mode).

3. nintexworkflow2013enterprisefeatures.wsp (First all web apps, then Central Admin App)

4. nintexworfklow2013.wsp (First all web apps, then Central Admin App)

5. nintexworkflow2013core.wsp (Retracted globally).

6. Nintexcommon.wsp(Retracted globally)

•Remove all retracted Nintex Workflow Solutions and Forms Solutions .

•Delete all Nintex Workflow assemblies from GAC_MSIL on all servers: C:\Windows\Microsoft.NET\assembly\GAC_MSIL, Please confirm the below



•Run the installer with the correct User account as Administrator. Refer to page 9 of Installing Nintex Workflow 2013 to ensure the correct permissions are deployed.

•Go to Cent. Admin > System Settings > Manage Farm Solutions and verify that the following solutions have been deployed. If deploying manually, this is the deployment order

1. nintexcommon.wsp (deployed globally)

2. nintexworkflow2013core.wsp (Deployed globally)

3. nintexworfklow2013.wsp (First deploy to your Central Admin, then the rest of the web apps)

4. nintexworkflow2013enterprisefeatures.wsp (First deploy to your Central Admin, if you have enterprise edition of Nintex Workflow, then the rest of the web apps)

5. nintexworkflow2013enterprisefeaturesbackwardscompat.wsp (If you have any sites running in 2010 mode, deploy to those web apps, otherwise skip)

6. nintexworkflow2013backwardscompatibilityui.wsp (If you have any sites running in 2010 mode, deploy to those web apps, otherwise skip)


For reference - https://community.nintex.com/t5/How-To-s/How-to-retract-and-remove-Gac-files-for-Nintex-Workflow-and/ta-p/89703