SharePoint Online: How to acces the Change Log in a Site Collection (II)!

Continuing the series of articles on how to access the Changes Log in SharePoint Online, this time I will show you how to obtain this information by using the following PowerShell script that you can download from: How to read the Changes Log for a SharePoint Online Site Collection

$host.Runspace.ThreadOptions = "ReuseThread"

 

#Definition of the function that gets changes available in the Changes Log for a SharePoint Online Site Collection

function Get-SPOChangesLogForSC

{

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

    try

    {    

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

        Write-Host "Getting all changes in a SharePoint Online Site Collection" -foregroundcolor Green

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

     

        #Adding the Client OM Assemblies        

                #Adding the Client OM Assemblies

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

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

        Add-Type -Path $sCSOMPath         

        Add-Type -Path $sCSOMRuntimePath       

 

        #SPO Client Object Model Context

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

        $spoCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($sUsername, $sPassword)  

        $spoCtx.Credentials = $spoCredentials 

 

        #Root Web Site

        $spoRootWebSite = $spoCtx.Web

        $spoCtx.Load($spoRootWebSite)

        $spoCtx.ExecuteQuery()

        Write-Host "Accessing the Change Log for " $spoRootWebSite.Title " - " $spoRootWebSite.Url

        

        #Getting changes in the Change Log

        $spocChangeQuery = New-Object Microsoft.SharePoint.Client.ChangeQuery($true,$true)

        $spocChangesCollection=$spoCtx.Site.GetChanges($spocChangeQuery)

        $spoCtx.Load($spocChangesCollection)

        $spoCtx.ExecuteQuery()

                

        #We need to iterate through the $spcChangesCollection Object in order to get the Changes from the Change Log

        Write-Host "# of Changes found in the first batch " $spocChangesCollection.Count

        

        foreach($spocChange in $spocChangesCollection){

            Write-Host "Change Type: " $spocChange.ChangeType " - Object Type: " $spocChange.TypedObject " - Change Date: " $spocChange.Time  -Foregroundcolor White

        }

        

        $spoCtx.Dispose()

    }

    catch [System.Exception]

    {

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

    }    

}

 

#Required Parameters

$sSiteColUrl = "https://<O365Domain>.sharepoint.com/sites/<SiteCollection>" 

$sUserName = "<O365User>@<O365Domain>.onmicrosoft.com" 

$sPassword = Read-Host -Prompt "Enter your password: " -AsSecureString

$sCSOMPath="<CSOM_Path>"

 

Get-SPOChangesLogForSC -sCSOMPath $sCSOMPath -sSiteColUrl $sSiteColUrl -sUserName $sUserName -sPassword $sPassword

The output you will get after executing the script is the following one:

image

SharePoint Online: Como acceder al log de cambios (II)!

Siguiendo con la serie de artículos sobre como acceder al log de cambios en SharePoint Online, en esta ocasión vamos a ver como obtener dicha información por medio de PowerShell haciendo uso del siguiente script que os podéis descargar desde: How to read the Changes Log for a SharePoint Online Site Collection

$host.Runspace.ThreadOptions = "ReuseThread"

 

#Definition of the function that gets changes available in the Changes Log for a SharePoint Online Site Collection

function Get-SPOChangesLogForSC

