Office 365: La actividad de Yammer llega a Delve!

Siempre que puedo, trato de revisar si en alguno de los nuevos servicios y funcionalidades de Office 365 (como Delve u Office 365 video) hay alguna novedad destacable…y normalmente me encuentro con alguna sorpresa. En esta ocasión, la sorpresa que me he encontrado es qué la actividad generada por Yammer ya está siendo capturada por Delve y como caso práctico os voy a describir como dicha actividad es recogida en el tenant de Office 365 de MVP CLUSTER:

  • En primer lugar, os pongo en contexto: en nuestro MVP CLUSTER estamos haciendo uso a día de hoy de la totalidad de los servicios que forman parte de Office 365, incluyendo Yammer y Microsoft Dynamics CRM Online…la razón de que hable sobre estos dos servicios es porque es posible integrarlos de forma que la actividad generada en el CRM en torno a oportunidades de proyectos sea reflejada en conversaciones de Yammer de forma que estas continúen allí una vez se han iniciado. En nuestro caso, gracias a Mr. Rafa Ansino (@ransino) tenemos configurada dicha integración de forma que Delve muestra las conversaciones de Yammer que tienen origen en el CRM.
  • Si hacemos clic en una de esas conversaciones, seremos redirigidos a su fuente: la conversación iniciada desde el CRM!!!

image

image

SharePoint 2013: How to use the Workflows Client Object Model (I)!

Among the different possibilities provided by the Client Object Model in SharePoint 2013, we have the ability to interact with the Workflows deployed in a fram using the specific CSOM assembly that for SharePoint 2013 Service Pack 1 (SP1) is available in the path: C:\Program Files \Common Files\microsoft shared\web Server Extensions\16\ISAPI. Specifically, the assembly to be used is Microsoft.SharePoint.Client.WorkflowServices.dll. As an example of how to use CSOM for SharePoint 2013 Workflows, the following script allows to get the execution status of all Workflow deployed in a SharePoint 2013 OnPremises farm (for SharePoint Online, the idea is the same). The script can be downloaded from the following URL: How get the workflow execution status for all the workflows in a SharePoint Site

$host.Runspace.ThreadOptions = "ReuseThread"

 

#Definition of the function that gets the workflow execution status for all the workflows deployed to a SharePoint Site

function Get-SPSitesInSC

{

    param ($sSiteColUrl,$sUserName,$sDomain,$sPassword,$sCSOMPath)

    try

    {    

        Write-Host "-----------------------------------------------------------------------------------"  -foregroundcolor Green

        Write-Host "Getting the workflow execution status for all the workflows deployed in sSiteColUrl" -foregroundcolor Green

        Write-Host "-----------------------------------------------------------------------------------"  -foregroundcolor Green

     

        #Adding the Client OM Assemblies

        $sCSOMRuntimePath=$sCSOMPath +  "\Microsoft.SharePoint.Client.Runtime.dll"

        $sCSOMWorkflowPath=$sCSOMPath + "\Microsoft.SharePoint.Client.WorkflowServices.dll"

        $sCSOMPath=$sCSOMPath +  "\Microsoft.SharePoint.Client.dll"             

        Add-Type -Path $sCSOMPath         

        Add-Type -Path $sCSOMRuntimePath

        Add-Type -Path $sCSOMWorkflowPath

 

        #SharePoint Client Object Model Context

        $spCtx = New-Object Microsoft.SharePoint.Client.ClientContext($sSiteColUrl) 

        $spCredentials = New-Object System.Net.NetworkCredential($sUserName,$sPassword,$sDomain)  

        $spCtx.Credentials = $spCredentials 

 

        if (!$spCtx.ServerObjectIsNull.Value) 

        {

            $spWeb = $spCtx.Web

            $spLists = $spWeb.Lists

            $spCtx.Load($spLists);

            $spCtx.ExecuteQuery();

 

            $spWorkflowServicesManager = New-Object Microsoft.SharePoint.Client.WorkflowServices.WorkflowServicesManager($spCtx, $spWeb);

            $spWorkflowSubscriptionService = $spWorkflowServicesManager.GetWorkflowSubscriptionService();

            $spWorkflowInstanceSevice = $spWorkflowServicesManager.GetWorkflowInstanceService();

            

            Write-Host ""

            Write-Host "Getting all the Lists in $sSiteColUrl" -ForegroundColor Green

            Write-Host ""

 

            foreach ($spList in $spLists)         

            {   

                $spWorkflowSubscriptions = $spWorkflowSubscriptionService.EnumerateSubscriptionsByList($spList.Id);

                $spCtx.Load($spWorkflowSubscriptions);                

                $spCtx.ExecuteQuery();                

                foreach($spWorkflowSubscription in $spWorkflowSubscriptions)

                {            

                    Write-Host "**************************************************************************************"

                    Write-Host "List: "$spList.Title " - Workflow: "$spWorkflowSubscription.Name -ForegroundColor Green

                    Write-Host "***************************************************************************************"

                    Write-Host ""

 

                    $spCamlQuery = New-Object Microsoft.SharePoint.Client.CamlQuery

                    $spCamlQuery.ViewXml = "<View> <ViewFields><FieldRef Name='Title' /></ViewFields></View>";

                    $spListItems = $spList.GetItems($spCamlQuery);

                    $spCtx.Load($spListItems);

                    $spCtx.ExecuteQuery();

 

                    foreach($spListItem in $spListItems)

                    {

                        $spWorkflowInstanceCollection = $spWorkflowInstanceSevice.EnumerateInstancesForListItem($spList.Id,$spListItem.Id);

                        $spCtx.Load($spWorkflowInstanceCollection);

                        $spCtx.ExecuteQuery();

                        foreach ($spWorkflowInstance in $spWorkflowInstanceCollection)

                        {

                           Write-Host "List Item Title:"$spListItem["Title"] 

                           Write-Host "Workflow Status:"$spWorkflowInstance.Status 

                           Write-Host "Last Workflow Execution:"$spWorkflowInstance.LastUpdated

                           Write-Host ""

                        }

                    }                   

                    Write-Host ""

                }

            }

              

            $spCtx.Dispose() 

        }        

    }

    catch [System.Exception]

    {

        write-host -f red $_.Exception.ToString()   

    }    

}

 

#Required Parameters

$sSiteColUrl = "http://<SiteUrl>/" 

$sUserName = "<SharePointUser>" 

$sDomain="<OnPremisesDomain>"

$sPassword ="<Password>" 

$sCSOMPath="C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI"

 

Get-SPSitesInSC -sSiteColUrl $sSiteColUrl -sUserName $sUserName -sDomain $sDomain -sPassword $sPassword -sCSOMPath $sCSOMPath

The screen output obtained as a result of using the above method is:

image

And that’s all about how to use Workflows CSOM for SharePoint 2013 in PowerShell. In the next article I will show you how to do the same using .NET Code.