{

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

    try

    {    

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

        Write-Host "Getting all changes in a SharePoint Online Site Collection" -foregroundcolor Green

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

     

        #Adding the Client OM Assemblies        

                #Adding the Client OM Assemblies

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

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

        Add-Type -Path $sCSOMPath         

        Add-Type -Path $sCSOMRuntimePath       

 

        #SPO Client Object Model Context

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

        $spoCredentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($sUsername, $sPassword)  

        $spoCtx.Credentials = $spoCredentials 

 

        #Root Web Site

        $spoRootWebSite = $spoCtx.Web

        $spoCtx.Load($spoRootWebSite)

        $spoCtx.ExecuteQuery()

        Write-Host "Accessing the Change Log for " $spoRootWebSite.Title " - " $spoRootWebSite.Url

        

        #Getting changes in the Change Log

        $spocChangeQuery = New-Object Microsoft.SharePoint.Client.ChangeQuery($true,$true)

        $spocChangesCollection=$spoCtx.Site.GetChanges($spocChangeQuery)

        $spoCtx.Load($spocChangesCollection)

        $spoCtx.ExecuteQuery()

                

        #We need to iterate through the $spcChangesCollection Object in order to get the Changes from the Change Log

        Write-Host "# of Changes found in the first batch " $spocChangesCollection.Count

        

        foreach($spocChange in $spocChangesCollection){

            Write-Host "Change Type: " $spocChange.ChangeType " - Object Type: " $spocChange.TypedObject " - Change Date: " $spocChange.Time  -Foregroundcolor White

        }

        

        $spoCtx.Dispose()

    }

    catch [System.Exception]

    {

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

    }    

}

 

#Required Parameters

$sSiteColUrl = "https://<O365Domain>.sharepoint.com/sites/<SiteCollection>" 

$sUserName = "<O365User>@<O365Domain>.onmicrosoft.com" 

$sPassword = Read-Host -Prompt "Enter your password: " -AsSecureString

$sCSOMPath="<CSOM_Path>"

 

Get-SPOChangesLogForSC -sCSOMPath $sCSOMPath -sSiteColUrl $sSiteColUrl -sUserName $sUserName -sPassword $sPassword

La salida por pantalla correspondiente es:

image

[Eventos]: Registro abierto para las sesiones y los Workshops de CEUS By Iberian SharePoint Conference!

Poco a poco vamos quemando etapas en el camino que nos llevará a realizar los próximos 9 y 10 de junio el evento CEUS By Iberian SharePoint Conference, o lo que es lo  mismo el evento de productividad más importante de España en 2015 que será continuación de la conferencia Microsoft Iginite que se realizará a principios de mayo en Chicago. En esta ocasión, nos complace anunciaros que ya tenemos abierto el registro tanto para la conferencia (sesiones del día 10 de junio) como para los Workshops (que se realizarán durante la mañana del día 9 de junio). Los enlaces de registro son los siguientes:

En breve os iremos dando detalles tanto del contenido de los Workshops como de la agenda que estamos preparando para el evento en el que además tendréis la oportunidad de charlar y conocer las soluciones y servicios de productividad de las empresas más importantes de España y de fuera de España en ese campo.

image

SharePoint OnPremises & Online: ¿Qué restricciones aplican en las longitudes de las Urls?

Esta es la pregunta que hacía el otro día en uno de los foros sobre SharePoint y Office 365 que suelo seguir. La respuesta, que podéis encontrar detallada en el siguiente enlace https://technet.microsoft.com/en-us/library/ff919564(v=office.14).aspx, es la siguiente (Nota: Los límites detallados son para SharePoint 2010, pero aplican también en SharePoint 2013):

The total length of the URL path to a folder or a file in SharePoint Server 2010 but not to the length of any parameters. Also, these limitations apply only to un-encoded URLs, not to encoded URLs. There is no limit to encoded URLs in SharePoint Server 2010. The limitations are the following:

  • 260 Unicode (UTF-16) code units – the characters in a full file path, not including a domain/server name.
  • 256 Unicode (UTF-16) code units – the characters in a full folder path, not including the file name and the domain/server name.
  • 128 Unicode (UTF-16) code units – characters in a path component, that is, a file or folder name.
  • 260 Unicode (UTF-16) code units – the characters in a full path, including a domain/server name for use with Office clients.
  • 256 Unicode (UTF-16) code units – the characters in a full path including the domain/server name, for use with Active X controls.

Otras referencias:

Office 365: Como dejar de compartir mi actividad con otros usuarios en Delve!

Una de las últimas novedades que podemos encontrarnos en Delve es que a nivel de configuración cada usuario tiene opción de dejar de compartir su actividad con otros usuarios de la organización:

  • Dentro de las opciones de configuración, hacemos clic en la opción “Se está compartiendo la actividad” (“Sharing Activity”).
  • A continuación, se muestra un panel que nos permite deshabilitar que nuestra actividad sea visible por otros usuarios lo que también implica que no veamos la actividad de otros usuarios.

image

image

OneDrive para Empresas: Nueva opción Mover/Copiar en el menú de elemento!

Una de las últimas incorporaciones a nivel funcional que tenemos en OneDrive para Empresas es una nueva opción de Mover / Copiar que además se incorporará de forma general a SharePoint Online:

  • En las opciones del menú contextual de cualquier documento almacenado en OneDrive veremos que aparece una nueva opción Move or Copy (Mover o Copiar).
  • Esta opción simplemente nos permite mover el documento a una carpeta de OneDrive.

image

image

Referencias:

SharePoint Online: How to acces the Change Log in a Site Collection (I)!

As in SharePoint OnPremises, in SharePoint Online you can access the Changes Log at different levels: Site Collection, Site and List / Library since we have available a number of objects and methods in the Client Side Object Model that help us to read the Changes Log such as:

In this post we will see how easily we can access the Changes Log for a SharePoint Online Site Collection using a Console Application Program:

  • In Visual Studio 2013, create a Console Application project and add references to Microsoft.SharePoint.Client, Microsoft.SharePoint.Client.Runtime, System.Configuration and Sistem.Web.
  • In Program.cs, add the following using directives:
using SPCSOM = Microsoft.SharePoint.Client;

using System.Net;

using System.Configuration;

using System.Security;

  • In the App.Config file, add the parameters (SharePoint Online credentials) required to connect to the SharePoint Online Site Collection:

<appSettings>

  <add key="SPOUser" value="SPOUser"/>

  <add key="SPOPassword" value="SPOPassword"/>

</appSettings>

  • Next add a static method to Program.cs in which you the objects and methods of CSOM that allow you to access the Change Log for a SharePoint Online Site Collection: the ChangeQuery class (allows us to see the Changes Log), ChangeCollection class (it provides a collection of changes), the GetChanges () method of the Site object and finally Change class:

static void QuerySPOSiteCChangeLog()

{

    try

    {

        string sSiteUrl = 

            "https://nuberosnet.sharepoint.com/sites/SPSaturdayCol/";

        using (SPCSOM.ClientContext spoCtx = new SPCSOM.ClientContext(sSiteUrl))

        {

            //

            //SharePoint Online Credentials

            //

            string sSPOUser =

                ConfigurationManager.AppSettings["SPOUser"];

            string sPassword =

                ConfigurationManager.AppSettings["SPOPassword"];

            SecureString ssPassword = new SecureString();

            foreach (char c in sPassword.ToCharArray())

                ssPassword.AppendChar(c);

            spoCtx.Credentials =

                new SPCSOM.SharePointOnlineCredentials(

                    sSPOUser, ssPassword);

 

            spoCtx.Load(spoCtx.Web, web => web.Title);

            spoCtx.Load(spoCtx.Web, web => web.Url);

            spoCtx.ExecuteQuery();

 

            Console.WriteLine("Accessing to the audit log for {0} - {1}", 

                spoCtx.Web.Title, spoCtx.Web.Url);

            SPCSOM.ChangeQuery cqChangeQuery = 

                new SPCSOM.ChangeQuery(true,true);

 

            SPCSOM.ChangeCollection ccChangeCollection = 

                spoCtx.Site.GetChanges(cqChangeQuery);

            spoCtx.Load(ccChangeCollection);

            spoCtx.ExecuteQuery();

 

            Console.WriteLine("# of Changes found in the first batch {0}", 

                ccChangeCollection.Count);

 

                foreach (SPCSOM.Change cChange in ccChangeCollection)

                {

                    Console.WriteLine("Change Type: {0} - Object Type: {1} - Change Time: {2}",

                        cChange.ChangeType, cChange.TypedObject, cChange.Time);

                }

        }

    }

    catch (Exception ex)

    {

        Console.WriteLine("Error: {0}", ex.Message);

    }

}

  • As a result of executing the Console Application, you will get a series of changes from the Change Log. For each change you will get information such as the change type, the affected object and the change time.

image

Other references: