зеркало из
1
0
Форкнуть 0
This commit is contained in:
Alek 2021-09-02 11:00:16 -05:00
Родитель 37013b8deb
Коммит 2af3bf3989
47 изменённых файлов: 20839 добавлений и 0 удалений

63
.gitattributes поставляемый Normal file
Просмотреть файл

@ -0,0 +1,63 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain

13
Analysis/Analysis.cs Normal file
Просмотреть файл

@ -0,0 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Analysis
{
public class Analysis
{
}
}

52
Analysis/Analysis.csproj Normal file
Просмотреть файл

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{11F9C187-6E26-43CC-AA57-B82049101ECC}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Analysis</RootNamespace>
<AssemblyName>Analysis</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.SharePoint.Client, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Common\ReferenceDLLs\Microsoft.SharePoint.Client.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Analysis.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Analysis")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Analysis")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("11f9c187-6e26-43cc-aa57-b82049101ecc")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

248
Common/Common.csproj Normal file
Просмотреть файл

@ -0,0 +1,248 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{04A36617-4353-4779-92F9-36BAFFE6A5F6}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Common</RootNamespace>
<AssemblyName>Microsoft.Services.WorkflowAssessment.Common</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AngleSharp, Version=0.9.9.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea, processorArchitecture=MSIL">
<HintPath>..\packages\AngleSharp.0.9.9\lib\net45\AngleSharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ActiveDirectory.GraphClient, Version=2.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.ActiveDirectory.GraphClient.2.1.0\lib\portable-net4+sl5+win+wpa+wp8\Microsoft.Azure.ActiveDirectory.GraphClient.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.KeyVault.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Graph, Version=1.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Graph.1.9.0\lib\net45\Microsoft.Graph.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Graph.Core, Version=1.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Graph.Core.1.9.0\lib\net45\Microsoft.Graph.Core.dll</HintPath>
</Reference>
<Reference Include="microsoft.identitymodel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.7.0.0\lib\net35\microsoft.identitymodel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.8.16603, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.19.8.16603, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.5.2.4\lib\net451\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Logging, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Logging.5.2.4\lib\net451\Microsoft.IdentityModel.Logging.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Tokens, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.5.2.4\lib\net451\Microsoft.IdentityModel.Tokens.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Client.Policy, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Office.Client.Policy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Client.TranslationServices, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Office.Client.TranslationServices.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.SharePoint.Tools, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Office.SharePoint.Tools.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Online.SharePoint.Client.Tenant, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Online.SharePoint.Client.Tenant.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProjectServer.Client, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.ProjectServer.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.DocumentManagement, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.DocumentManagement.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Publishing, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Publishing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Runtime, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Runtime.Windows, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Runtime.Windows.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Search, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Search.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Search.Applications, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Search.Applications.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Taxonomy, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Taxonomy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.UserProfiles, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.UserProfiles.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.WorkflowServices, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.WorkflowServices.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAzure.Storage.7.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="OfficeDevPnP.Core, Version=3.24.2008.1, Culture=neutral, PublicKeyToken=5e633289e95c321a, processorArchitecture=MSIL">
<HintPath>..\packages\SharePointPnPCoreOnline.3.24.2008.1\lib\net461\OfficeDevPnP.Core.dll</HintPath>
</Reference>
<Reference Include="SharePointPnP.IdentityModel.Extensions, Version=1.2.4.0, Culture=neutral, PublicKeyToken=5e633289e95c321a, processorArchitecture=MSIL">
<HintPath>..\packages\SharePointPnP.IdentityModel.Extensions.1.2.4\lib\net45\SharePointPnP.IdentityModel.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IdentityModel" />
<Reference Include="System.IdentityModel.Selectors" />
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.5.2.4\lib\net451\System.IdentityModel.Tokens.Jwt.dll</HintPath>
</Reference>
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0\lib\net4\System.Management.Automation.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.1\lib\net46\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.ServiceModel" />
<Reference Include="System.Spatial, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.4.7.1\lib\net461\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.4.7.2\lib\net461\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CompareWorkflows.cs" />
<Compile Include="DiscoverBase.cs" />
<Compile Include="Extensions.cs" />
<Compile Include="IBaseAnalyzer.cs" />
<Compile Include="Scan.cs" />
<Compile Include="sp2010wfmodel.cs">
<DependentUpon>sp2010wfmodel.xsd</DependentUpon>
</Compile>
<Compile Include="sp2013wfmodel.cs">
<DependentUpon>sp2013wfmodel.xsd</DependentUpon>
</Compile>
<Compile Include="WebpartMappingLoader.cs" />
<Compile Include="WorkflowActionAnalysis.cs" />
<Compile Include="WorkflowActions.cs" />
<Compile Include="WorkflowCommon.cs" />
<Compile Include="Logging.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WorkflowScanResult.cs" />
<Compile Include="WorkflowTriggerAnalysis.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
<None Include="sp2010wfmodel.xsd">
<SubType>Designer</SubType>
</None>
<None Include="sp2013wfmodel.xsd">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Content Include="ReferenceDLLs\Microsoft.SharePoint.Client.dll" />
<Content Include="ReferenceDLLs\Microsoft.SharePoint.Client.Runtime.dll" />
<Content Include="ReferenceDLLs\Microsoft.SharePoint.dll" />
<EmbeddedResource Include="sp2013wfmodel.xml" />
<EmbeddedResource Include="sp2010wfmodel.xml" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,19 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common
{
public class CompareWorkflows
{
public void CompareWorkflowsToPowerAutomate(string outputDirectory)
{
try
{ }
catch (Exception ex)
{ }
}
}
}

66
Common/DiscoverBase.cs Normal file
Просмотреть файл

@ -0,0 +1,66 @@
using Microsoft.SharePoint.Client;
using System;
namespace Common
{
public abstract class DiscoverBase : IBaseAnalyzer
{
private string url;
private string siteColUrl;
/// <summary>
/// Base constructor
/// </summary>
/// <param name="url">Url of the current web</param>
/// <param name="siteColUrl">url of the current site collection</param>
public DiscoverBase(string url, string siteColUrl)
{
this.url = url;
this.siteColUrl = siteColUrl;
}
/// <summary>
/// Scan start time
/// </summary>
public DateTime StartTime { get; set; }
/// <summary>
/// Scan stop time
/// </summary>
public DateTime StopTime { get; set; }
/// <summary>
/// Site collection url being scanned
/// </summary>
public string SiteCollectionUrl
{
get
{
return this.siteColUrl;
}
}
/// <summary>
/// Site being scanned
/// </summary>
public string SiteUrl
{
get
{
return this.url;
}
}
/// <summary>
/// Virtual Analyze method
/// </summary>
/// <param name="cc">ClientContext of the web to be analyzed</param>
/// <returns>Duration of the analysis</returns>
public virtual TimeSpan Analyze(ClientContext cc)
{
this.StartTime = DateTime.Now;
return new TimeSpan();
}
}
}

124
Common/Extensions.cs Normal file
Просмотреть файл

@ -0,0 +1,124 @@
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace Common
{
public static partial class WebExtensions
{
/// <summary>
/// Gets a list of SharePoint lists to scan for modern compatibility
/// </summary>
/// <param name="web">Web to check</param>
/// <returns>List of SharePoint lists to scan</returns>
public static List<List> GetListsToScan(this Microsoft.SharePoint.Client.Web web, bool showHidden = false)
{
List<List> lists = new List<List>(10);
// Ensure timeout is set on current context as this can be an operation that times out
web.Context.RequestTimeout = Timeout.Infinite;
ListCollection listCollection = web.Lists;
listCollection.EnsureProperties(coll => coll.Include(li => li.Id, li => li.ForceCheckout, li => li.Title, li => li.Hidden, li => li.DefaultViewUrl,
li => li.BaseTemplate, li => li.RootFolder, li => li.ListExperienceOptions, li => li.ItemCount,
li => li.UserCustomActions, li => li.LastItemUserModifiedDate));
// Let's process the visible lists
IQueryable<List> listsToReturn = null;
if (showHidden)
{
listsToReturn = listCollection;
}
else
{
listsToReturn = listCollection.Where(p => p.Hidden == false);
}
foreach (List list in listsToReturn)
{
if (list.DefaultViewUrl.Contains("_catalogs"))
{
// skip catalogs
continue;
}
if (list.BaseTemplate == 544)
{
// skip MicroFeed (544)
continue;
}
lists.Add(list);
}
return lists;
}
}
public static class SiteExtensions
{
/// <summary>
/// Gets all sub sites for a given site
/// </summary>
/// <param name="site">Site to find all sub site for</param>
/// <returns>IEnumerable of strings holding the sub site urls</returns>
public static IEnumerable<string> GetAllSubSites(this Site site)
{
var siteContext = site.Context;
siteContext.Load(site, s => s.Url);
try
{
siteContext.ExecuteQueryRetry();
}
catch (System.Net.WebException clientException)
{
Console.WriteLine(clientException.Message.ToString());
yield break;
}
catch (Microsoft.SharePoint.Client.ServerUnauthorizedAccessException unauthorizedException)
{
Console.WriteLine(unauthorizedException.Message.ToString());
yield break;
}
var queue = new Queue<string>();
queue.Enqueue(site.Url);
while (queue.Count > 0)
{
var currentUrl = queue.Dequeue();
try
{
using (var webContext = siteContext.Clone(currentUrl))
{
webContext.Load(webContext.Web, web => web.Webs.Include(w => w.Url, w => w.WebTemplate));
webContext.ExecuteQueryRetry();
foreach (var subWeb in webContext.Web.Webs)
{
// Ensure these props are loaded...sometimes the initial load did not handle this
subWeb.EnsureProperties(s => s.Url, s => s.WebTemplate);
// Don't dive into App webs and Access Services web apps
if (!subWeb.WebTemplate.Equals("App", StringComparison.InvariantCultureIgnoreCase) &&
!subWeb.WebTemplate.Equals("ACCSVC", StringComparison.InvariantCultureIgnoreCase))
{
queue.Enqueue(subWeb.Url);
}
}
}
}
catch (Exception)
{
// Eat exceptions when certain subsites aren't accessible, better this then breaking the complete fMedium
}
yield return currentUrl;
}
}
}
}

19
Common/IBaseAnalyzer.cs Normal file
Просмотреть файл

@ -0,0 +1,19 @@
using Microsoft.SharePoint.Client;
using System;
namespace Common
{
/// <summary>
/// Interface that all analyzers need to implement
/// </summary>
public interface IBaseAnalyzer
{
/// <summary>
/// Analyzer run
/// </summary>
/// <param name="cc">ClientContext of the web to be analyzed</param>
/// <returns>Duration of the analysis</returns>
TimeSpan Analyze(ClientContext cc);
}
}

175
Common/Logging.cs Normal file
Просмотреть файл

@ -0,0 +1,175 @@
using System.Web;
using System.Data;
//using System.Web.Security;
//using System.Web.UI;
//using System.Web.UI.WebControls;
//using System.Web.UI.HtmlControls;
//using Microsoft.SharePoint;
using System.Text;
using System.Collections.Generic;
using System;
using System.Globalization;
using System.ComponentModel;
using System.IO;
using System.Xml;
using System.Collections;
using System.Configuration;
using System.Diagnostics;
using System.Security;
using System.Security.Policy;
using System.Security.Principal;
using System.Security.Permissions;
using System.Runtime.InteropServices;
namespace Common
{
public class Logging
{
#region class properties
public static string LOG_DIRECTORY { get; set; }
//public string LOG_DIRECTORY { get; set; }
public const string Info = "INFO";
public const string Error = "ERROR";
private string logFolderPath = LOG_DIRECTORY;
private string LogFolderPath
{
get
{
return logFolderPath;
}
set
{
if (Directory.Exists(value))
{
logFolderPath = value;
if (logFolderPath.EndsWith("\\"))
{
logFolderPath = logFolderPath.Remove(logFolderPath.Length);
}
}
else
{
throw new DirectoryNotFoundException();
}
}
}
private string logFileName = "";
private string LogFileName
{
get
{
return logFileName;
}
set
{
logFileName = value;
}
}
private string LogFilePath
{
get
{
return this.LogFolderPath + "\\" + this.LogFileName;
}
}
private static Logging _log;
#endregion
public static Logging GetInstance()
{
if (_log == null)
_log = new Logging(LOG_DIRECTORY, "Log_", true, false);
if(!_log.logFolderPath.Equals(LOG_DIRECTORY))
_log = new Logging(LOG_DIRECTORY, "Log_", true, false);
return _log;
}
#region Constructor
/// <summary>
/// Create a HTMLFileLogging object
/// </summary>
/// <param name="folderPath">The path of the folder that will hold the log file (no file name)</param>
/// <param name="fileName">The name of the file to create</param>
/// <param name="createPath">When this is set to true and the folder does not exist, the code will create the folder.</param>
/// <param name="deleteFile">When this is set to true and the file exists, the code will delete the file and create a new one</param>
private Logging(string folderPath, string fileName, bool createPath, bool deleteFile)
{
this.LogFileName = fileName + DateString() + ".log";
if (createPath && !Directory.Exists(folderPath))
{
Directory.CreateDirectory(folderPath);
}
this.LogFolderPath = folderPath;
if (File.Exists(this.LogFilePath) && deleteFile)
{
File.Delete(this.LogFilePath);
}
}
#endregion
#region custom code
/// <summary>
/// Writes a string to the log file.
/// </summary>
/// <param name="message">a string to write. supports html tags.</param>
public void WriteToLogFile(string level, string message)
{
try
{
//string rowFormat = "<table border=0><tr><td nowrap style=\"font-size:x-small;width:200px\" valign='top'><date>{0}</date> <time>{1}</time></td><td style=\"font-size:x-small;width:450px\"> <message>{2}</message></td></tr></table>";
StreamWriter sw = new StreamWriter(this.LogFilePath, true);
string logMesg = String.Format(DateTime.Now.ToString(), "\t", level, "\t", message, "\n");
logMesg = string.Concat(DateTime.Now.ToString(), "\t", level, "\t", message, "\n");
sw.WriteLine(logMesg);
sw.Flush();
sw.Close();
}
catch
{
}
}
public string DateString()
{
string dateString = string.Empty;
if (DateTime.Now.Month < 10)
dateString += "0";
dateString += DateTime.Now.Month;
if (DateTime.Now.Day < 10)
dateString += "0";
dateString += DateTime.Now.Day;
dateString += DateTime.Now.Year.ToString();
dateString += "_";
if (DateTime.Now.Hour < 10)
dateString += "0";
dateString += DateTime.Now.Hour;
dateString += "_";
if (DateTime.Now.Minute < 10)
dateString += "0";
dateString += DateTime.Now.Minute;
dateString += "_";
if (DateTime.Now.Second < 10)
dateString += "0";
dateString += DateTime.Now.Second;
return dateString;
}
#endregion
}
}

Просмотреть файл

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Common")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Common")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("04a36617-4353-4779-92f9-36baffe6a5f6")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

18
Common/Scan.cs Normal file
Просмотреть файл

@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common
{
/// <summary>
/// Base class for scan results
/// </summary>
public class Scan
{
public string SiteURL { get; set; }
public string SiteColUrl { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,44 @@
using System.IO;
namespace Common
{
/// <summary>
/// Class to support the embedded webpartmapping.xml file
/// </summary>
public static class WebpartMappingLoader
{
/// <summary>
/// Load the webpartmapping file from the embedded resources
/// </summary>
/// <param name="fileName">Fully qualified path to file</param>
/// <returns>String contents</returns>
public static string LoadFile(string fileName)
{
var fileContent = "";
using (Stream stream = typeof(WebpartMappingLoader).Assembly.GetManifestResourceStream(fileName))
{
using (StreamReader reader = new StreamReader(stream))
{
fileContent = reader.ReadToEnd();
}
}
return fileContent;
}
/// <summary>
/// Transforms a string into a stream
/// </summary>
/// <param name="s">String to transform</param>
/// <returns>Stream</returns>
public static Stream GenerateStreamFromString(string s)
{
var stream = new MemoryStream();
var writer = new StreamWriter(stream);
writer.Write(s);
writer.Flush();
stream.Position = 0;
return stream;
}
}
}

43
Common/WorkFlowActions.cs Normal file
Просмотреть файл

@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common
{
/// <summary>
/// Workflow types
/// </summary>
public enum WorkflowTypes
{
SP2010,
SP2013
}
/// <summary>
/// Workflow action class
/// </summary>
public class WorkflowAction
{
public string ActionName { get; set; }
public string ActionNameShort { get; set; }
}
/// <summary>
/// Class holding the default workflow actions for 2010/2013 SharePoint workflow
/// </summary>
public class WorkflowActions
{
public WorkflowActions()
{
SP2010DefaultActions = new List<WorkflowAction>();
SP2013DefaultActions = new List<WorkflowAction>();
}
public List<WorkflowAction> SP2010DefaultActions { get; set; }
public List<WorkflowAction> SP2013DefaultActions { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common
{
public class WorkflowActionAnalysis
{
public WorkflowActionAnalysis()
{
this.WorkflowActions = new List<string>();
this.UnsupportedActions = new List<string>();
}
public List<string> WorkflowActions { get; set; }
public int ActionCount { get; set; }
public List<string> UnsupportedActions { get; set; }
public int UnsupportedAccountCount { get; set; }
}
}

1854
Common/WorkflowCommon.cs Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,130 @@
using OfficeDevPnP.Core.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common
{
public class WorkflowScanResult : Scan
{
public WorkflowScanResult()
{
this.UsedActions = new List<string>();
this.UnsupportedActionsInFlow = new List<string>();
this.UsedTriggers = new List<string>();
this.LastSubscriptionEdit = DateTime.MinValue;
this.LastDefinitionEdit = DateTime.MinValue;
}
public string CreatedBy { get; set; }
public string ModifiedBy { get; set; }
public DateTime CreatedOn { get; set; }
public DateTime ModifiedOn { get; set; }
public DateTime LastRun { get; set; }
public string ListUrl { get; set; }
public string ListTitle { get; set; }
public Guid ListId { get; set; }
public string ContentTypeName { get; set; }
public string ContentTypeId { get; set; }
public Guid DefinitionId { get; set; }
public Guid SubscriptionId { get; set; }
/// <summary>
/// 2010 or 2013 workflow engine
/// </summary>
public string Version { get; set; }
public bool IsOOBWorkflow { get; set; }
/// <summary>
/// Site, List, ContentType
/// </summary>
public string Scope { get; set; }
/// <summary>
/// Site, List or Universal workflow (2013) or N/A (2010)
/// </summary>
public string RestrictToType { get; set; }
public bool Enabled { get; set; }
/// <summary>
/// Calculation showing if one should consider upgrading this workflow
/// </summary>
public bool ConsiderUpgradingToFlow
{
get
{
if ((Scope == "List" || Scope == "ContentType" || Scope == "Site") &&
Enabled && !IsOOBWorkflow && HasSubscriptions)
{
return true;
}
else
{
return false;
}
}
}
public string DefinitionName { get; set; }
public string DefinitionDescription { get; set; }
public string SubscriptionName { get; set; }
public bool HasSubscriptions { get; set; }
public int ActionCount { get; set; }
public List<string> UsedActions { get; set; }
public int ToFLowMappingPercentage
{
get
{
if (ActionCount == 0)
{
return -1;
}
else
{
return (int)(((double)(ActionCount - UnsupportedActionCount) / (double)ActionCount) * 100);
}
}
}
public int UnsupportedActionCount { get; set; }
public List<string> UnsupportedActionsInFlow { get; set; }
public List<string> UsedTriggers { get; set; }
public DateTime LastSubscriptionEdit { get; set; }
public DateTime LastDefinitionEdit { get; set; }
/// <summary>
/// Site administrators
/// </summary>
public List<UserEntity> Admins { get; set; }
/// <summary>
/// Site owners
/// </summary>
public List<UserEntity> Owners { get; set; }
}
}

Просмотреть файл

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common
{
public class WorkflowTriggerAnalysis
{
public WorkflowTriggerAnalysis()
{
this.WorkflowTriggers = new List<string>();
this.UnSupportedTriggers = new List<string>();
}
public List<string> WorkflowTriggers { get; set; }
public List<string> UnSupportedTriggers { get; set; }
}
}

47
Common/app.config Normal file
Просмотреть файл

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

40
Common/packages.config Normal file
Просмотреть файл

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.9.9" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.Azure.ActiveDirectory.GraphClient" version="2.1.0" targetFramework="net461" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net461" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.0" targetFramework="net461" />
<package id="Microsoft.Data.Edm" version="5.8.4" targetFramework="net461" />
<package id="Microsoft.Data.OData" version="5.8.4" targetFramework="net461" />
<package id="Microsoft.Data.Services.Client" version="5.8.4" targetFramework="net461" />
<package id="Microsoft.Graph" version="1.9.0" targetFramework="net461" />
<package id="Microsoft.Graph.Core" version="1.9.0" targetFramework="net461" />
<package id="Microsoft.IdentityModel" version="7.0.0" targetFramework="net461" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="3.19.8" targetFramework="net461" />
<package id="Microsoft.IdentityModel.JsonWebTokens" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.IdentityModel.Logging" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.IdentityModel.Tokens" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.SharePointOnline.CSOM" version="16.1.20317.12000" targetFramework="net461" />
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net461" />
<package id="SharePointPnP.IdentityModel.Extensions" version="1.2.4" targetFramework="net461" />
<package id="SharePointPnPCoreOnline" version="3.24.2008.1" targetFramework="net461" />
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
<package id="System.IdentityModel.Tokens.Jwt" version="5.2.4" targetFramework="net461" />
<package id="System.Management.Automation" version="7.0.3" targetFramework="net461" />
<package id="System.Memory" version="4.5.4" targetFramework="net461" />
<package id="System.Net.Http" version="4.3.1" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net461" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
<package id="System.Spatial" version="5.8.4" targetFramework="net461" />
<package id="System.Text.Encodings.Web" version="4.7.1" targetFramework="net461" />
<package id="System.Text.Json" version="4.7.2" targetFramework="net461" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
<package id="WindowsAzure.Storage" version="7.0.0" targetFramework="net461" />
</packages>

2514
Common/sp2010wfmodel.cs Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

1589
Common/sp2010wfmodel.xml Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

445
Common/sp2010wfmodel.xsd Normal file
Просмотреть файл

@ -0,0 +1,445 @@
<?xml version="1.0" encoding="utf-8"?>
<s:schema elementFormDefault="qualified" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:core="http://schemas.microsoft.com/sharepoint/soap/">
<s:element name="WorkflowInfo">
<s:complexType>
<s:all>
<s:element name="Conditions" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Default" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="RuleDesigner" type="ruleDesignerType" />
</s:sequence>
<s:attribute name="ItemKeyType" default="System.Int32">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="System.Int32" />
<s:enumeration value="Microsoft.SharePoint.Workflow.SPItemKey" />
</s:restriction>
</s:simpleType>
</s:attribute>
</s:complexType>
</s:element>
<s:element name="Condition" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:all>
<s:element name="RuleDesigner" type="ruleDesignerType" minOccurs="1" maxOccurs="1" />
<s:element name="Parameters" type="parametersType" minOccurs="1" maxOccurs="1" />
</s:all>
<s:attribute name="Type">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="Advanced" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="AppliesTo" type="appliesToTypes" use="required" />
<s:attribute name="UsesCurrentItem" type="s:boolean" default="false" />
<s:attribute name="ItemKeyType" default="System.Int32">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="System.Int32" />
<s:enumeration value="Microsoft.SharePoint.Workflow.SPItemKey" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="FunctionName" type="s:string" />
<s:attribute name="Assembly" type="s:string" />
<s:attribute name="ClassName" type="s:string" />
<s:attributeGroup ref="invocationTagAttributeGroup"/>
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="And" type="s:string" />
<s:attribute name="Or" type="s:string" />
<s:attribute name="When" type="s:string" />
<s:attribute name="Else" type="s:string" />
<s:attribute name="Not" type="s:string" />
</s:complexType>
</s:element>
<s:element name="Actions" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Default" type="defaultElementType" minOccurs="0" maxOccurs="1" />
<s:element name="Action" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:all>
<s:element name="Parameters" type="parametersType" minOccurs="0" maxOccurs="1" />
<s:element name="RuleDesigner" type="ruleDesignerType" minOccurs="1" maxOccurs="1" />
<s:element name="DataSources" type="dataSourcesType" minOccurs="0" maxOccurs="1" />
<s:element name="Modifications" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Modification" minOccurs="1" maxOccurs="unbounded">
<s:complexType>
<s:sequence />
<s:attribute name="TypeId" type="s:string" use="required" />
<s:attribute name="NameFormat" use="required">
<s:simpleType>
<s:restriction base="s:string">
<s:pattern value="([^\{]|\\\{|(\{0\}))*" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="FormURN" type="s:string" use="required" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ActionVariables" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="skip" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ActionBody" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="skip" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ActionConditions" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="skip" />
</s:sequence>
</s:complexType>
</s:element>
</s:all>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="ClassName" type="s:string" use="required" />
<s:attribute name="Assembly" type="s:string" use="required" />
<s:attribute name="FunctionName" type="s:string" default=""/>
<s:attribute name="Category" type="s:string" />
<s:attribute name="CreatesTask" type="s:boolean" default="false" />
<s:attribute name="CreatesInList" type="s:string" />
<s:attribute name="AppliesTo" type="appliesToTypes" use="required" />
<s:attribute name="IsError" type="s:boolean" default="false" />
<s:attribute name="ListModeration" type="s:boolean" default="false" />
<s:attribute name="UsesCurrentItem" type="s:boolean" default="false" />
<s:attributeGroup ref="invocationTagAttributeGroup"/>
<s:attribute name="CreatedTaskFormType">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="DataCollectTask" />
<s:enumeration value="GroupAssignedTask" />
<s:enumeration value="TodoItemTask" />
<s:enumeration value="TaskProcess" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="__SolutionId" type="s:string" />
<s:attribute name="SandboxedFunction" type="s:boolean" default="false" />
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="Sequential" type="s:string" />
<s:attribute name="Parallel" type="s:string" />
</s:complexType>
<s:unique name="eachActionHasUniqueConstructToProcess">
<s:selector xpath="./Action"/>
<s:field xpath="@Assembly"/>
<s:field xpath="@ClassName"/>
<s:field xpath="@FunctionName"/>
</s:unique>
</s:element>
<s:element name="CompositeSteps" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence minOccurs="0" maxOccurs="unbounded">
<s:element name="CompositeStep">
<s:complexType>
<s:sequence>
<s:element name="DataSources" type="dataSourcesType" minOccurs="0" maxOccurs="1" />
</s:sequence>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="ClassName" type="s:string" use="required" />
<s:attribute name="Assembly" type="s:string" use="required" />
<s:attribute name="AppliesTo" type="appliesToTypes" use="required" />
<s:attributeGroup ref="invocationTagAttributeGroup"/>
<s:attribute name="Order" type="s:nonNegativeInteger" default="0" />
<s:attribute name="Description" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="VariableTypes" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence minOccurs="0" maxOccurs="unbounded">
<s:element name="VariableType">
<s:complexType>
<s:attribute name="Type" type="s:string" use="required" />
<s:attribute name="DisplayName" type="s:string" use="required" />
<s:attribute name="Assembly" type="s:string" />
<s:attribute name="CoercionActivity" type="s:string" use="required" />
<s:attribute name="Default" type="s:boolean" default="false" />
<s:attribute name="ItemIdType" type="s:boolean" default="false" />
<s:attribute name="Hidden" type="s:boolean" default="false" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AssemblyRedirects" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence minOccurs="0" maxOccurs="unbounded">
<s:element name="AssemblyRedirect">
<s:complexType>
<s:attribute name="From" type="s:string" use="required" />
<s:attribute name="To" type="s:string" use="required" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Coercions" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence minOccurs="0" maxOccurs="unbounded">
<s:element name="Coercion">
<s:complexType>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="Assembly" type="s:string" use="required" />
<s:attribute name="DisplayName" type="s:string" use="required" />
<s:attribute name="CatchAll" type="s:boolean" use="required" />
<s:attribute name="RankDefault" type="s:integer" use="required" />
<s:attribute name="SourceType" type="s:string" />
<s:attribute name="SourceFieldType" type="s:string" />
<s:attribute name="DestinationType" type="s:string" use="required" />
<s:attribute name="DestinationFieldType" type="s:string" />
<s:attribute name="ClassName" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:all>
<s:attribute name="Language" type="s:string" />
</s:complexType>
</s:element>
<s:complexType name="ruleDesignerType">
<s:sequence>
<s:element name="FieldBind" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:choice>
<s:sequence>
<s:element name="Option" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:sequence>
</s:sequence>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="Value" type="s:string" use="required" />
<s:attribute name="TypeFilter" type="s:string" />
<s:attribute name="UnaryHides" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
<s:element name="DataSourceRef" minOccurs="1" maxOccurs="unbounded">
<s:complexType>
<s:sequence />
<s:attribute name="Ref" type="s:string" />
</s:complexType>
</s:element>
</s:choice>
<s:attribute name="Field" type="s:string" />
<s:attribute name="Text" type="s:string" />
<s:attribute name="Id" type="s:positiveInteger" use="required" />
<s:attribute name="DesignerType" use="required">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="AddPermission" />
<s:enumeration value="Assignment" />
<s:enumeration value="Bool" />
<s:enumeration value="CheckPermission" />
<s:enumeration value="ChooseDoclibItem" />
<s:enumeration value="ChooseListItem" />
<s:enumeration value="CreateListItem" />
<s:enumeration value="DataSourceFieldNames" />
<s:enumeration value="DataSourceValues" />
<s:enumeration value="Date" />
<s:enumeration value="Dependent" />
<s:enumeration value="Dropdown" />
<s:enumeration value="Email" />
<s:enumeration value="FieldNames" />
<s:enumeration value="Float" />
<s:enumeration value="Hyperlink" />
<s:enumeration value="Integer" />
<s:enumeration value="ListNames" />
<s:enumeration value="Operator" />
<s:enumeration value="ParameterNames" />
<s:enumeration value="Person" />
<s:enumeration value="RemovePermission" />
<s:enumeration value="ReplacePermission" />
<s:enumeration value="SinglePerson" />
<s:enumeration value="StatusDropdown" />
<s:enumeration value="StringBuilder" />
<s:enumeration value="Survey" />
<s:enumeration value="TaskSummary" />
<s:enumeration value="Text" />
<s:enumeration value="TextBox" />
<s:enumeration value="TextArea" />
<s:enumeration value="UpdateListItem" />
<s:enumeration value="WritableFieldNames" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="OperatorTypeFrom" type="s:string" />
<s:attribute name="TypeFrom" type="s:string" />
<s:attribute name="Function" type="s:boolean" default="false" />
<s:attribute name="Value" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="Sentence" type="s:string" />
</s:complexType>
<s:complexType name="defaultElementType">
<s:sequence>
<s:element name="RuleDesigner" type="ruleDesignerType" />
</s:sequence>
</s:complexType>
<s:complexType name="parametersType">
<s:sequence>
<s:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:sequence>
</s:sequence>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="Type" type="s:string" use="required" />
<s:attribute name="Direction" use="required">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="In" />
<s:enumeration value="Out" />
<s:enumeration value="Optional" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="Description" type="s:string" />
<s:attribute name="DesignerType">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="ContentType" />
<s:enumeration value="DataSourceFieldNames" />
<s:enumeration value="DataSourceValues" />
<s:enumeration value="Date" />
<s:enumeration value="Dependent" />
<s:enumeration value="Dropdown" />
<s:enumeration value="FieldNames" />
<s:enumeration value="Hide" />
<s:enumeration value="Integer" />
<s:enumeration value="ItemProperties" />
<s:enumeration value="ListItem" />
<s:enumeration value="ListNames" />
<s:enumeration value="ParameterNames" />
<s:enumeration value="Person" />
<s:enumeration value="SinglePerson" />
<s:enumeration value="StatusDropdown" />
<s:enumeration value="StringBuilder" />
<s:enumeration value="TextArea" />
<s:enumeration value="TextBox" />
<s:enumeration value="WritableFieldNames" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="ShowLookupForDropdown" type="s:boolean" default="false" />
<s:attribute name="DisplayName" type="s:string" />
<s:attribute name="InitialValue" type="s:string" />
<s:attribute name="InitialBinding" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
<s:complexType name="dataSourcesType">
<s:sequence>
<s:element name="DataSource" type="dataSourceType" minOccurs="0" maxOccurs="unbounded" />
</s:sequence>
</s:complexType>
<s:complexType name="dataSourceType">
<s:sequence>
<s:element name="SchemaSource">
<s:complexType>
<s:choice>
<s:element name="Fields" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Field" minOccurs="1" maxOccurs="unbounded">
<s:complexType>
<s:sequence>
<s:element name="CHOICES" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="CHOICE" minOccurs="1" maxOccurs="unbounded">
<s:complexType>
<s:simpleContent>
<s:extension base="s:string">
<s:attribute name="DisplayName" type="s:string" />
</s:extension>
</s:simpleContent>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="Name" type="s:string" />
<s:attribute name="DisplayName" type="s:string" />
<s:attribute name="Type" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ContentType" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:attribute name="IDFrom" type="s:string" />
</s:complexType>
</s:element>
<s:element name="Dictionary" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:attribute name="ValueFrom" type="s:string" />
</s:complexType>
</s:element>
<s:element name="NestedInitiationFieldNodes" minOccurs="0" maxOccurs="1" />
</s:choice>
</s:complexType>
</s:element>
<s:element name="Evaluation">
<s:complexType>
<s:choice>
<s:element name="ActivitySource">
<s:complexType>
</s:complexType>
</s:element>
<s:element name="HashtableSource">
<s:complexType>
<s:attribute name="HashtableFrom" type="s:string" />
</s:complexType>
</s:element>
</s:choice>
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="InternalName" type="s:string" use="required" />
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="NameProperty" type="s:string" use="required" />
</s:complexType>
<s:simpleType name="appliesToTypes">
<s:restriction base="s:string">
<s:enumeration value="none" />
<s:enumeration value="list" />
<s:enumeration value="doclib" />
<s:enumeration value="all" />
<s:enumeration value="displayonly" />
</s:restriction>
</s:simpleType>
<s:attributeGroup name="invocationTagAttributeGroup">
<s:attribute name="RequiredInvocationTags" type="s:string" />
<s:attribute name="InvocationTags" type="s:string" />
<s:attribute name="ProhibitedInvocationTags" type="s:string" />
<s:attribute name="ProhibitedDirectParentInvocationTags" type="s:string" />
</s:attributeGroup>
</s:schema>

3069
Common/sp2013wfmodel.cs Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

1919
Common/sp2013wfmodel.xml Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

552
Common/sp2013wfmodel.xsd Normal file
Просмотреть файл

@ -0,0 +1,552 @@
<?xml version="1.0" encoding="utf-8"?>
<s:schema elementFormDefault="qualified" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:core="http://schemas.microsoft.com/sharepoint/soap/">
<s:element name="WorkflowInfo">
<s:complexType>
<s:all>
<s:element name="Conditions" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Default" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="RuleDesigner" type="ruleDesignerType" />
</s:sequence>
<s:attribute name="ItemKeyType" default="System.Int32">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="System.Guid" />
<s:enumeration value="System.Int32" />
</s:restriction>
</s:simpleType>
</s:attribute>
</s:complexType>
</s:element>
<s:element name="Condition" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:all>
<s:element name="RuleDesigner" type="ruleDesignerType" minOccurs="1" maxOccurs="1" />
<s:element name="Parameters" type="parametersType" minOccurs="1" maxOccurs="1" />
</s:all>
<s:attribute name="Type">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="Advanced" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="AppliesTo" type="appliesToTypes" use="required" />
<s:attribute name="UsesCurrentItem" type="s:boolean" default="false" />
<s:attribute name="RequiresPWA" type="s:boolean" default="false" />
<s:attribute name="ItemKeyType" default="System.Int32">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="System.Guid" />
<s:enumeration value="System.Int32" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="FunctionName" type="s:string" />
<s:attribute name="Assembly" type="s:string" />
<s:attribute name="ClassName" type="s:string" />
<s:attributeGroup ref="invocationTagAttributeGroup"/>
<s:attribute name="ShapeImageUrl" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="And" type="s:string" />
<s:attribute name="Or" type="s:string" />
<s:attribute name="When" type="s:string" />
<s:attribute name="Else" type="s:string" />
<s:attribute name="Not" type="s:string" />
</s:complexType>
</s:element>
<s:element name="Actions" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Default" type="defaultElementType" minOccurs="0" maxOccurs="1" />
<s:element name="Action" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:all>
<s:element name="Parameters" type="parametersType" minOccurs="0" maxOccurs="1" />
<s:element name="RuleDesigner" type="ruleDesignerType" minOccurs="1" maxOccurs="1" />
<s:element name="DataSources" type="dataSourcesType" minOccurs="0" maxOccurs="1" />
<s:element name="Modifications" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Modification" minOccurs="1" maxOccurs="unbounded">
<s:complexType>
<s:sequence />
<s:attribute name="TypeId" type="s:string" use="required" />
<s:attribute name="NameFormat" use="required">
<s:simpleType>
<s:restriction base="s:string">
<s:pattern value="([^\{]|\\\{|(\{0\}))*" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="FormURN" type="s:string" use="required" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ActionVariables" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="skip" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ActionBody" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="skip" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ActionConditions" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="skip" />
</s:sequence>
</s:complexType>
</s:element>
</s:all>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="ClassName" type="s:string" use="required" />
<s:attribute name="ID" type="s:string" />
<s:attribute name="Assembly" type="s:string" />
<s:attribute name="FunctionName" type="s:string" default=""/>
<s:attribute name="Category" type="s:string" />
<s:attribute name="CreatesTask" type="s:boolean" default="false" />
<s:attribute name="CreatesInList" type="s:string" />
<s:attribute name="AppliesTo" type="appliesToTypes" use="required" />
<s:attribute name="IsError" type="s:boolean" default="false" />
<s:attribute name="ListModeration" type="s:boolean" default="false" />
<s:attribute name="UsesCurrentItem" type="s:boolean" default="false" />
<s:attribute name="RequiresPWA" type="s:boolean" default="false" />
<s:attributeGroup ref="invocationTagAttributeGroup"/>
<s:attribute name="CreatedTaskFormType">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="DataCollectTask" />
<s:enumeration value="GroupAssignedTask" />
<s:enumeration value="TodoItemTask" />
<s:enumeration value="TaskProcess" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="__SolutionId" type="s:string" />
<s:attribute name="SandboxedFunction" type="s:boolean" default="false" />
<s:attribute name="ShapeImageUrl" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="Sequential" type="s:string" />
<s:attribute name="Parallel" type="s:string" />
</s:complexType>
<s:unique name="eachActionHasUniqueConstructToProcess">
<s:selector xpath="./Action"/>
<s:field xpath="@Assembly"/>
<s:field xpath="@ClassName"/>
<s:field xpath="@FunctionName"/>
</s:unique>
</s:element>
<s:element name="CompositeSteps" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence minOccurs="0" maxOccurs="unbounded">
<s:element name="CompositeStep">
<s:complexType>
<s:sequence>
<s:element name="DataSources" type="dataSourcesType" minOccurs="0" maxOccurs="1" />
</s:sequence>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="ClassName" type="s:string" use="required" />
<s:attribute name="Assembly" type="s:string" />
<s:attribute name="AppliesTo" type="appliesToTypes" use="required" />
<s:attributeGroup ref="invocationTagAttributeGroup"/>
<s:attribute name="Order" type="s:nonNegativeInteger" default="0" />
<s:attribute name="Description" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="VariableTypes" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence minOccurs="0" maxOccurs="unbounded">
<s:element name="VariableType">
<s:complexType>
<s:attribute name="Type" type="s:string" use="required" />
<s:attribute name="DisplayName" type="s:string" use="required" />
<s:attribute name="Assembly" type="s:string" />
<s:attribute name="Default" type="s:boolean" default="false" />
<s:attribute name="ItemIdType" type="s:boolean" default="false" />
<s:attribute name="Hidden" type="s:boolean" default="false" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AssemblyRedirects" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence minOccurs="0" maxOccurs="unbounded">
<s:element name="AssemblyRedirect">
<s:complexType>
<s:attribute name="From" type="s:string" use="required" />
<s:attribute name="To" type="s:string" use="required" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Coercions" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence minOccurs="0" maxOccurs="unbounded">
<s:element name="Coercion" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:all>
<s:element name="Parameters" type="coercionParametersType" minOccurs="0" maxOccurs="1" />
</s:all>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="Assembly" type="s:string" />
<s:attribute name="DisplayName" type="s:string" use="required" />
<s:attribute name="CatchAll" type="s:boolean" use="required" />
<s:attribute name="RankDefault" type="s:integer" use="required" />
<s:attribute name="SourceType" type="s:string" />
<s:attribute name="SourceFieldType" type="s:string" />
<s:attribute name="DestinationType" type="s:string" use="required" />
<s:attribute name="DestinationFieldType" type="s:string" />
<s:attribute name="ClassName" type="s:string" />
<s:attribute name="Id" type="s:string" />
<s:attribute name="SourceProperty" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Events" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Event" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="DisplayName" type="s:string" use="required" />
<s:attribute name="EventGroup" type="s:string" use="required" />
<s:attribute name="Category" type="s:string" use="required" />
<s:attribute name="RankDefault" type="s:string" use="required" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Flows" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Flow" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:sequence>
<s:element name="RuleDesigner" type="ruleDesignerType" minOccurs="1" maxOccurs="1" />
<s:element name="Parameters" type="parametersType" minOccurs="1" maxOccurs="1" />
</s:sequence>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="Category" type="s:string" use="required" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="Blocks" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Block" type="propertiesType" minOccurs="0" maxOccurs="unbounded" />
</s:sequence>
</s:complexType>
</s:element>
</s:all>
<s:attribute name="Language" type="s:string" />
</s:complexType>
</s:element>
<s:complexType name="ruleDesignerType">
<s:sequence>
<s:element name="FieldBind" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:choice>
<s:sequence>
<s:element name="Option" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:sequence>
</s:sequence>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="Value" type="s:string" use="required" />
<s:attribute name="TypeFilter" type="s:string" />
<s:attribute name="UnaryHides" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
<s:element name="DataSourceRef" minOccurs="1" maxOccurs="unbounded">
<s:complexType>
<s:sequence />
<s:attribute name="Ref" type="s:string" />
</s:complexType>
</s:element>
</s:choice>
<s:attribute name="Field" type="s:string" />
<s:attribute name="Text" type="s:string" />
<s:attribute name="Id" type="s:positiveInteger" use="required" />
<s:attribute name="DesignerType" use="required">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="AddPermission" />
<s:enumeration value="Assignment" />
<s:enumeration value="Bool" />
<s:enumeration value="CheckPermission" />
<s:enumeration value="ChooseDoclibItem" />
<s:enumeration value="ChooseListItem" />
<s:enumeration value="ChooseListWorkflow" />
<s:enumeration value="ChooseSiteWorkflow" />
<s:enumeration value="CompositeTaskAction" />
<s:enumeration value="CreateListItem" />
<s:enumeration value="DataSourceFieldNames" />
<s:enumeration value="DataSourceValues" />
<s:enumeration value="Date" />
<s:enumeration value="Dependent" />
<s:enumeration value="Dictionary" />
<s:enumeration value="DocLibNames" />
<s:enumeration value="Dropdown" />
<s:enumeration value="EnterpriseProjectType" />
<s:enumeration value="EventDropdown" />
<s:enumeration value="Email" />
<s:enumeration value="FieldNames" />
<s:enumeration value="Float" />
<s:enumeration value="Hyperlink" />
<s:enumeration value="Integer" />
<s:enumeration value="ListItemEvent" />
<s:enumeration value="ListNames" />
<s:enumeration value="Operator" />
<s:enumeration value="ParameterNames" />
<s:enumeration value="Person" />
<s:enumeration value="ProjectFields" />
<s:enumeration value="PropertyGrid" />
<s:enumeration value="RemovePermission" />
<s:enumeration value="ReplacePermission" />
<s:enumeration value="RestCall" />
<s:enumeration value="SinglePerson" />
<s:enumeration value="SingleTaskAction" />
<s:enumeration value="Stages" />
<s:enumeration value="StatusDropdown" />
<s:enumeration value="StringBuilder" />
<s:enumeration value="Survey" />
<s:enumeration value="TaskSummary" />
<s:enumeration value="Text" />
<s:enumeration value="TextBox" />
<s:enumeration value="TextArea" />
<s:enumeration value="TextOnly" />
<s:enumeration value="UpdateListItem" />
<s:enumeration value="WorkflowParameters" />
<s:enumeration value="WritableFieldNames" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="OperatorTypeFrom" type="s:string" />
<s:attribute name="TypeFrom" type="s:string" />
<s:attribute name="Function" type="s:boolean" default="false" />
<s:attribute name="Value" type="s:string" />
<s:attribute name="EventCategory" type="s:string" />
<s:attribute name="DisplayName" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="Sentence" type="s:string" />
</s:complexType>
<s:complexType name="defaultElementType">
<s:sequence>
<s:element name="RuleDesigner" type="ruleDesignerType" />
</s:sequence>
</s:complexType>
<s:complexType name="parametersType">
<s:sequence>
<s:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:sequence>
</s:sequence>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="Type" type="s:string" use="required" />
<s:attribute name="Direction" use="required">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="In" />
<s:enumeration value="Out" />
<s:enumeration value="Optional" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="Description" type="s:string" />
<s:attribute name="DesignerType">
<s:simpleType>
<s:restriction base="s:string">
<s:enumeration value="ContentType" />
<s:enumeration value="DataSourceFieldNames" />
<s:enumeration value="DataSourceValues" />
<s:enumeration value="Date" />
<s:enumeration value="Dependent" />
<s:enumeration value="DocLibNames" />
<s:enumeration value="Dropdown" />
<s:enumeration value="EventDropdown" />
<s:enumeration value="FieldNames" />
<s:enumeration value="Float" />
<s:enumeration value="HttpMethod" />
<s:enumeration value="Hide" />
<s:enumeration value="Integer" />
<s:enumeration value="ItemProperties" />
<s:enumeration value="ListItem" />
<s:enumeration value="ListNames" />
<s:enumeration value="ParameterNames" />
<s:enumeration value="Password" />
<s:enumeration value="Person" />
<s:enumeration value="SinglePerson" />
<s:enumeration value="Stages" />
<s:enumeration value="StatusDropdown" />
<s:enumeration value="StringBuilder" />
<s:enumeration value="TaskContentType" />
<s:enumeration value="TextArea" />
<s:enumeration value="TextBox" />
<s:enumeration value="WritableFieldNames" />
</s:restriction>
</s:simpleType>
</s:attribute>
<s:attribute name="ShowLookupForDropdown" type="s:boolean" default="false" />
<s:attribute name="DisplayName" type="s:string" />
<s:attribute name="InitialValue" type="s:string" />
<s:attribute name="InitialBinding" type="s:string" />
<s:attribute name="EventCategory" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
<s:complexType name="propertiesType">
<s:sequence>
<s:element name="Property" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="DesignerType" type="s:string" />
<s:attribute name="DisplayName" type="s:string" />
<s:attribute name="Description" type="s:string" />
<s:attribute name="TypeFrom" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="DisplayName" type="s:string" />
</s:complexType>
<s:complexType name="dataSourcesType">
<s:sequence>
<s:element name="DataSource" type="dataSourceType" minOccurs="0" maxOccurs="unbounded" />
</s:sequence>
</s:complexType>
<s:complexType name="dataSourceType">
<s:sequence>
<s:element name="SchemaSource">
<s:complexType>
<s:choice>
<s:element name="Fields" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="Field" minOccurs="1" maxOccurs="unbounded">
<s:complexType>
<s:sequence>
<s:element name="CHOICES" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:element name="CHOICE" minOccurs="1" maxOccurs="unbounded">
<s:complexType>
<s:simpleContent>
<s:extension base="s:string">
<s:attribute name="DisplayName" type="s:string" />
</s:extension>
</s:simpleContent>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="Name" type="s:string" />
<s:attribute name="DisplayName" type="s:string" />
<s:attribute name="Type" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
<s:element name="ContentType" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:attribute name="IDFrom" type="s:string" />
</s:complexType>
</s:element>
<s:element name="Dictionary" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:attribute name="ValueFrom" type="s:string" />
</s:complexType>
</s:element>
<s:element name="NestedInitiationFieldNodes" minOccurs="0" maxOccurs="1" />
</s:choice>
</s:complexType>
</s:element>
<s:element name="Evaluation">
<s:complexType>
<s:choice>
<s:element name="ActivitySource">
<s:complexType>
</s:complexType>
</s:element>
<s:element name="HashtableSource">
<s:complexType>
<s:attribute name="HashtableFrom" type="s:string" />
</s:complexType>
</s:element>
</s:choice>
</s:complexType>
</s:element>
</s:sequence>
<s:attribute name="InternalName" type="s:string" use="required" />
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="NameProperty" type="s:string" use="required" />
</s:complexType>
<s:simpleType name="appliesToTypes">
<s:restriction base="s:string">
<s:enumeration value="none" />
<s:enumeration value="list" />
<s:enumeration value="doclib" />
<s:enumeration value="all" />
<s:enumeration value="displayonly" />
</s:restriction>
</s:simpleType>
<s:attributeGroup name="invocationTagAttributeGroup">
<s:attribute name="RequiredInvocationTags" type="s:string" />
<s:attribute name="InvocationTags" type="s:string" />
<s:attribute name="ProhibitedInvocationTags" type="s:string" />
<s:attribute name="ProhibitedDirectParentInvocationTags" type="s:string" />
</s:attributeGroup>
<s:complexType name="coercionParametersType">
<s:sequence>
<s:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
<s:complexType>
<s:all>
<s:element name="ActivityBody" minOccurs="0" maxOccurs="1">
<s:complexType>
<s:sequence>
<s:any minOccurs="0" maxOccurs="unbounded" processContents="skip" />
</s:sequence>
</s:complexType>
</s:element>
</s:all>
<s:attribute name="Name" type="s:string" use="required" />
<s:attribute name="Type" type="s:string" use="required" />
<s:attribute name="Value" type="s:string" />
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:schema>

222
Discovery/Discovery.csproj Normal file
Просмотреть файл

@ -0,0 +1,222 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{66180571-9292-4411-8B01-B31DCE2CC0E8}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Discovery</RootNamespace>
<AssemblyName>Discovery</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="AngleSharp, Version=0.9.9.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea, processorArchitecture=MSIL">
<HintPath>..\packages\AngleSharp.0.9.9\lib\net45\AngleSharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ActiveDirectory.GraphClient, Version=2.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.ActiveDirectory.GraphClient.2.1.0\lib\portable-net4+sl5+win+wpa+wp8\Microsoft.Azure.ActiveDirectory.GraphClient.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.KeyVault.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Graph, Version=1.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Graph.1.9.0\lib\net45\Microsoft.Graph.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Graph.Core, Version=1.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Graph.Core.1.9.0\lib\net45\Microsoft.Graph.Core.dll</HintPath>
</Reference>
<Reference Include="microsoft.identitymodel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.7.0.0\lib\net35\microsoft.identitymodel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.8.16603, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.19.8.16603, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.5.2.4\lib\net451\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Logging, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Logging.5.2.4\lib\net451\Microsoft.IdentityModel.Logging.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Tokens, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.5.2.4\lib\net451\Microsoft.IdentityModel.Tokens.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Client.Policy, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Office.Client.Policy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Client.TranslationServices, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Office.Client.TranslationServices.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.SharePoint.Tools, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Office.SharePoint.Tools.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Online.SharePoint.Client.Tenant, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Online.SharePoint.Client.Tenant.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProjectServer.Client, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.ProjectServer.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.DocumentManagement, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.DocumentManagement.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Publishing, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Publishing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Runtime, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Runtime.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Runtime.Windows, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Runtime.Windows.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Search, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Search.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Search.Applications, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Search.Applications.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Taxonomy, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Taxonomy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.UserProfiles, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.UserProfiles.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.WorkflowServices, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.WorkflowServices.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAzure.Storage.7.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="OfficeDevPnP.Core, Version=3.24.2008.1, Culture=neutral, PublicKeyToken=5e633289e95c321a, processorArchitecture=MSIL">
<HintPath>..\packages\SharePointPnPCoreOnline.3.24.2008.1\lib\net461\OfficeDevPnP.Core.dll</HintPath>
</Reference>
<Reference Include="SharePointPnP.IdentityModel.Extensions, Version=1.2.4.0, Culture=neutral, PublicKeyToken=5e633289e95c321a, processorArchitecture=MSIL">
<HintPath>..\packages\SharePointPnP.IdentityModel.Extensions.1.2.4\lib\net45\SharePointPnP.IdentityModel.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IdentityModel" />
<Reference Include="System.IdentityModel.Selectors" />
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.5.2.4\lib\net451\System.IdentityModel.Tokens.Jwt.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.1\lib\net46\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.ServiceModel" />
<Reference Include="System.Spatial, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.4.7.1\lib\net461\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.4.7.2\lib\net461\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="DiscoveryBase.cs" />
<Compile Include="Scan.cs" />
<Compile Include="SiteScanResult.cs" />
<Compile Include="WFDiscovery.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="WorkflowManager.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{04a36617-4353-4779-92f9-36baffe6a5f6}</Project>
<Name>Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

Просмотреть файл

@ -0,0 +1,66 @@
using Microsoft.SharePoint.Client;
using System;
namespace Discovery
{
public abstract class DiscoveryBase
{
private string url;
private string siteColUrl;
/// <summary>
/// Base constructor
/// </summary>
/// <param name="url">Url of the current web</param>
/// <param name="siteColUrl">url of the current site collection</param>
public DiscoveryBase(string url, string siteColUrl)
{
this.url = url;
this.siteColUrl = siteColUrl;
}
/// <summary>
/// Scan start time
/// </summary>
public DateTime StartTime { get; set; }
/// <summary>
/// Scan stop time
/// </summary>
public DateTime StopTime { get; set; }
/// <summary>
/// Site collection url being scanned
/// </summary>
public string SiteCollectionUrl
{
get
{
return this.siteColUrl;
}
}
/// <summary>
/// Site being scanned
/// </summary>
public string SiteUrl
{
get
{
return this.url;
}
}
/// <summary>
/// Virtual Analyze method
/// </summary>
/// <param name="cc">ClientContext of the web to be analyzed</param>
/// <returns>Duration of the analysis</returns>
public virtual TimeSpan Analyze(ClientContext cc)
{
this.StartTime = DateTime.Now;
return new TimeSpan();
}
}
}

Просмотреть файл

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Discovery")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Discovery")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("66180571-9292-4411-8b01-b31dce2cc0e8")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

14
Discovery/Scan.cs Normal file
Просмотреть файл

@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Discovery
{
public class Scan
{
public string SiteURL { get; set; }
public string SiteColUrl { get; set; }
}
}

620
Discovery/SiteScanResult.cs Normal file
Просмотреть файл

@ -0,0 +1,620 @@
using OfficeDevPnP.Core.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Discovery
{
public class SiteScanResult : Scan
{
/// <summary>
/// Web template (e.g. STS#0)
/// </summary>
public string WebTemplate { get; set; }
/// <summary>
/// Modern lists was disabled due to the site scoped blocking feature
/// </summary>
public bool ModernListSiteBlockingFeatureEnabled { get; set; }
/// <summary>
/// Does this site collection have sub sites?
/// </summary>
public bool SubSites { get; set; }
/// <summary>
/// Does this web have a modern home page?
/// </summary>
public bool ModernHomePage { get; set; }
/// <summary>
/// Is this the root site of the tenant
/// </summary>
public bool IsRootSite { get; set; }
/// <summary>
/// Does this site collection have sub sites with broken permission inheritance
/// </summary>
public bool SubSitesWithBrokenPermissionInheritance { get; set; }
/// <summary>
/// Is the publishing web feature enabled?
/// </summary>
public bool WebPublishingFeatureEnabled { get; set; }
/// <summary>
/// Does this site collection have the site pusblishing feature enabled?
/// </summary>
public bool SitePublishingFeatureEnabled { get; set; }
/// <summary>
/// Are there publishing pages used in any of the webs in this site?
/// </summary>
public bool PublishingPagesUsed { get; set; }
/// <summary>
/// Modern page feature was disabled
/// </summary>
public bool ModernPageWebFeatureDisabled { get; set; }
/// <summary>
/// Was the modern page feature enabled
/// </summary>
public bool ModernPageFeatureWasEnabledBySPO { get; set; }
/// <summary>
/// Modern lists was disabled due to the web scoped blocking feature
/// </summary>
public bool ModernListWebBlockingFeatureEnabled { get; set; }
/// <summary>
/// This site uses a non OOB master page
/// </summary>
public bool MasterPage { get; set; }
/// <summary>
/// This site uses alternate css
/// </summary>
public bool AlternateCSS { get; set; }
/// <summary>
/// User custom actions which are ignored on modern UI
/// </summary>
///public List<UserCustomActionResult> SiteUserCustomActions { get; set; }
/// <summary>
/// User custom actions which are ignored on modern UI
/// </summary>
//public List<UserCustomActionResult> WebUserCustomActions { get; set; }
/// <summary>
/// Site administrators
/// </summary>
public List<UserEntity> Admins { get; set; }
/// <summary>
/// Site owners
/// </summary>
public List<UserEntity> Owners { get; set; }
/// <summary>
/// Site members
/// </summary>
public List<UserEntity> Members { get; set; }
/// <summary>
/// Site visitors
/// </summary>
public List<UserEntity> Visitors { get; set; }
/// <summary>
/// Is the everyone or every one except external users claim used to directly grant access
/// </summary>
public bool EveryoneClaimsGranted { get; set; }
/// <summary>
/// ID of the connected Office 365 group
/// </summary>
public Guid Office365GroupId { get; set; }
/// <summary>
/// Is there a Teams team connected to the same Office 365 group as this site collection
/// </summary>
public bool? HasTeamsTeam { get; set; }
/// <summary>
/// Site sharing capabilities
/// </summary>
public string SharingCapabilities { get; set; }
/// <summary>
/// Views in the last 14 days for this site
/// </summary>
public int ViewsRecent { get; set; }
/// <summary>
/// Number of unique users that viewed this site in the last 14 days
/// </summary>
public int ViewsRecentUniqueUsers { get; set; }
/// <summary>
/// Total number of views for this site
/// </summary>
public int ViewsLifeTime { get; set; }
/// <summary>
/// Total number of unique visitors for this site
/// </summary>
public int ViewsLifeTimeUniqueUsers { get; set; }
/// <summary>
/// Site collection ID
/// </summary>
public string SiteId { get; set; }
/// <summary>
/// Search center url for the site
/// </summary>
public string SearchCenterUrl { get; set; }
#region Cloning
/// <summary>
/// Clone this object, keep in sync when new props are added to this class
/// </summary>
/// <returns></returns>
public SiteScanResult Clone()
{
return new SiteScanResult()
{
SiteColUrl = this.SiteColUrl,
SiteURL = this.SiteURL,
ModernListSiteBlockingFeatureEnabled = this.ModernListSiteBlockingFeatureEnabled,
ModernHomePage = this.ModernHomePage,
IsRootSite = this.IsRootSite,
SitePublishingFeatureEnabled = this.SitePublishingFeatureEnabled,
WebPublishingFeatureEnabled = this.WebPublishingFeatureEnabled,
PublishingPagesUsed = this.PublishingPagesUsed,
ModernPageWebFeatureDisabled = this.ModernPageWebFeatureDisabled,
ModernPageFeatureWasEnabledBySPO = this.ModernPageFeatureWasEnabledBySPO,
ModernListWebBlockingFeatureEnabled = this.ModernListWebBlockingFeatureEnabled,
WebTemplate = this.WebTemplate,
SubSites = this.SubSites,
SubSitesWithBrokenPermissionInheritance = this.SubSitesWithBrokenPermissionInheritance,
MasterPage = this.MasterPage,
//SiteUserCustomActions = this.SiteUserCustomActions,
// WebUserCustomActions = this.WebUserCustomActions,
AlternateCSS = this.AlternateCSS,
Admins = this.Admins,
Owners = this.Owners,
Members = this.Members,
Visitors = this.Visitors,
EveryoneClaimsGranted = this.EveryoneClaimsGranted,
Office365GroupId = this.Office365GroupId,
HasTeamsTeam = this.HasTeamsTeam,
SharingCapabilities = this.SharingCapabilities,
ViewsLifeTime = this.ViewsLifeTime,
ViewsLifeTimeUniqueUsers = this.ViewsLifeTimeUniqueUsers,
ViewsRecent = this.ViewsRecent,
ViewsRecentUniqueUsers = this.ViewsRecentUniqueUsers,
SiteId = this.SiteId,
SearchCenterUrl = this.SearchCenterUrl
};
}
#endregion
#region Groupify readiness
/// <summary>
/// Lists the reasons for not (yet) groupifying this site
/// </summary>
/// <returns>List of groupify blockers</returns>
public List<string> GroupifyBlockers()
{
List<string> groupifyBlockReasons = new List<string>();
// Don't use this as a blocker as it overlaps with the publishingFeature blocker and as such is confusing
//var blocker = SiteTemplateCheck(true);
//if (!String.IsNullOrEmpty(blocker))
//{
// groupifyBlockReasons.Add(blocker);
//}
if (Office365GroupId != Guid.Empty)
{
groupifyBlockReasons.Add("SiteHasOffice365Group");
}
if ((SitePublishingFeatureEnabled || WebPublishingFeatureEnabled) && DefineAsPublishingPortal())
{
groupifyBlockReasons.Add("PublishingFeatureEnabled");
}
// We prevent a root site from being group connected
if (IsRootSite)
{
groupifyBlockReasons.Add("IsTenantRootSite");
}
return groupifyBlockReasons;
}
/// <summary>
/// Lists the reasons for not (yet) groupifying this site
/// </summary>
/// <returns>List of groupify warnings</returns>
public List<string> GroupifyWarnings(string everyoneClaim, string everyoneExceptExternalUsersClaim)
{
List<string> groupifyWarningReasons = new List<string>();
var permissionWarnings = this.PermissionModel(everyoneClaim, everyoneExceptExternalUsersClaim);
if (permissionWarnings.Item2 != null && permissionWarnings.Item2.Count > 0)
{
groupifyWarningReasons.Add("PermissionWarnings");
}
if (SubSites)
{
groupifyWarningReasons.Add("SiteHasSubSites");
}
if (this.ModernWarnings().Count > 0)
{
groupifyWarningReasons.Add("ModernUIWarnings");
}
var warning = SiteTemplateCheck(false);
if (!String.IsNullOrEmpty(warning))
{
groupifyWarningReasons.Add(warning);
}
return groupifyWarningReasons;
}
private bool DefineAsPublishingPortal()
{
// Check web template
if (WebTemplate.Equals("BICENTERSITE#0", StringComparison.InvariantCultureIgnoreCase) || WebTemplate.Equals("BLANKINTERNET#0", StringComparison.InvariantCultureIgnoreCase) ||
WebTemplate.Equals("ENTERWIKI#0", StringComparison.InvariantCultureIgnoreCase) || WebTemplate.Equals("SRCHCEN#0", StringComparison.InvariantCultureIgnoreCase) ||
WebTemplate.Equals("SRCHCENTERLITE#0", StringComparison.InvariantCultureIgnoreCase) || WebTemplate.Equals("POINTPUBLISHINGHUB#0", StringComparison.InvariantCultureIgnoreCase) ||
WebTemplate.Equals("POINTPUBLISHINGTOPIC#0", StringComparison.InvariantCultureIgnoreCase) || WebTemplate.Equals("CMSPUBLISHING#0", StringComparison.InvariantCultureIgnoreCase))
{
return true;
}
// Check publishing page library usage
if (PublishingPagesUsed)
{
return true;
}
return false;
}
private string SiteTemplateCheck(bool blocker)
{
if (WebTemplate.Equals("STS#0", StringComparison.InvariantCultureIgnoreCase) || WebTemplate.Equals("DEV#0", StringComparison.InvariantCultureIgnoreCase))
{
// We're good with these
return null;
}
else if (WebTemplate.Equals("BICENTERSITE#0", StringComparison.InvariantCultureIgnoreCase) || WebTemplate.Equals("BLANKINTERNET#0", StringComparison.InvariantCultureIgnoreCase) ||
WebTemplate.Equals("ENTERWIKI#0", StringComparison.InvariantCultureIgnoreCase) || WebTemplate.Equals("SRCHCEN#0", StringComparison.InvariantCultureIgnoreCase) ||
WebTemplate.Equals("SRCHCENTERLITE#0", StringComparison.InvariantCultureIgnoreCase) || WebTemplate.Equals("POINTPUBLISHINGHUB#0", StringComparison.InvariantCultureIgnoreCase) ||
WebTemplate.Equals("POINTPUBLISHINGTOPIC#0", StringComparison.InvariantCultureIgnoreCase) || WebTemplate.Equals("CMSPUBLISHING#0", StringComparison.InvariantCultureIgnoreCase) ||
SiteColUrl.EndsWith("/sites/contenttypehub", StringComparison.InvariantCultureIgnoreCase))
{
// Block these
if (blocker)
{
return "IncompatibleWebTemplate";
}
}
else
{
// Provide a warning
if (!blocker)
{
return "DefaultHomePageImpacted";
}
}
return null;
}
/// <summary>
/// Proposed permission model and permission delta for the created group
/// </summary>
/// <returns>PRIVATE or PUBLIC</returns>
public Tuple<string, List<string>> PermissionModel(string claim1, string claim2)
{
// Do we have a public claim in Members, Owners or Admins? ==> PUBLIC site
bool hasPublicClaimWithEditPermissions = HasClaim(Admins, claim1, claim2);
if (!hasPublicClaimWithEditPermissions)
{
hasPublicClaimWithEditPermissions = HasClaim(Owners, claim1, claim2);
}
if (!hasPublicClaimWithEditPermissions)
{
hasPublicClaimWithEditPermissions = HasClaim(Members, claim1, claim2);
}
List<string> permissionDelta = new List<string>();
// Potential issue 1: private group, but public claim has been used outside of Site Admins, Owners, Members
//if (EveryoneClaimsGranted && !hasPublicClaimWithEditPermissions)
//{
// permissionDelta.Add("PrivateGroupButEveryoneUsedOutsideOfAdminOwnerMemberGroups");
//}
//// Potential issue 2: public claim in visitors group will lead to private site while still allow everyone view access
//if (HasClaim(Visitors, claim1, claim2) && !hasPublicClaim)
//{
// permissionDelta.Add("PrivateGroupButEveryoneInVisitors");
//}
// Potential issue 3: external sharing disabled, but will be possible by default on groups
if (!String.IsNullOrEmpty(SharingCapabilities))
{
if (SharingCapabilities.Equals("Disabled", StringComparison.InvariantCultureIgnoreCase))
{
permissionDelta.Add("SharingDisabledForSiteButGroupWillAllowExternalSharing");
}
}
// Potential issue 4: sub site has broken permission inheritance
if (SubSitesWithBrokenPermissionInheritance)
{
permissionDelta.Add("SubSiteWithBrokenPermissionInheritance");
}
// Potential issue 5: ad groups used which will not expand into the Office 365 group
if (ContainsADGroup(Owners) || ContainsADGroup(Admins) || ContainsADGroup(Members))
{
permissionDelta.Add("ADGroupWillNotBeExpanded");
}
return new Tuple<string, List<string>>(hasPublicClaimWithEditPermissions ? "PUBLIC" : "PRIVATE", permissionDelta);
}
/// <summary>
/// Lists the modern UI disablements
/// </summary>
/// <returns>List of modern UI disablements</returns>
public List<string> ModernWarnings()
{
List<string> modernWarnings = new List<string>();
if (ModernPageWebFeatureDisabled)
{
modernWarnings.Add("ModernPageFeatureDisabled");
}
if (ModernListSiteBlockingFeatureEnabled)
{
modernWarnings.Add("ModernListsBlockedAtSiteLevel");
}
if (ModernListWebBlockingFeatureEnabled)
{
modernWarnings.Add("ModernListsBlockedAtWebLevel");
}
if (MasterPage)
{
modernWarnings.Add("MasterPageUsed");
}
if (AlternateCSS)
{
modernWarnings.Add("AlternateCSSUsed");
}
/*if ((SiteUserCustomActions != null && SiteUserCustomActions.Count > 0) || (WebUserCustomActions != null && WebUserCustomActions.Count > 0))
{
modernWarnings.Add("UserCustomActionUsed");
}*/
if (SitePublishingFeatureEnabled || WebPublishingFeatureEnabled)
{
modernWarnings.Add("PublishingFeatureEnabled");
}
return modernWarnings;
}
#endregion
#region Security helpers
/// <summary>
/// Does the given user list contain the given claim
/// </summary>
/// <param name="users">List of users</param>
/// <param name="claim">Claim to check</param>
/// <returns>True if found, false otherwise</returns>
public bool HasClaim(List<UserEntity> users, string claim)
{
if (users == null)
{
return false;
}
return users.Where(p => p.LoginName.ToLower() == claim.ToLower()).Any();
}
/// <summary>
/// Does the given user list contain any of the 2 given claims
/// </summary>
/// <param name="users">List of users</param>
/// <param name="claim1">Claim to check</param>
/// <param name="claim2">Claim to check</param>
/// <returns>True if found, false otherwise</returns>
public bool HasClaim(List<UserEntity> users, string claim1, string claim2)
{
if (users == null)
{
return false;
}
return users.Where(p => p.LoginName.ToLower() == claim1.ToLower() || p.LoginName.ToLower() == claim2.ToLower()).Any();
}
/// <summary>
/// Is the given claim used for this site?
/// </summary>
/// <param name="claim">Claim to check</param>
/// <returns>True if found, false otherwise</returns>
public bool HasClaim(string claim)
{
if (HasClaim(Admins, claim))
{
return true;
}
if (HasClaim(Owners, claim))
{
return true;
}
if (HasClaim(Members, claim))
{
return true;
}
if (HasClaim(Visitors, claim))
{
return true;
}
return false;
}
/// <summary>
/// Is one of the given claims used for this site?
/// </summary>
/// <param name="claim1">Claim to check</param>
/// <param name="claim2">Claim to check</param>
/// <returns>True if found, false otherwise</returns>
public bool HasClaim(string claim1, string claim2)
{
if (HasClaim(Admins, claim1, claim2))
{
return true;
}
if (HasClaim(Owners, claim1, claim2))
{
return true;
}
if (HasClaim(Members, claim1, claim2))
{
return true;
}
if (HasClaim(Visitors, claim1, claim2))
{
return true;
}
return false;
}
/// <summary>
/// Does this user list contain a AD group?
/// </summary>
/// <param name="users">List of users</param>
/// <returns>True if it contains an AD group, false otherwise</returns>
public bool ContainsADGroup(List<UserEntity> users)
{
if (users == null)
{
return false;
}
return users.Where(p => p.LoginName.ToLower().StartsWith("c:0-.f|rolemanager|s-")).Any();
}
/// <summary>
/// Does this site use AD groups to grant permissions
/// </summary>
/// <returns>True or false</returns>
public bool ContainsADGroup()
{
if (ContainsADGroup(Admins))
{
return true;
}
if (ContainsADGroup(Owners))
{
return true;
}
if (ContainsADGroup(Members))
{
return true;
}
if (ContainsADGroup(Visitors))
{
return true;
}
return false;
}
#endregion
#region output formatting
public string IsTeamified()
{
if (this.HasTeamsTeam.HasValue)
{
if (this.HasTeamsTeam.Value)
{
return "True";
}
else
{
return "False";
}
}
else
{
return "";
}
}
public static string FormatUserList(List<UserEntity> users, string everyoneClaim = null, string everyoneExceptExternalUsersClaim = null)
{
string userList = "";
// Bail out if we've no data
if (users == null || users.Count == 0)
{
return userList;
}
foreach (var user in users)
{
string userToAdd = (!string.IsNullOrEmpty(user.Email) && user.Email.Contains("@")) ? user.Email : user.LoginName;
if (!userToAdd.Equals("SHAREPOINT\\system", StringComparison.InvariantCultureIgnoreCase))
{
if (!string.IsNullOrEmpty(everyoneClaim) && userToAdd.Equals(everyoneClaim, StringComparison.InvariantCultureIgnoreCase))
{
userToAdd = "{everyone}";
}
else if (!string.IsNullOrEmpty(everyoneExceptExternalUsersClaim) && userToAdd.Equals(everyoneExceptExternalUsersClaim, StringComparison.InvariantCultureIgnoreCase))
{
userToAdd = "{everyoneexceptexternalusers}";
}
userList = userList + (!string.IsNullOrEmpty(userList) ? $",{userToAdd}" : $"{userToAdd}");
}
}
return userList;
}
public static string FormatList(List<string> list)
{
string formattedList = "";
if (list == null || list.Count == 0)
{
return "";
}
foreach (var item in list)
{
formattedList = formattedList + (!string.IsNullOrEmpty(formattedList) ? $",{item}" : $"{item}");
}
return formattedList;
}
#endregion
}
}

781
Discovery/WFDiscovery.cs Normal file
Просмотреть файл

@ -0,0 +1,781 @@
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Workflow;
using Microsoft.SharePoint.Client.WorkflowServices;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using Common;
using System.Data;
namespace Discovery
{
public class WorkflowDiscovery
{
private string url;
private string siteColUrl;
/// <summary>
/// Site collection url being scanned
/// </summary>
public string SiteCollectionUrl
{
get
{
return this.siteColUrl;
}
}
/// <summary>
/// Site being scanned
/// </summary>
public string SiteUrl
{
get
{
return this.url;
}
}
private class SP2010WorkFlowAssociation
{
public string Scope { get; set; }
public WorkflowAssociation WorkflowAssociation { get; set; }
public List AssociatedList { get; set; }
public ContentType AssociatedContentType { get; set; }
}
private static readonly string[] OOBWorkflowIDStarts = new string[]
{
"e43856d2-1bb4-40ef-b08b-016d89a00", // Publishing approval
"3bfb07cb-5c6a-4266-849b-8d6711700409", // Collect feedback - 2010
"46c389a4-6e18-476c-aa17-289b0c79fb8f", // Collect feedback
"77c71f43-f403-484b-bcb2-303710e00409", // Collect signatures - 2010
"2f213931-3b93-4f81-b021-3022434a3114", // Collect signatures
"8ad4d8f0-93a7-4941-9657-cf3706f00409", // Approval - 2010
"b4154df4-cc53-4c4f-adef-1ecf0b7417f6", // Translation management
"c6964bff-bf8d-41ac-ad5e-b61ec111731a", // Three state
"c6964bff-bf8d-41ac-ad5e-b61ec111731c", // Approval
"dd19a800-37c1-43c0-816d-f8eb5f4a4145", // Disposition approval
};
List<SP2010WorkFlowAssociation> sp2010WorkflowAssociations = new List<SP2010WorkFlowAssociation>(20);
private List workflowList;
//public void DiscoverWorkflows(ClientContext cc, DataTable dt, string folderPath)
public void DiscoverWorkflows(ClientContext cc, DataTable dt)
{
try
{
//List<Guid, DateTime> wfLastRun = new List<Guid, DateTime>;
Web web = cc.Web;
// Pre-load needed properties in a single call
cc.Load(web, w => w.Id, w => w.ServerRelativeUrl, w => w.Url, w => w.WorkflowTemplates, w => w.WorkflowAssociations);
cc.Load(web, p => p.ContentTypes.Include(ct => ct.WorkflowAssociations, ct => ct.Name, ct => ct.StringId));
cc.Load(web, p => p.Lists.Include(li => li.Id, li => li.Title, li => li.Hidden, li => li.DefaultViewUrl, li => li.BaseTemplate, li => li.RootFolder.ServerRelativeUrl, li => li.ItemCount, li => li.WorkflowAssociations));
/*
foreach (List list in web.Lists)
{
cc.Load(list, l => l.ContentTypes.Equals("Workflow History"));
}
foreach(WorkflowAssociation wf in web.WorkflowAssociations)
{
cc.Load
}*/
cc.ExecuteQuery();
//yList.Each(x => { x.Enabled = false; });
//w => w.WorkflowAssociations.Each(x => x.HistoryListTitle)
var lists = web.Lists;
#region Site, reusable and list level 2013 workflow
// *******************************************
// Site, reusable and list level 2013 workflow
// *******************************************
// Retrieve the 2013 site level workflow definitions (including unpublished ones)
WorkflowDefinition[] siteWFDefinitions = null;
// Retrieve the 2013 site level workflow subscriptions
WorkflowSubscription[] siteWFSubscriptions = null;
Operations ops = new Operations();
//ops.CreateDataTableColumns(dt);
DataRow row = dt.NewRow();
try
{
var servicesManager = new WorkflowServicesManager(web.Context, web);
var deploymentService = servicesManager.GetWorkflowDeploymentService();
var subscriptionService = servicesManager.GetWorkflowSubscriptionService();
var definitions = deploymentService.EnumerateDefinitions(false);
web.Context.Load(definitions);
var subscriptions = subscriptionService.EnumerateSubscriptions();
web.Context.Load(subscriptions);
//for each subscription
// Get History List => SubscriptionID, HstoryListID
//Load Hstory list Item where item = listitems[ListItems.Length - 1]["Occurred"]
web.Context.ExecuteQuery();
siteWFDefinitions = definitions.ToArray();
siteWFSubscriptions = subscriptions.ToArray();
}
catch (ServerException ex)
{
// If there is no workflow service present in the farm this method will throw an error.
// Swallow the exception
}
#endregion
#region If SP2013 site scoped workflows are found
// We've found SP2013 site scoped workflows
if (siteWFDefinitions != null && siteWFDefinitions.Count() > 0)
{
foreach (var siteWFDefinition in siteWFDefinitions.Where(p => p.RestrictToType != null && (p.RestrictToType.Equals("site", StringComparison.InvariantCultureIgnoreCase) || p.RestrictToType.Equals("universal", StringComparison.InvariantCultureIgnoreCase))))
{
// Check if this workflow is also in use
var siteWorkflowSubscriptions = siteWFSubscriptions.Where(p => p.DefinitionId.Equals(siteWFDefinition.Id));
// Perform workflow analysis
var workFlowAnalysisResult = WorkflowManager.Instance.ParseWorkflowDefinition(siteWFDefinition.Xaml, WorkflowTypes.SP2013);
//if (siteWFDefinition.Xaml != null)
//{
// ops.SaveXamlFile(siteWFDefinition.Xaml, web, siteWFDefinition.DisplayName, "site", folderPath);
//}
var workFlowTriggerAnalysisResult = WorkflowManager.Instance.ParseWorkflowTriggers(GetWorkflowPropertyBool(siteWFDefinition.Properties, "SPDConfig.StartOnCreate"), GetWorkflowPropertyBool(siteWFDefinition.Properties, "SPDConfig.StartOnChange"), GetWorkflowPropertyBool(siteWFDefinition.Properties, "SPDConfig.StartManually"));
if (siteWorkflowSubscriptions.Count() > 0)
{
foreach (var siteWorkflowSubscription in siteWorkflowSubscriptions)
{
WorkflowScanResult workflowScanResult = new WorkflowScanResult()
{
SiteColUrl = this.SiteCollectionUrl,
SiteURL = this.SiteUrl,
ListTitle = "",
ListUrl = "",
ContentTypeId = "",
ContentTypeName = "",
Version = "2013",
Scope = "Site",
RestrictToType = siteWFDefinition.RestrictToType,
DefinitionName = siteWFDefinition.DisplayName,
DefinitionDescription = siteWFDefinition.Description,
SubscriptionName = siteWorkflowSubscription.Name,
HasSubscriptions = true,
Enabled = siteWorkflowSubscription.Enabled,
DefinitionId = siteWFDefinition.Id,
IsOOBWorkflow = false,
SubscriptionId = siteWorkflowSubscription.Id,
UsedActions = workFlowAnalysisResult?.WorkflowActions,
ActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.ActionCount : 0,
UsedTriggers = workFlowTriggerAnalysisResult?.WorkflowTriggers,
UnsupportedActionsInFlow = workFlowAnalysisResult?.UnsupportedActions,
CreatedBy = siteWFDefinition.Properties["vti_author"],
ModifiedBy = siteWFDefinition.Properties["ModifiedBy"],
UnsupportedActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.UnsupportedAccountCount : 0,
LastDefinitionEdit = GetWorkflowPropertyDateTime(siteWFDefinition.Properties, "Definition.ModifiedDateUTC"),
LastSubscriptionEdit = GetWorkflowPropertyDateTime(siteWorkflowSubscription.PropertyDefinitions, "SharePointWorkflowContext.Subscription.ModifiedDateUTC"),
};
//Add admin owners
//TBD
//Create a data row function
ops.AddRowToDataTable(workflowScanResult, dt, "2013","Site", siteWFDefinition.DisplayName,siteWFDefinition.Id.ToString(), false, web);
//if (!this.ScanJob.WorkflowScanResults.TryAdd($"workflowScanResult.SiteURL.{Guid.NewGuid()}", workflowScanResult))
//{
// ScanError error = new ScanError()
// {
// Error = $"Could not add 2013 site workflow scan result for {workflowScanResult.SiteColUrl}",
// SiteColUrl = this.SiteCollectionUrl,
// SiteURL = this.SiteUrl,
// Field1 = "WorkflowAnalyzer",
// };
// this.ScanJob.ScanErrors.Push(error);
//}
}
}
else
{
WorkflowScanResult workflowScanResult = new WorkflowScanResult()
{
SiteColUrl = this.SiteCollectionUrl,
SiteURL = this.SiteUrl,
ListTitle = "",
ListUrl = "",
ContentTypeId = "",
ContentTypeName = "",
Version = "2013",
Scope = "Site",
RestrictToType = siteWFDefinition.RestrictToType,
DefinitionName = siteWFDefinition.DisplayName,
DefinitionDescription = siteWFDefinition.Description,
SubscriptionName = "",
HasSubscriptions = false,
Enabled = false,
DefinitionId = siteWFDefinition.Id,
IsOOBWorkflow = false,
SubscriptionId = Guid.Empty,
UsedActions = workFlowAnalysisResult?.WorkflowActions,
ActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.ActionCount : 0,
UnsupportedActionsInFlow = workFlowAnalysisResult?.UnsupportedActions,
UnsupportedActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.UnsupportedAccountCount : 0,
UsedTriggers = workFlowTriggerAnalysisResult?.WorkflowTriggers,
LastDefinitionEdit = GetWorkflowPropertyDateTime(siteWFDefinition.Properties, "Definition.ModifiedDateUTC"),
};
ops.AddRowToDataTable(workflowScanResult, dt, "2013", "Site",siteWFDefinition.DisplayName,siteWFDefinition.Id.ToString(), false,web);
//if (!this.ScanJob.WorkflowScanResults.TryAdd($"workflowScanResult.SiteURL.{Guid.NewGuid()}", workflowScanResult))
//{
// ScanError error = new ScanError()
// {
// Error = $"Could not add 2013 site workflow scan result for {workflowScanResult.SiteColUrl}",
// SiteColUrl = this.SiteCollectionUrl,
// SiteURL = this.SiteUrl,
// Field1 = "WorkflowAnalyzer",
// };
// this.ScanJob.ScanErrors.Push(error);
//}
}
}
}
#endregion
#region If SP2013 list scoped workflows are found
// We've found SP2013 list scoped workflows
if (siteWFDefinitions != null && siteWFDefinitions.Count() > 0)
{
foreach (var listWFDefinition in siteWFDefinitions.Where(p => p.RestrictToType != null && (p.RestrictToType.Equals("list", StringComparison.InvariantCultureIgnoreCase) || p.RestrictToType.Equals("universal", StringComparison.InvariantCultureIgnoreCase))))
{
// Check if this workflow is also in use
var listWorkflowSubscriptions = siteWFSubscriptions.Where(p => p.DefinitionId.Equals(listWFDefinition.Id));
// Perform workflow analysis
var workFlowAnalysisResult = WorkflowManager.Instance.ParseWorkflowDefinition(listWFDefinition.Xaml, WorkflowTypes.SP2013);
//if (listWFDefinition.Xaml != null)
//{
// ops.SaveXamlFile(listWFDefinition.Xaml, web, listWFDefinition.DisplayName,"list", folderPath);
//}
var workFlowTriggerAnalysisResult = WorkflowManager.Instance.ParseWorkflowTriggers(GetWorkflowPropertyBool(listWFDefinition.Properties, "SPDConfig.StartOnCreate"), GetWorkflowPropertyBool(listWFDefinition.Properties, "SPDConfig.StartOnChange"), GetWorkflowPropertyBool(listWFDefinition.Properties, "SPDConfig.StartManually"));
if (listWorkflowSubscriptions.Count() > 0)
{
foreach (var listWorkflowSubscription in listWorkflowSubscriptions)
{
Guid associatedListId = Guid.Empty;
string associatedListTitle = "";
string associatedListUrl = "";
if (Guid.TryParse(GetWorkflowProperty(listWorkflowSubscription, "Microsoft.SharePoint.ActivationProperties.ListId"), out Guid associatedListIdValue))
{
associatedListId = associatedListIdValue;
// Lookup this list and update title and url
var listLookup = lists.Where(p => p.Id.Equals(associatedListId)).FirstOrDefault();
if (listLookup != null)
{
associatedListTitle = listLookup.Title;
associatedListUrl = listLookup.RootFolder.ServerRelativeUrl;
}
}
WorkflowScanResult workflowScanResult = new WorkflowScanResult()
{
SiteColUrl = this.SiteCollectionUrl,
SiteURL = this.SiteUrl,
ListTitle = associatedListTitle,
ListUrl = associatedListUrl,
ListId = associatedListId,
ContentTypeId = "",
ContentTypeName = "",
Version = "2013",
Scope = "List",
RestrictToType = listWFDefinition.RestrictToType,
DefinitionName = listWFDefinition.DisplayName,
DefinitionDescription = listWFDefinition.Description,
SubscriptionName = listWorkflowSubscription.Name,
HasSubscriptions = true,
Enabled = listWorkflowSubscription.Enabled,
DefinitionId = listWFDefinition.Id,
IsOOBWorkflow = false,
SubscriptionId = listWorkflowSubscription.Id,
UsedActions = workFlowAnalysisResult?.WorkflowActions,
ActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.ActionCount : 0,
UsedTriggers = workFlowTriggerAnalysisResult?.WorkflowTriggers,
UnsupportedActionsInFlow = workFlowAnalysisResult?.UnsupportedActions,
CreatedBy = listWFDefinition.Properties["vti_author"],
ModifiedBy = listWFDefinition.Properties["ModifiedBy"],
UnsupportedActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.UnsupportedAccountCount : 0,
LastDefinitionEdit = GetWorkflowPropertyDateTime(listWFDefinition.Properties, "Definition.ModifiedDateUTC"),
LastSubscriptionEdit = GetWorkflowPropertyDateTime(listWorkflowSubscription.PropertyDefinitions, "SharePointWorkflowContext.Subscription.ModifiedDateUTC"),
};
ops.AddRowToDataTable(workflowScanResult, dt, "2013", "List",listWFDefinition.DisplayName,listWFDefinition.Id.ToString(), false,web);
//if (!this.ScanJob.WorkflowScanResults.TryAdd($"workflowScanResult.SiteURL.{Guid.NewGuid()}", workflowScanResult))
//{
// ScanError error = new ScanError()
// {
// Error = $"Could not add 2013 list workflow scan result for {workflowScanResult.SiteColUrl}",
// SiteColUrl = this.SiteCollectionUrl,
// SiteURL = this.SiteUrl,
// Field1 = "WorkflowAnalyzer",
// };
// this.ScanJob.ScanErrors.Push(error);
//}
}
}
else
{
WorkflowScanResult workflowScanResult = new WorkflowScanResult()
{
SiteColUrl = this.SiteCollectionUrl,
SiteURL = this.SiteUrl,
ListTitle = "",
ListUrl = "",
ListId = Guid.Empty,
ContentTypeId = "",
ContentTypeName = "",
Version = "2013",
Scope = "List",
RestrictToType = listWFDefinition.RestrictToType,
DefinitionName = listWFDefinition.DisplayName,
DefinitionDescription = listWFDefinition.Description,
SubscriptionName = "",
HasSubscriptions = false,
Enabled = false,
DefinitionId = listWFDefinition.Id,
IsOOBWorkflow = false,
SubscriptionId = Guid.Empty,
UsedActions = workFlowAnalysisResult?.WorkflowActions,
ActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.ActionCount : 0,
UsedTriggers = workFlowTriggerAnalysisResult?.WorkflowTriggers,
UnsupportedActionsInFlow = workFlowAnalysisResult?.UnsupportedActions,
UnsupportedActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.UnsupportedAccountCount : 0,
LastDefinitionEdit = GetWorkflowPropertyDateTime(listWFDefinition.Properties, "Definition.ModifiedDateUTC"),
};
ops.AddRowToDataTable(workflowScanResult, dt, "2013", "Site",listWFDefinition.DisplayName,listWFDefinition.Id.ToString(), false,web);
//if (!this.ScanJob.WorkflowScanResults.TryAdd($"workflowScanResult.SiteURL.{Guid.NewGuid()}", workflowScanResult))
//{
// ScanError error = new ScanError()
// {
// Error = $"Could not add 2013 list workflow scan result for {workflowScanResult.SiteColUrl}",
// SiteColUrl = this.SiteCollectionUrl,
// SiteURL = this.SiteUrl,
// Field1 = "WorkflowAnalyzer",
// };
// this.ScanJob.ScanErrors.Push(error);
//}
}
}
}
#endregion
#region Find all Site, list and content type level 2010 workflows
// ***********************************************
// Site, list and content type level 2010 workflow
// ***********************************************
// Find all places where we have workflows associated (=subscribed) to SharePoint objects
if (web.WorkflowAssociations.Count > 0)
{
foreach (var workflowAssociation in web.WorkflowAssociations)
{
this.sp2010WorkflowAssociations.Add(new SP2010WorkFlowAssociation() { Scope = "Site", WorkflowAssociation = workflowAssociation });
}
}
foreach (var list in lists.Where(p => p.WorkflowAssociations.Count > 0))
{
foreach (var workflowAssociation in list.WorkflowAssociations)
{
this.sp2010WorkflowAssociations.Add(new SP2010WorkFlowAssociation() { Scope = "List", WorkflowAssociation = workflowAssociation, AssociatedList = list });
}
}
foreach (var ct in web.ContentTypes.Where(p => p.WorkflowAssociations.Count > 0))
{
foreach (var workflowAssociation in ct.WorkflowAssociations)
{
this.sp2010WorkflowAssociations.Add(new SP2010WorkFlowAssociation() { Scope = "ContentType", WorkflowAssociation = workflowAssociation, AssociatedContentType = ct });
}
}
#endregion
#region Process 2010 Workflows
// Process 2010 worflows
List<Guid> processedWorkflowAssociations = new List<Guid>(this.sp2010WorkflowAssociations.Count);
if (web.WorkflowTemplates.Count > 0)
{
// Process the templates
foreach (var workflowTemplate in web.WorkflowTemplates)
{
// do we have workflows associated for this template?
var associatedWorkflows = this.sp2010WorkflowAssociations.Where(p => p.WorkflowAssociation.BaseId.Equals(workflowTemplate.Id));
if (associatedWorkflows.Count() > 0)
{
// Perform workflow analysis
// If returning null than this workflow template was an OOB workflow one
WorkflowActionAnalysis workFlowAnalysisResult = null;
var loadedWorkflow = LoadWorkflowDefinition(cc, workflowTemplate);
if (!string.IsNullOrEmpty(loadedWorkflow?.Item1))
{
workFlowAnalysisResult = WorkflowManager.Instance.ParseWorkflowDefinition(loadedWorkflow.Item1, WorkflowTypes.SP2010);
}
foreach (var associatedWorkflow in associatedWorkflows)
{
processedWorkflowAssociations.Add(associatedWorkflow.WorkflowAssociation.Id);
// Skip previous versions of a workflow
// TODO: non-english sites will use another string
if (associatedWorkflow.WorkflowAssociation.Name.Contains("(Previous Version:"))
{
continue;
}
var workFlowTriggerAnalysisResult = WorkflowManager.Instance.ParseWorkflowTriggers(associatedWorkflow.WorkflowAssociation.AutoStartCreate, associatedWorkflow.WorkflowAssociation.AutoStartChange, associatedWorkflow.WorkflowAssociation.AllowManual);
WorkflowScanResult workflowScanResult = new WorkflowScanResult()
{
SiteColUrl = this.SiteCollectionUrl,
SiteURL = this.SiteUrl,
ListTitle = associatedWorkflow.AssociatedList != null ? associatedWorkflow.AssociatedList.Title : "",
ListUrl = associatedWorkflow.AssociatedList != null ? associatedWorkflow.AssociatedList.RootFolder.ServerRelativeUrl : "",
ListId = associatedWorkflow.AssociatedList != null ? associatedWorkflow.AssociatedList.Id : Guid.Empty,
ContentTypeId = associatedWorkflow.AssociatedContentType != null ? associatedWorkflow.AssociatedContentType.StringId : "",
ContentTypeName = associatedWorkflow.AssociatedContentType != null ? associatedWorkflow.AssociatedContentType.Name : "",
Version = "2010",
Scope = associatedWorkflow.Scope,
RestrictToType = "N/A",
DefinitionName = workflowTemplate.Name,
DefinitionDescription = workflowTemplate.Description,
SubscriptionName = associatedWorkflow.WorkflowAssociation.Name,
HasSubscriptions = true,
Enabled = associatedWorkflow.WorkflowAssociation.Enabled,
DefinitionId = workflowTemplate.Id,
IsOOBWorkflow = IsOOBWorkflow(workflowTemplate.Id.ToString()),
SubscriptionId = associatedWorkflow.WorkflowAssociation.Id,
UsedActions = workFlowAnalysisResult?.WorkflowActions,
ActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.ActionCount : 0,
UsedTriggers = workFlowTriggerAnalysisResult?.WorkflowTriggers,
UnsupportedActionsInFlow = workFlowAnalysisResult?.UnsupportedActions,
UnsupportedActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.UnsupportedAccountCount : 0,
LastDefinitionEdit = loadedWorkflow != null ? loadedWorkflow.Item2 : associatedWorkflow.WorkflowAssociation.Modified,
LastSubscriptionEdit = associatedWorkflow.WorkflowAssociation.Modified,
};
ops.AddRowToDataTable(workflowScanResult, dt, "2010", associatedWorkflow.Scope, workflowTemplate.Name, workflowTemplate.Id.ToString(), IsOOBWorkflow(workflowTemplate.Id.ToString()),web);
//if (!this.ScanJob.WorkflowScanResults.TryAdd($"workflowScanResult.SiteURL.{Guid.NewGuid()}", workflowScanResult))
//{
// ScanError error = new ScanError()
// {
// Error = $"Could not add 2010 {associatedWorkflow.Scope} type workflow scan result for {workflowScanResult.SiteColUrl}",
// SiteColUrl = this.SiteCollectionUrl,
// SiteURL = this.SiteUrl,
// Field1 = "WorkflowAnalyzer",
// };
// this.ScanJob.ScanErrors.Push(error);
//}
}
}
else
{
// Only add non OOB workflow templates when there's no associated workflow - makes the dataset smaller
if (!IsOOBWorkflow(workflowTemplate.Id.ToString()))
{
// Perform workflow analysis
WorkflowActionAnalysis workFlowAnalysisResult = null;
var loadedWorkflow = LoadWorkflowDefinition(cc, workflowTemplate);
if (!string.IsNullOrEmpty(loadedWorkflow?.Item1))
{
workFlowAnalysisResult = WorkflowManager.Instance.ParseWorkflowDefinition(loadedWorkflow.Item1, WorkflowTypes.SP2010);
}
var workFlowTriggerAnalysisResult = WorkflowManager.Instance.ParseWorkflowTriggers(workflowTemplate.AutoStartCreate, workflowTemplate.AutoStartChange, workflowTemplate.AllowManual);
WorkflowScanResult workflowScanResult = new WorkflowScanResult()
{
SiteColUrl = this.SiteCollectionUrl,
SiteURL = this.SiteUrl,
ListTitle = "",
ListUrl = "",
ListId = Guid.Empty,
ContentTypeId = "",
ContentTypeName = "",
Version = "2010",
Scope = "",
RestrictToType = "N/A",
DefinitionName = workflowTemplate.Name,
DefinitionDescription = workflowTemplate.Description,
SubscriptionName = "",
HasSubscriptions = false,
Enabled = false,
DefinitionId = workflowTemplate.Id,
IsOOBWorkflow = IsOOBWorkflow(workflowTemplate.Id.ToString()),
SubscriptionId = Guid.Empty,
UsedActions = workFlowAnalysisResult?.WorkflowActions,
ActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.ActionCount : 0,
UsedTriggers = workFlowTriggerAnalysisResult?.WorkflowTriggers,
LastDefinitionEdit = loadedWorkflow != null ? loadedWorkflow.Item2 : DateTime.MinValue,
};
ops.AddRowToDataTable(workflowScanResult, dt, "2010", "", workflowTemplate.Name, workflowTemplate.Id.ToString(), IsOOBWorkflow(workflowTemplate.Id.ToString()),web);
//if (!this.ScanJob.WorkflowScanResults.TryAdd($"workflowScanResult.SiteURL.{Guid.NewGuid()}", workflowScanResult))
//{
// ScanError error = new ScanError()
// {
// Error = $"Could not add 2010 type workflow scan result for {workflowScanResult.SiteColUrl}",
// SiteColUrl = this.SiteCollectionUrl,
// SiteURL = this.SiteUrl,
// Field1 = "WorkflowAnalyzer",
// };
// this.ScanJob.ScanErrors.Push(error);
//}
}
}
}
}
#endregion
#region All other Workflows
// Are there associated workflows for which we did not find a template (especially when the WF is created for a list)
foreach (var associatedWorkflow in this.sp2010WorkflowAssociations)
{
if (!processedWorkflowAssociations.Contains(associatedWorkflow.WorkflowAssociation.Id))
{
// Skip previous versions of a workflow
// TODO: non-english sites will use another string
if (associatedWorkflow.WorkflowAssociation.Name.Contains("(Previous Version:"))
{
continue;
}
// Perform workflow analysis
WorkflowActionAnalysis workFlowAnalysisResult = null;
var loadedWorkflow = LoadWorkflowDefinition(cc, associatedWorkflow.WorkflowAssociation);
if (!string.IsNullOrEmpty(loadedWorkflow?.Item1))
{
workFlowAnalysisResult = WorkflowManager.Instance.ParseWorkflowDefinition(loadedWorkflow.Item1, WorkflowTypes.SP2010);
}
var workFlowTriggerAnalysisResult = WorkflowManager.Instance.ParseWorkflowTriggers(associatedWorkflow.WorkflowAssociation.AutoStartCreate, associatedWorkflow.WorkflowAssociation.AutoStartChange, associatedWorkflow.WorkflowAssociation.AllowManual);
WorkflowScanResult workflowScanResult = new WorkflowScanResult()
{
SiteColUrl = this.SiteCollectionUrl,
SiteURL = this.SiteUrl,
ListTitle = associatedWorkflow.AssociatedList != null ? associatedWorkflow.AssociatedList.Title : "",
ListUrl = associatedWorkflow.AssociatedList != null ? associatedWorkflow.AssociatedList.RootFolder.ServerRelativeUrl : "",
ListId = associatedWorkflow.AssociatedList != null ? associatedWorkflow.AssociatedList.Id : Guid.Empty,
ContentTypeId = associatedWorkflow.AssociatedContentType != null ? associatedWorkflow.AssociatedContentType.StringId : "",
ContentTypeName = associatedWorkflow.AssociatedContentType != null ? associatedWorkflow.AssociatedContentType.Name : "",
Version = "2010",
Scope = associatedWorkflow.Scope,
RestrictToType = "N/A",
DefinitionName = associatedWorkflow.WorkflowAssociation.Name,
DefinitionDescription = "",
SubscriptionName = associatedWorkflow.WorkflowAssociation.Name,
HasSubscriptions = true,
Enabled = associatedWorkflow.WorkflowAssociation.Enabled,
DefinitionId = Guid.Empty,
IsOOBWorkflow = false,
SubscriptionId = associatedWorkflow.WorkflowAssociation.Id,
UsedActions = workFlowAnalysisResult?.WorkflowActions,
ActionCount = workFlowAnalysisResult != null ? workFlowAnalysisResult.ActionCount : 0,
UsedTriggers = workFlowTriggerAnalysisResult?.WorkflowTriggers,
LastSubscriptionEdit = associatedWorkflow.WorkflowAssociation.Modified,
LastDefinitionEdit = loadedWorkflow != null ? loadedWorkflow.Item2 : associatedWorkflow.WorkflowAssociation.Modified,
};
ops.AddRowToDataTable(workflowScanResult, dt, "2010", associatedWorkflow.Scope, associatedWorkflow.WorkflowAssociation.Name, Guid.Empty.ToString(), false,web);
//if (!this.ScanJob.WorkflowScanResults.TryAdd($"workflowScanResult.SiteURL.{Guid.NewGuid()}", workflowScanResult))
//{
// ScanError error = new ScanError()
// {
// Error = $"Could not add 2010 {associatedWorkflow.Scope} type workflow scan result for {workflowScanResult.SiteColUrl}",
// SiteColUrl = this.SiteCollectionUrl,
// SiteURL = this.SiteUrl,
// Field1 = "WorkflowAnalyzer",
// };
// this.ScanJob.ScanErrors.Push(error);
//}
}
}
#endregion
}
catch(Exception ex)
{
}
}
private bool GetWorkflowPropertyBool(IDictionary<string, string> properties, string property)
{
if (string.IsNullOrEmpty(property) || properties == null)
{
return false;
}
if (properties.ContainsKey(property))
{
if (bool.TryParse(properties[property], out bool parsedValue))
{
return parsedValue;
}
}
return false;
}
private DateTime GetWorkflowPropertyDateTime(IDictionary<string, string> properties, string property)
{
if (string.IsNullOrEmpty(property) || properties == null)
{
return DateTime.MinValue;
}
if (properties.ContainsKey(property))
{
if (DateTime.TryParseExact(properties[property], "M/d/yyyy h:m:s tt", new CultureInfo("en-US"), DateTimeStyles.AssumeUniversal, out DateTime parsedValue))
{
return parsedValue;
}
}
return DateTime.MinValue;
}
private string GetWorkflowProperty(WorkflowSubscription subscription, string propertyName)
{
if (subscription.PropertyDefinitions.ContainsKey(propertyName))
{
return subscription.PropertyDefinitions[propertyName];
}
return "";
}
private Tuple<string, DateTime> LoadWorkflowDefinition(ClientContext cc, WorkflowAssociation workflowAssociation)
{
// Ensure the workflow library was loaded if not yet done
LoadWorkflowLibrary(cc);
try
{
return GetFileInformation(cc.Web, $"{this.workflowList.RootFolder.ServerRelativeUrl}/{workflowAssociation.Name}/{workflowAssociation.Name}.xoml");
}
catch (Exception ex)
{
}
return null;
}
private Tuple<string, DateTime> LoadWorkflowDefinition(ClientContext cc, WorkflowTemplate workflowTemplate)
{
if (!IsOOBWorkflow(workflowTemplate.Id.ToString()))
{
// Ensure the workflow library was loaded if not yet done
LoadWorkflowLibrary(cc);
try
{
return GetFileInformation(cc.Web, $"{this.workflowList.RootFolder.ServerRelativeUrl}/{workflowTemplate.Name}/{workflowTemplate.Name}.xoml");
}
catch (Exception ex)
{
}
}
return null;
}
private List LoadWorkflowLibrary(ClientContext cc)
{
if (this.workflowList != null)
{
return this.workflowList;
}
var baseExpressions = new List<Expression<Func<List, object>>> { l => l.DefaultViewUrl, l => l.Id, l => l.BaseTemplate, l => l.OnQuickLaunch, l => l.DefaultViewUrl, l => l.Title, l => l.Hidden, l => l.RootFolder.ServerRelativeUrl };
var query = cc.Web.Lists.IncludeWithDefaultProperties(baseExpressions.ToArray());
var lists = cc.Web.Context.LoadQuery(query.Where(l => l.Title == "Workflows"));
cc.ExecuteQuery();
this.workflowList = lists.FirstOrDefault();
return this.workflowList;
}
private static Tuple<string, DateTime> GetFileInformation(Web web, string serverRelativeUrl)
{
//var file = web.GetFileByServerRelativePath(ResourcePath.FromDecodedUrl(serverRelativeUrl));
var file = web.GetFileByServerRelativeUrl(serverRelativeUrl);
web.Context.Load(file);
//web.Context.Load(file, p => p.ListItemAllFields);
web.Context.ExecuteQuery();
// TODO: fails when using sites.read.all role on xoml file download (access denied, requires ACP permission level)
ClientResult<Stream> stream = file.OpenBinaryStream();
web.Context.ExecuteQuery();
string returnString = string.Empty;
DateTime date = DateTime.MinValue;
//UPDATED the LOC from date = file.ListItemAllFields.LastModifiedDateTime(); TO date = file.TimeLastModified;
date = file.TimeLastModified;
using (Stream memStream = new MemoryStream())
{
CopyStream(stream.Value, memStream);
memStream.Position = 0;
StreamReader reader = new StreamReader(memStream);
returnString = reader.ReadToEnd();
}
return new Tuple<string, DateTime>(returnString, date);
}
private static void CopyStream(Stream source, Stream destination)
{
byte[] buffer = new byte[32768];
int bytesRead;
do
{
bytesRead = source.Read(buffer, 0, buffer.Length);
destination.Write(buffer, 0, bytesRead);
} while (bytesRead != 0);
}
private bool IsOOBWorkflow(string workflowTemplateId)
{
if (!string.IsNullOrEmpty(workflowTemplateId))
{
foreach (var oobId in WorkflowDiscovery.OOBWorkflowIDStarts)
{
if (workflowTemplateId.StartsWith(oobId))
{
return true;
}
}
}
return false;
}
}
}

Просмотреть файл

@ -0,0 +1,359 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml;
using System.Xml.Serialization;
using Common;
namespace Discovery
{
public sealed class WorkflowManager
{
private static readonly Lazy<WorkflowManager> _lazyInstance = new Lazy<WorkflowManager>(() => new WorkflowManager());
private WorkflowActions defaultWorkflowActions;
private static readonly string[] SP2013SupportedFlowActions = new string[]
{
"Microsoft.SharePoint.WorkflowServices.Activities.Comment",
"Microsoft.SharePoint.WorkflowServices.Activities.CallHTTPWebService",
"Microsoft.Activities.BuildDynamicValue",
"Microsoft.Activities.GetDynamicValueProperty",
"Microsoft.Activities.CountDynamicValueItems",
"Microsoft.SharePoint.WorkflowServices.Activities.SetField",
"System.Activities.Statements.Assign",
"Microsoft.SharePoint.WorkflowServices.Activities.CreateListItem",
"Microsoft.SharePoint.WorkflowServices.Activities.UpdateListItem",
"Microsoft.SharePoint.WorkflowServices.Activities.DeleteListItem",
"Microsoft.SharePoint.WorkflowServices.Activities.WaitForFieldChange",
"Microsoft.SharePoint.WorkflowServices.Activities.WaitForItemEvent",
"Microsoft.SharePoint.WorkflowServices.Activities.CheckOutItem",
"Microsoft.SharePoint.WorkflowServices.Activities.UndoCheckOutItem",
"Microsoft.SharePoint.WorkflowServices.Activities.CheckInItem",
"Microsoft.SharePoint.WorkflowServices.Activities.CopyItem",
"Microsoft.SharePoint.WorkflowServices.Activities.Email",
"Microsoft.Activities.Expressions.AddToDate",
"Microsoft.SharePoint.WorkflowServices.Activities.SetTimeField",
"Microsoft.SharePoint.WorkflowServices.Activities.DateInterval",
"Microsoft.SharePoint.WorkflowServices.Activities.ExtractSubstringFromEnd",
"Microsoft.SharePoint.WorkflowServices.Activities.ExtractSubstringFromStart",
"Microsoft.SharePoint.WorkflowServices.Activities.ExtractSubstringFromIndex",
"Microsoft.SharePoint.WorkflowServices.Activities.ExtractSubstringFromIndexLength",
"Microsoft.Activities.Expressions.Trim",
"Microsoft.Activities.Expressions.IndexOfString",
"Microsoft.Activities.Expressions.ReplaceString",
"Microsoft.SharePoint.WorkflowServices.Activities.DelayFor",
"Microsoft.SharePoint.WorkflowServices.Activities.DelayUntil",
"Microsoft.SharePoint.WorkflowServices.Activities.Calc",
"Microsoft.SharePoint.WorkflowServices.Activities.WriteToHistory",
"Microsoft.SharePoint.WorkflowServices.Activities.TranslateDocument",
"Microsoft.SharePoint.WorkflowServices.Activities.SetModerationStatus"
};
private static readonly string[] SP2010SupportedFlowActions = new string[]
{
"Microsoft.SharePoint.WorkflowActions.EmailActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.CollectDataTask",
"Microsoft.SharePoint.WorkflowActions.TodoItemTask",
"Microsoft.SharePoint.WorkflowActions.GroupAssignedTask",
"Microsoft.SharePoint.WorkflowActions.WithKey.SetFieldActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.UpdateItemActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.CreateItemActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.CopyItemActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.CheckOutItemActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.CheckInItemActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.UndoCheckOutItemActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.DeleteItemActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.WaitForActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.WaitForDocumentStatusActivity",
"Microsoft.SharePoint.WorkflowActions.SetVariableActivity",
"Microsoft.SharePoint.WorkflowActions.BuildStringActivity",
"Microsoft.SharePoint.WorkflowActions.MathActivity",
"Microsoft.SharePoint.WorkflowActions.DelayForActivity",
"Microsoft.SharePoint.WorkflowActions.DelayUntilActivity",
"System.Workflow.ComponentModel.TerminateActivity",
"Microsoft.SharePoint.WorkflowActions.LogToHistoryListActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.SetModerationStatusActivity",
"Microsoft.SharePoint.WorkflowActions.AddTimeToDateActivity",
"Microsoft.SharePoint.WorkflowActions.SetTimeFieldActivity",
"Microsoft.SharePoint.WorkflowActions.DateIntervalActivity",
"Microsoft.SharePoint.WorkflowActions.ExtractSubstringFromEndActivity",
"Microsoft.SharePoint.WorkflowActions.ExtractSubstringFromStartActivity",
"Microsoft.SharePoint.WorkflowActions.ExtractSubstringFromIndexActivity",
"Microsoft.SharePoint.WorkflowActions.ExtractSubstringFromIndexLengthActivity",
"Microsoft.SharePoint.WorkflowActions.CommentActivity",
"Microsoft.SharePoint.WorkflowActions.PersistOnCloseActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.AddListItemPermissionsActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.RemoveListItemPermissionsActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.ReplaceListItemPermissionsActivity",
"Microsoft.SharePoint.WorkflowActions.WithKey.InheritListItemParentPermissionsActivity"
};
/// <summary>
/// Get's the single workflow manager instance, singleton pattern
/// </summary>
public static WorkflowManager Instance
{
get
{
return _lazyInstance.Value;
}
}
#region Construction
private WorkflowManager()
{
// place for instance initialization code
defaultWorkflowActions = null;
}
#endregion
/// <summary>
/// Translate workflow trigger to a string
/// </summary>
/// <param name="onItemCreate">On create was set</param>
/// <param name="onItemChange">on change wat set</param>
/// <param name="allowManual">manual execution is allowed</param>
/// <returns>string representation of the used workflow triggers</returns>
public WorkflowTriggerAnalysis ParseWorkflowTriggers(bool onItemCreate, bool onItemChange, bool allowManual)
{
List<string> triggers = new List<string>();
if (onItemCreate)
{
triggers.Add("OnCreate");
}
if (onItemChange)
{
triggers.Add("OnChange");
}
if (allowManual)
{
triggers.Add("Manual");
}
return new WorkflowTriggerAnalysis() { WorkflowTriggers = triggers };
}
/// <summary>
/// Analysis a workflow definition and returns the used OOB actions
/// </summary>
/// <param name="workflowDefinition">Workflow definition to analyze</param>
/// <param name="wfType">2010 or 2013 workflow</param>
/// <returns>List of OOB actions used in the workflow</returns>
public WorkflowActionAnalysis ParseWorkflowDefinition(string workflowDefinition, WorkflowTypes wfType)
{
try
{
if (string.IsNullOrEmpty(workflowDefinition))
{
return null;
}
var xmlDoc = new XmlDocument();
xmlDoc.Load(WebpartMappingLoader.GenerateStreamFromString(workflowDefinition));
//determine whether document contains namespace
string namespaceName = "";
if (wfType == WorkflowTypes.SP2010)
{
namespaceName = "ns0";
}
else if (wfType == WorkflowTypes.SP2013)
{
namespaceName = "local";
}
var namespacePrefix = string.Empty;
XmlNamespaceManager nameSpaceManager = null;
if (xmlDoc.FirstChild.Attributes != null)
{
var xmlns = xmlDoc.FirstChild.Attributes[$"xmlns:{namespaceName}"];
if (xmlns != null)
{
nameSpaceManager = new XmlNamespaceManager(xmlDoc.NameTable);
nameSpaceManager.AddNamespace(namespaceName, xmlns.Value);
namespacePrefix = namespaceName + ":";
}
}
// Grab all nodes with the workflow action namespace (ns0/local)
var nodes = xmlDoc.SelectNodes($"//{namespacePrefix}*", nameSpaceManager);
// Iterate over the nodes and "identify the OOB activities"
List<string> usedOOBWorkflowActivities = new List<string>();
List<string> unsupportedOOBWorkflowActivities = new List<string>();
int actionCounter = 0;
int knownActionCounter = 0;
int unsupportedActionCounter = 0;
foreach (XmlNode node in nodes)
{
actionCounter++;
WorkflowAction defaultOOBWorkflowAction = null;
if (wfType == WorkflowTypes.SP2010)
{
defaultOOBWorkflowAction = this.defaultWorkflowActions.SP2010DefaultActions.Where(p => p.ActionNameShort == node.LocalName).FirstOrDefault();
}
else if (wfType == WorkflowTypes.SP2013)
{
defaultOOBWorkflowAction = this.defaultWorkflowActions.SP2013DefaultActions.Where(p => p.ActionNameShort == node.LocalName).FirstOrDefault();
}
if (defaultOOBWorkflowAction != null)
{
knownActionCounter++;
if (!usedOOBWorkflowActivities.Contains(defaultOOBWorkflowAction.ActionNameShort))
{
usedOOBWorkflowActivities.Add(defaultOOBWorkflowAction.ActionNameShort);
}
if (wfType == WorkflowTypes.SP2010)
{
if (!WorkflowManager.SP2010SupportedFlowActions.Contains(defaultOOBWorkflowAction.ActionName))
{
unsupportedActionCounter++;
unsupportedOOBWorkflowActivities.Add(defaultOOBWorkflowAction.ActionNameShort);
}
}
else if (wfType == WorkflowTypes.SP2013)
{
if (!WorkflowManager.SP2013SupportedFlowActions.Contains(defaultOOBWorkflowAction.ActionName))
{
unsupportedActionCounter++;
unsupportedOOBWorkflowActivities.Add(defaultOOBWorkflowAction.ActionNameShort);
}
}
}
}
return new WorkflowActionAnalysis()
{
WorkflowActions = usedOOBWorkflowActivities,
ActionCount = knownActionCounter,
UnsupportedActions = unsupportedOOBWorkflowActivities,
UnsupportedAccountCount = unsupportedActionCounter
};
}
catch (Exception ex)
{
// TODO
// Eat exception for now
}
return null;
}
/// <summary>
/// Trigger the population of the default workflow actions for 2010/2013 workflows
/// </summary>
public void LoadWorkflowDefaultActions()
{
WorkflowActions wfActions = new WorkflowActions();
var sp2010Actions = LoadDefaultActions(WorkflowTypes.SP2010);
var sp2013Actions = LoadDefaultActions(WorkflowTypes.SP2013);
foreach (var action in sp2010Actions)
{
wfActions.SP2010DefaultActions.Add(new WorkflowAction() { ActionName = action, ActionNameShort = GetShortName(action) });
}
foreach (var action in sp2013Actions)
{
wfActions.SP2013DefaultActions.Add(new WorkflowAction() { ActionName = action, ActionNameShort = GetShortName(action) });
}
this.defaultWorkflowActions = wfActions;
}
#region Helper methods
private string GetShortName(string action)
{
if (action.Contains("."))
{
return action.Substring(action.LastIndexOf(".") + 1);
}
return action;
}
private List<string> LoadDefaultActions(WorkflowTypes wfType)
{
List<string> wfActionsList = new List<string>();
string fileName = null;
if (wfType == WorkflowTypes.SP2010)
{
//fileName = "SharePointPnP.Modernization.Scanner.Core.Workflow.sp2010wfmodel.xml";
fileName = "Common.sp2010wfmodel.xml";
}
else if (wfType == WorkflowTypes.SP2013)
{
//fileName = "SharePointPnP.Modernization.Scanner.Core.Workflow.sp2013wfmodel.xml";
fileName = "Common.sp2013wfmodel.xml";
}
var wfModelString = "";
//using (Stream stream = typeof(WorkflowManager).Assembly.GetManifestResourceStream(fileName))
using (Stream stream = typeof(WorkflowAction).Assembly.GetManifestResourceStream(fileName))
{
using (StreamReader reader = new StreamReader(stream))
{
wfModelString = reader.ReadToEnd();
}
}
if (!string.IsNullOrEmpty(wfModelString))
{
if (wfType == WorkflowTypes.SP2010)
{
Common.SP2010.WorkflowInfo wfInformation;
using (var stream = WebpartMappingLoader.GenerateStreamFromString(wfModelString))
{
XmlSerializer xmlWorkflowInformation = new XmlSerializer(typeof(Common.SP2010.WorkflowInfo));
wfInformation = (Common.SP2010.WorkflowInfo)xmlWorkflowInformation.Deserialize(stream);
}
foreach (var wfAction in wfInformation.Actions.Action)
{
if (!wfActionsList.Contains(wfAction.ClassName))
{
wfActionsList.Add(wfAction.ClassName);
}
}
}
else if (wfType == WorkflowTypes.SP2013)
{
Common.SP2013.WorkflowInfo wfInformation;
using (var stream = WebpartMappingLoader.GenerateStreamFromString(wfModelString))
{
XmlSerializer xmlWorkflowInformation = new XmlSerializer(typeof(Common.SP2013.WorkflowInfo));
wfInformation = (Common.SP2013.WorkflowInfo)xmlWorkflowInformation.Deserialize(stream);
}
foreach (var wfAction in wfInformation.Actions.Action)
{
if (!wfActionsList.Contains(wfAction.ClassName))
{
wfActionsList.Add(wfAction.ClassName);
}
}
}
}
return wfActionsList;
}
#endregion
}
}

47
Discovery/app.config Normal file
Просмотреть файл

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

39
Discovery/packages.config Normal file
Просмотреть файл

@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.9.9" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.Azure.ActiveDirectory.GraphClient" version="2.1.0" targetFramework="net461" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net461" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.0" targetFramework="net461" />
<package id="Microsoft.Data.Edm" version="5.8.4" targetFramework="net461" />
<package id="Microsoft.Data.OData" version="5.8.4" targetFramework="net461" />
<package id="Microsoft.Data.Services.Client" version="5.8.4" targetFramework="net461" />
<package id="Microsoft.Graph" version="1.9.0" targetFramework="net461" />
<package id="Microsoft.Graph.Core" version="1.9.0" targetFramework="net461" />
<package id="Microsoft.IdentityModel" version="7.0.0" targetFramework="net461" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="3.19.8" targetFramework="net461" />
<package id="Microsoft.IdentityModel.JsonWebTokens" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.IdentityModel.Logging" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.IdentityModel.Tokens" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.SharePointOnline.CSOM" version="16.1.20317.12000" targetFramework="net461" />
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net461" />
<package id="SharePointPnP.IdentityModel.Extensions" version="1.2.4" targetFramework="net461" />
<package id="SharePointPnPCoreOnline" version="3.24.2008.1" targetFramework="net461" />
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
<package id="System.IdentityModel.Tokens.Jwt" version="5.2.4" targetFramework="net461" />
<package id="System.Memory" version="4.5.4" targetFramework="net461" />
<package id="System.Net.Http" version="4.3.1" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net461" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
<package id="System.Spatial" version="5.8.4" targetFramework="net461" />
<package id="System.Text.Encodings.Web" version="4.7.1" targetFramework="net461" />
<package id="System.Text.Json" version="4.7.2" targetFramework="net461" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
<package id="WindowsAzure.Storage" version="7.0.0" targetFramework="net461" />
</packages>

1589
Discovery/sp2010wfmodel.xml Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

1919
Discovery/sp2013wfmodel.xml Normal file

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.1062
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{04A36617-4353-4779-92F9-36BAFFE6A5F6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Root", "Root\Root.csproj", "{C36A3FF3-1A6B-4ACD-94FC-0BC798082603}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Analysis", "Analysis\Analysis.csproj", "{11F9C187-6E26-43CC-AA57-B82049101ECC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Discovery", "Discovery\Discovery.csproj", "{66180571-9292-4411-8B01-B31DCE2CC0E8}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{04A36617-4353-4779-92F9-36BAFFE6A5F6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{04A36617-4353-4779-92F9-36BAFFE6A5F6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{04A36617-4353-4779-92F9-36BAFFE6A5F6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{04A36617-4353-4779-92F9-36BAFFE6A5F6}.Release|Any CPU.Build.0 = Release|Any CPU
{C36A3FF3-1A6B-4ACD-94FC-0BC798082603}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C36A3FF3-1A6B-4ACD-94FC-0BC798082603}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C36A3FF3-1A6B-4ACD-94FC-0BC798082603}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C36A3FF3-1A6B-4ACD-94FC-0BC798082603}.Release|Any CPU.Build.0 = Release|Any CPU
{11F9C187-6E26-43CC-AA57-B82049101ECC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{11F9C187-6E26-43CC-AA57-B82049101ECC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{11F9C187-6E26-43CC-AA57-B82049101ECC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{11F9C187-6E26-43CC-AA57-B82049101ECC}.Release|Any CPU.Build.0 = Release|Any CPU
{66180571-9292-4411-8B01-B31DCE2CC0E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{66180571-9292-4411-8B01-B31DCE2CC0E8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{66180571-9292-4411-8B01-B31DCE2CC0E8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{66180571-9292-4411-8B01-B31DCE2CC0E8}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E934118A-2D8B-4D11-A008-953F53637EBD}
EndGlobalSection
EndGlobal

Просмотреть файл

@ -0,0 +1,57 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Management.Automation;
using System.Text;
using System.Threading.Tasks;
using Common;
namespace Root
{
public class CmdCompareDownloadWorkflows : PSCmdlet
{
private string logFolderPath;
public DirectoryInfo logFolder;
[Parameter(Mandatory = true, HelpMessage = @"The path where workflows are downloaded to for analyzing (e.g. c:\temp\workflows")]
public string OutputDirectory { get; set; }
protected override void BeginProcessing()
{
if (!Directory.Exists(string.Concat(OutputDirectory, @"\Logs")))
{
logFolder = System.IO.Directory.CreateDirectory(string.Concat(OutputDirectory, @"\Logs"));
logFolderPath = logFolder.FullName;
Logging.LOG_DIRECTORY = logFolderPath;
Logging.GetInstance().WriteToLogFile(Logging.Info, "Log folder created");
}
else
{
logFolderPath = string.Concat(OutputDirectory, @"\Logs");
Logging.LOG_DIRECTORY = logFolderPath;
}
base.BeginProcessing();
}
protected override void EndProcessing()
{
base.EndProcessing();
}
protected override void ProcessRecord()
{
Console.WriteLine(System.Environment.NewLine);
Host.UI.WriteLine(ConsoleColor.Cyan, Host.UI.RawUI.BackgroundColor, "Beginning to analyze and compare SharePoint Workflows to Power Automate features.. ");
Console.WriteLine(System.Environment.NewLine);
Host.UI.WriteLine(ConsoleColor.Cyan, Host.UI.RawUI.BackgroundColor, "Please standby. This may take some time.. ");
Console.WriteLine(System.Environment.NewLine);
Logging.GetInstance().WriteToLogFile(Logging.Info, "Beginning to analyze and compare SharePoint Workflows to Power Automate features.. ");
//CompareInfoPathForms cif = new CompareInfoPathForms();
//cif.CompareInfoPathToPowerApps(OutputDirectory);
CompareWorkflows cwf = new CompareWorkflows();
cwf.CompareWorkflowsToPowerAutomate(OutputDirectory);
}
}
}

Просмотреть файл

@ -0,0 +1,309 @@
using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using System.Management.Automation;
using Microsoft.SharePoint.Client;
using System.Security;
using OfficeDevPnP.Core;
using Common;
using Discovery;
namespace Root
{
public class PwdDynamicParam
{
private SecureString pwd;
[Parameter(Mandatory = true, HelpMessage = "Specify the password as a secure string")]
public SecureString Password
{
get { return pwd; }
set { pwd = value; }
}
}
/// <summary>
/// Commandlet to discover the InfoPath forms in
/// Onpremise environments that are published to
/// list and document libraries
/// </summary>
/// <returns></returns> ///
///
[Cmdlet(VerbsCommon.Get, "WorkflowAssociationsForOnprem")]
//public class CmdGetWorkflowAssociationsForOnprem : PSCmdlet,IDynamicParameters
public class CmdGetWorkflowAssociationsForOnprem : PSCmdlet
{
private string assessmentScope;
private static List<string> sitecollectionUrls = new List<string>();
[Parameter(Mandatory = true, HelpMessage = "Specify the Domain name of the user account")]
public string DomainName;
[Parameter(Mandatory = false, HelpMessage = "Specify the password (NOTE : This paramater takes password as plain text. If you like to provide the password as a secure string, ignore this parameter. Youw will be prompted to type in the password as a secure string")]
public string PasswordPlainText;
[Parameter(Mandatory = true, HelpMessage = "Specify the user account for authentication")]
public string UserAccount;
[Parameter(Mandatory = false, HelpMessage = "Specify the file path of a text file containing target site collection URLs")]
public string SiteCollectionURLFilePath;
[Parameter(Mandatory = false, HelpMessage = "Specify the URL of the Web Application")]
public string WebApplicationUrl;
[Parameter(Mandatory = false, HelpMessage = "Specify the URL of the Site Collection")]
public string SiteCollectionUrl;
public bool DownloadWorkflowDefinitions
{
get { return downloadWFDefinitions; }
set { downloadWFDefinitions = value; }
}
private bool downloadWFDefinitions;
[Parameter(Mandatory = true, HelpMessage = @"The path where the Assessment Summary, logs, Workflow definitions are downloaded (if DownloadForms parameter is set to true) for analyzing (e.g. F:\temp\WorkflowDefinitions")]
public string AssessmentOutputFolder;
private string logFolderPath;
public DirectoryInfo logFolder;
private PwdDynamicParam pwdDyn = null;
private bool pwdIsPlain = true;
public DataTable dtWorkflowLocations = new DataTable();
public object GetDynamicParameters()
{
if (Object.Equals(PasswordPlainText, null))
{
pwdDyn = new PwdDynamicParam();
pwdIsPlain = false;
return pwdDyn;
}
else
return null;
}
protected override void BeginProcessing()
{
if (!Directory.Exists(string.Concat(AssessmentOutputFolder, @"\Logs")))
{
logFolder = System.IO.Directory.CreateDirectory(string.Concat(AssessmentOutputFolder, @"\Logs"));
logFolderPath = logFolder.FullName;
Logging.LOG_DIRECTORY = logFolderPath;
Logging.GetInstance().WriteToLogFile(Logging.Info, "Log folder created");
}
else
{
logFolderPath = string.Concat(AssessmentOutputFolder, @"\Logs");
Logging.LOG_DIRECTORY = logFolderPath;
}
base.BeginProcessing();
}
protected override void EndProcessing()
{
base.EndProcessing();
}
protected override void ProcessRecord()
{
try
{
if (String.IsNullOrEmpty(WebApplicationUrl))
{
if (String.IsNullOrEmpty(SiteCollectionUrl))
{
assessmentScope = "Farm";
BeginToAssess();
}
else
{
assessmentScope = "SiteCollection";
BeginToAssess();
}
}
else
{
if (!String.IsNullOrEmpty(SiteCollectionUrl))
{
WriteWarning("Provide either the Web App URL or the Site Collection URL, but not both !");
}
else
{
assessmentScope = "WebApplication";
BeginToAssess();
}
}
}
catch (Exception ex)
{
Host.UI.WriteLine(ConsoleColor.DarkRed, Host.UI.RawUI.BackgroundColor, ex.Message);
}
}
protected void BeginToAssess()
{
Operations ops = new Operations();
try
{
//New Code Starts
string userInput = string.Empty;
Console.WriteLine(System.Environment.NewLine);
Host.UI.WriteLine(ConsoleColor.Cyan, Host.UI.RawUI.BackgroundColor, "The assessment is scoped to run at " + assessmentScope +
" level. Would you like to proceed? [Y] to continue, [N] to abort.");
var op = this.InvokeCommand.InvokeScript("Read-Host");
userInput = op[0].ToString().ToLower();
while (!userInput.Equals("y") && !userInput.Equals("n"))
{
Host.UI.WriteLine(ConsoleColor.Cyan, Host.UI.RawUI.BackgroundColor, "Invalid input. Press [Y] to continue, [N] to abort.");
op = this.InvokeCommand.InvokeScript("Read-Host");
userInput = op[0].ToString().ToLower();
}
if (userInput.Equals("y"))
{
GetWorkflowsforOnPrem objonPrem = new GetWorkflowsforOnPrem();
ops.CreateDirectoryStructure(AssessmentOutputFolder);
//Logging.GetInstance().WriteToLogFile(Logging.Info, "Beginning assessment..");
Console.WriteLine(System.Environment.NewLine);
Host.UI.WriteLine(ConsoleColor.Yellow, Host.UI.RawUI.BackgroundColor, "Beginning assessment..");
if (assessmentScope.Equals("Farm"))
{
objonPrem.Scope = "Farm";
objonPrem.Url = null;
}
else if (assessmentScope.Equals("WebApplication"))
{
objonPrem.Scope = "WebApplication";
objonPrem.Url = WebApplicationUrl;
}
else if (assessmentScope.Equals("SiteCollection"))
{
objonPrem.Scope = "SiteCollection";
objonPrem.Url = SiteCollectionUrl;
}
objonPrem.DownloadPath = AssessmentOutputFolder;
//Set UserName & Password
objonPrem.userName = UserAccount;
if (pwdIsPlain)
objonPrem.password = PasswordPlainText;
else
objonPrem.password = pwdDyn.Password.ToString();
//dtWorkflowLocations = objonPrem.Execute(Credential);
dtWorkflowLocations = objonPrem.Execute();
//Save the CSV file
string csvFilePath = string.Concat(AssessmentOutputFolder, ops.summaryFolder, ops.summaryFile);
ops.WriteToCsvFile(dtWorkflowLocations, csvFilePath);
}
else if (userInput.Equals("n"))
{
Host.UI.WriteLine(ConsoleColor.Cyan, Host.UI.RawUI.BackgroundColor, "Operation aborted as per your input !");
}
//New Code Ends
//Create Assessment folders
/* old code commented out
ops.CreateDirectoryStructure(AssessmentOutputFolder);
ops.CreateDataTableColumns(dt);
string csvFilePath = string.Concat(AssessmentOutputFolder, ops.summaryFolder, ops.summaryFile);
string downloadXomlFolderPath = string.Concat(AssessmentOutputFolder, ops.downloadedFormsFolder);
sitecollectionUrls.Clear();
int scCount = LoopSiteCollectionUrls(sitecollectionUrls, SiteCollectionURLFilePath);
if (scCount == 0)
{
WriteWarning(string.Format("The text file located at {0} does not contain Site Collection URLs and appears to be empty !", SiteCollectionURLFilePath));
}
else
{
AuthenticationManager authManager = new AuthenticationManager();
ClientContext cc = null;
foreach (var scUrl in sitecollectionUrls)
{
if (pwdIsPlain)
cc = authManager.GetNetworkCredentialAuthenticatedContext(scUrl, UserAccount, PasswordPlainText, DomainName);
else
cc = authManager.GetNetworkCredentialAuthenticatedContext(scUrl, UserAccount, pwdDyn.Password, DomainName);
Web web = cc.Web;
cc.Load(web, website => website.Title);
cc.ExecuteQuery();
Host.UI.WriteLine(ConsoleColor.DarkMagenta, Host.UI.RawUI.BackgroundColor, web.Title);
WorkflowManager.Instance.LoadWorkflowDefaultActions();
WorkflowDiscovery wfDisc = new WorkflowDiscovery();
wfDisc.DiscoverWorkflows(cc, dt);
}
//Save the CSV file
ops.WriteToCsvFile(dt, csvFilePath);
}
*/
}
catch (Exception ex)
{
Host.UI.WriteLine(ConsoleColor.DarkRed, Host.UI.RawUI.BackgroundColor, ex.Message);
}
}
private static SecureString GetPassword()
{
ConsoleKeyInfo info;
//Get the user's password as a SecureString
SecureString securePassword = new SecureString();
do
{
info = Console.ReadKey(true);
if (info.Key != ConsoleKey.Enter)
{
securePassword.AppendChar(info.KeyChar);
}
}
while (info.Key != ConsoleKey.Enter);
return securePassword;
}
public int LoopSiteCollectionUrls(List<string> sitecollectionUrls, string filePath)
{
int counter = 0;
try
{
string line;
System.IO.StreamReader file =
new System.IO.StreamReader(filePath);
while ((line = file.ReadLine()) != null)
{
//removes all extra spaces etc.
sitecollectionUrls.Add(line.TrimEnd());
//System.Console.WriteLine(line);
counter++;
}
file.Close();
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
return counter;
}
}
}

Просмотреть файл

@ -0,0 +1,184 @@
using Common;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
using System.IO;
using System.Linq;
using System.Management.Automation;
using System.Text;
using System.Threading.Tasks;
namespace Root
{
[Cmdlet(VerbsCommon.Get, "WorkflowAssociationsForSPO")]
public class CmdGetWorkflowAssociationsForSPO : PSCmdlet
{
private static List<string> sitecollectionUrls = new List<string>();
//[Parameter(Mandatory = true, HelpMessage = "Credentials to login to SPO for InfoPath Online Assessment")]
////[System.Management.Automation.PSCredential]
//[System.Management.Automation.CredentialAttribute()]
//PSCredential Credential;
private string assessmentScope;
[Parameter(Mandatory = true, ParameterSetName = "Credential")]
public PSCredential Credential;
[Parameter(Mandatory = false, HelpMessage = "Specify the tenant name of your SPO site collections")]
public string TenantName;
[Parameter(Mandatory = false, HelpMessage = "Specify the file path of a text file containing all SPO site collection URLs")]
public string SiteCollectionURLFilePath;
[Parameter(Mandatory = true, HelpMessage = "Set this switch to $true if you would like to download the Workflows for detailed assessment")]
public bool DownloadWorkflows
{
get { return downloadWorkflows; }
set { downloadWorkflows = value; }
}
private bool downloadWorkflows;
[Parameter(Mandatory = true, HelpMessage = @"The path where the Assessment Summary, logs, Workflows forms are downloaded (if DownloadWorkflow parameter is set to true) for analyzing (e.g. F:\temp\Workflows")]
public string AssessmentOutputFolder;
private string logFolderPath;
public DirectoryInfo logFolder;
protected override void BeginProcessing()
{
//Create required folders
if (!Directory.Exists(string.Concat(AssessmentOutputFolder, @"\Logs")))
{
logFolder = System.IO.Directory.CreateDirectory(string.Concat(AssessmentOutputFolder, @"\Logs"));
logFolderPath = logFolder.FullName;
Logging.LOG_DIRECTORY = logFolderPath;
Logging.GetInstance().WriteToLogFile(Logging.Info, "Log folder created");
}
else
{
logFolderPath = string.Concat(AssessmentOutputFolder, @"\Logs");
Logging.LOG_DIRECTORY = logFolderPath;
}
base.BeginProcessing();
}
protected override void EndProcessing()
{
base.EndProcessing();
}
protected override void ProcessRecord()
{
try
{
try
{
if (String.IsNullOrEmpty(TenantName) && String.IsNullOrEmpty(SiteCollectionURLFilePath))
{
WriteWarning("Provide either the Tenant Name or the Site Collection File containing SPO URLs !");
}
else if (!String.IsNullOrEmpty(TenantName))
{
assessmentScope = "Tenant";
BeginToAssess();
}
else
{
assessmentScope = "SiteCollection";
BeginToAssess();
}
}
catch (Exception ex)
{
Host.UI.WriteLine(ConsoleColor.DarkRed, Host.UI.RawUI.BackgroundColor, ex.Message);
}
}
catch (Exception ex)
{ }
}
protected void BeginToAssess()
{
GetWorkflowForSPOnline objSPOnline = new GetWorkflowForSPOnline();
Operations ops = new Operations();
try
{
string downloadXomlFolderPath = string.Concat(AssessmentOutputFolder, ops.downloadedFormsFolder);
//Scope level code getting addded
string userInput = string.Empty;
Console.WriteLine(System.Environment.NewLine);
Collection<PSObject> op = new Collection<PSObject>();
List<string> allSPOTenantSites = new List<string>();
if (assessmentScope == "Tenant")
{
allSPOTenantSites = ops.GetAllTenantSites(TenantName, Credential);
Host.UI.WriteLine(ConsoleColor.Cyan, Host.UI.RawUI.BackgroundColor, "The assessment is scoped to run at " + assessmentScope +
" level. There are altogether " + allSPOTenantSites.Count + " sites in your tenant. Would you like to proceed? [Y] to continue, [N] to abort.");
op = this.InvokeCommand.InvokeScript("Read-Host");
userInput = op[0].ToString().ToLower();
}
else
{
Host.UI.WriteLine(ConsoleColor.Cyan, Host.UI.RawUI.BackgroundColor, "The assessment is scoped to run at " + assessmentScope +
" level. Would you like to proceed? [Y] to continue, [N] to abort.");
op = this.InvokeCommand.InvokeScript("Read-Host");
userInput = op[0].ToString().ToLower();
}
while (!userInput.Equals("y") && !userInput.Equals("n"))
{
Host.UI.WriteLine(ConsoleColor.Cyan, Host.UI.RawUI.BackgroundColor, "Invalid input. Press [Y] to continue, [N] to abort.");
op = this.InvokeCommand.InvokeScript("Read-Host");
userInput = op[0].ToString().ToLower();
}
if (userInput.Equals("y"))
{
DataTable dtWorkflowLocations = new DataTable();
//Clear the collection before running
sitecollectionUrls.Clear();
//Create Assessment output folders
ops.CreateDirectoryStructure(AssessmentOutputFolder);
if (assessmentScope == "Tenant")
{
sitecollectionUrls = allSPOTenantSites;
}
else
{
objSPOnline.ReadInfoPathOnlineSiteCollection(sitecollectionUrls, SiteCollectionURLFilePath);
}
if (sitecollectionUrls.Count == 0)
{
Host.UI.WriteLine(ConsoleColor.Red, Host.UI.RawUI.BackgroundColor,
string.Format("Site Collection URLs at {0} text file were empty, please update the text file with SPO Workflows site URL.", SiteCollectionURLFilePath));
Logging.GetInstance().WriteToLogFile(Logging.Info, string.Format("Site Collection URLs at {0} text file were empty, please update the text file with SPO Workflows site URL.", SiteCollectionURLFilePath));
}
else
{
string csvFilePath = string.Concat(AssessmentOutputFolder, ops.summaryFolder, ops.summaryFile);
if (DownloadWorkflows)
{ }
else
{
objSPOnline.DownloadPath = AssessmentOutputFolder;
objSPOnline.DownloadForms = DownloadWorkflows;
dtWorkflowLocations = objSPOnline.Execute(Credential, sitecollectionUrls);
//Save the CSV file
ops.WriteToCsvFile(dtWorkflowLocations, csvFilePath);
}
}
}
else if (userInput.Equals("n"))
{
Host.UI.WriteLine(ConsoleColor.Cyan, Host.UI.RawUI.BackgroundColor, "Operation aborted as per your input !");
}
}
catch (Exception ex)
{
Host.UI.WriteLine(ConsoleColor.DarkRed, Host.UI.RawUI.BackgroundColor, ex.Message);
}
}
}
}

Просмотреть файл

@ -0,0 +1,649 @@
using Common;
using Discovery;
using Microsoft.Online.SharePoint.TenantAdministration;
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Linq;
using System.Management.Automation;
using System.Security;
using System.Text;
using System.Threading.Tasks;
using File = Microsoft.SharePoint.Client.File;
namespace Root
{
public class GetWorkflowForSPOnline
{
/// <summary>
/// Open the site collection file and store in a collection variable
/// Read the file and display it line by line.
/// </summary>
/// <param name="sitecollectionUrls"></param>
public void ReadInfoPathOnlineSiteCollection(List<string> sitecollectionUrls, string filePath)
{
try
{
int counter = 0;
string line;
System.IO.StreamReader file =
new System.IO.StreamReader(filePath);
while ((line = file.ReadLine()) != null)
{
//removes all extra spaces etc.
sitecollectionUrls.Add(line.TrimEnd());
//System.Console.WriteLine(line);
counter++;
}
file.Close();
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
private static readonly string FormBaseContentType = "0x010101";
public DataTable dt = new DataTable();
/// <summary>
/// Discover all sites present in the tenant and save them into a collection
/// </summary>
/// <param name="TenantName"></param>
/// <param name="Credential"></param>
/// <returns></returns>
public List<string> GetAllSPOTenantSites(string TenantName, PSCredential Credential)
{
List<string> sites = new List<string>();
try
{
string tenantAdminUrl = "https://" + TenantName + "-admin.sharepoint.com/";
ClientContext ctx = null;
ctx = CreateClientContext(tenantAdminUrl, Credential.UserName, Credential.Password);
var site = ctx.Site;
ctx.Load(site);
ctx.ExecuteQueryRetry();
var web = site.RootWeb;
var list = web.Lists.GetByTitle("DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS");
ctx.Load(list);
ctx.ExecuteQuery();
//Console.WriteLine("List name :{0}", list.Title);
var camlQuery = new CamlQuery();
var items = list.GetItems(camlQuery);
ctx.Load(items);
ctx.ExecuteQuery();
foreach (var item in items)
{
//Console.WriteLine("Site Url {0}", item["SiteUrl"]);
if (item["SiteUrl"] != null)
sites.Add(item["SiteUrl"].ToString());
}
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
//Console.WriteLine(ex.Message);
}
return sites;
}
public List<string> GetAllTenantSites(string TenantName, PSCredential Credential)
{
List<string> sites = new List<string>();
try
{
string tenantAdminUrl = "https://" + TenantName + "-admin.sharepoint.com/";
ClientContext ctx = null;
ctx = CreateClientContext(tenantAdminUrl, Credential.UserName, Credential.Password);
Tenant tenant = new Tenant(ctx);
SPOSitePropertiesEnumerable siteProps = tenant.GetSitePropertiesFromSharePoint("0", true);
ctx.Load(siteProps);
ctx.ExecuteQuery();
int count = 0;
foreach (var site in siteProps)
{
sites.Add(site.Url);
count++;
}
Console.WriteLine("Total Site {0}", count);
return sites;
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
return sites;
}
/// <summary>
/// SPO
/// </summary>
public string DownloadPath { get; set; }
public bool DownloadForms { get; set; }
public DirectoryInfo analysisFolder;
public DirectoryInfo downloadedFormsFolder;
public DirectoryInfo summaryFolder;
public void FindWorkflows(List<string> sitecollectionUrls, PSCredential Credential)
{
try
{
foreach (string url in sitecollectionUrls)
{
ClientContext siteClientContext = null;
siteClientContext = CreateClientContext(url, Credential.UserName, Credential.Password);
using (siteClientContext)
{
bool hasPermissions = false;
try
{
Console.WriteLine(string.Format("Processing: " + url));
siteClientContext.ExecuteQueryRetry();
hasPermissions = true;
}
catch (System.Net.WebException webException)
{
Console.WriteLine(string.Format(webException.Message.ToString() + " on " + url));
Logging.GetInstance().WriteToLogFile(Logging.Error, webException.Message.ToString() + " on " + url);
Logging.GetInstance().WriteToLogFile(Logging.Error, webException.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, webException.StackTrace);
}
catch (Microsoft.SharePoint.Client.ClientRequestException clientException)
{
Console.WriteLine(string.Format(clientException.Message.ToString() + " on " + url));
Logging.GetInstance().WriteToLogFile(Logging.Error, clientException.Message.ToString() + " on " + url);
Logging.GetInstance().WriteToLogFile(Logging.Error, clientException.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, clientException.StackTrace);
}
catch (Microsoft.SharePoint.Client.ServerUnauthorizedAccessException unauthorizedException)
{
Console.WriteLine(string.Format(unauthorizedException.Message.ToString() + " on " + url));
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.Message.ToString() + " on " + url);
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.StackTrace);
}
if (!hasPermissions)
continue;
Console.WriteLine(string.Format("Attempting to fetch all the sites and sub sites of " + url));
//WriteVerbose("Trying to get all the sites and subsites of : " + url);
IEnumerable<string> expandedSites = siteClientContext.Site.GetAllSubSites();
foreach (string site in expandedSites)
{
//Console.WriteLine(string.Format("Going into " + site));
//WriteVerbose("Going into " + site);
using (ClientContext ccWeb = siteClientContext.Clone(site))
{
try
{
FindWorkflowPerSite(ccWeb);
//FindInfoPathFormsPerSite(ccWeb);
}
catch (Microsoft.SharePoint.Client.ServerUnauthorizedAccessException unauthorizedException)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.StackTrace);
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.Message.ToString() + " on " + url);
Console.WriteLine(string.Format(unauthorizedException.Message.ToString() + " on " + url));
//WriteWarning(unauthorizedException.Message.ToString() + " on " + url);
}
}
}
}
}
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
public void FindWorkflowPerSite(ClientContext cc)
{
try
{
var site = cc.Site;
cc.Load(site);
cc.ExecuteQueryRetry();
var web = cc.Web;
cc.Load(web);
cc.ExecuteQueryRetry();
//Host.UI.WriteLine(ConsoleColor.DarkMagenta, Host.UI.RawUI.BackgroundColor, web.Title);
WorkflowManager.Instance.LoadWorkflowDefaultActions();
WorkflowDiscovery wfDisc = new WorkflowDiscovery();
wfDisc.DiscoverWorkflows(cc, dt);
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
/// <summary>
///
/// </summary>
/// <param name="url"></param>
/// <param name="username"></param>
/// <param name="password"></param>
/// <returns></returns>
internal ClientContext CreateClientContext(string url, string username, SecureString password)
{
try
{
var credentials = new SharePointOnlineCredentials(
username,
password);
return new ClientContext(url)
{
Credentials = credentials
};
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
return new ClientContext(url)
{
};
}
}
internal DataTable FindInfoPathFormsPerSite(ClientContext cc)
{
int counter = 0;
//DataTable dt = new DataTable();
try
{
var site = cc.Site;
cc.Load(site);
cc.ExecuteQueryRetry();
var web = cc.Web;
cc.Load(web);
cc.ExecuteQueryRetry();
var lists = cc.Web.GetListsToScan(showHidden: true);
Logging.GetInstance().WriteToLogFile(Logging.Info, string.Format("Started Scanning site {0}", site.Url));
foreach (var list in lists)
{
try
{
cc.Load(list);
cc.ExecuteQueryRetry();
if (list.BaseTemplate == (int)ListTemplateType.XMLForm ||
(!string.IsNullOrEmpty(list.DocumentTemplateUrl) && list.DocumentTemplateUrl.EndsWith(".xsn", StringComparison.InvariantCultureIgnoreCase))
)
{
try
{
DataRow row = dt.NewRow();
File file = GetFileId(cc, list.DocumentTemplateUrl);
if (file != null)
{
row["IpID"] = file.UniqueId;
}
// Form libraries depend on InfoPath
row["SiteColID"] = site.Id;
row["SiteURL"] = site.Url;
row["WebID"] = web.Id;
row["WebURL"] = web.Url;
row["ListorLibID"] = list.Id;
row["RelativePath"] = list.RootFolder.ServerRelativeUrl + "/Forms";
row["IpTemplateName"] = Path.GetFileName(list.DocumentTemplateUrl);
row["InfoPathUsage"] = "FormLibrary";
//row["FileName"] = list.Properties.FieldValues["_ipfs_solutionName"].ToString();
row["ItemCount"] = list.ItemCount;
dt.Rows.Add(row);
Logging.GetInstance().WriteToLogFile(Logging.Info, string.Format("Found InfoPath Forms Library {0}", list.DefaultViewUrl));
counter++;
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message.ToString() + " on " + web.Url);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
#region contentType Code
/*
else if (list.BaseTemplate == (int)ListTemplateType.DocumentLibrary || list.BaseTemplate == (int)ListTemplateType.WebPageLibrary)
{
try
{
// verify if a form content type was attached to this list
cc.Load(list, p => p.ContentTypes.Include(c => c.Id, c => c.DocumentTemplateUrl));
//cc.Load(list);
cc.ExecuteQueryRetry();
var formContentTypeFound = list.ContentTypes.Where(c => c.Id.StringValue.StartsWith(FormBaseContentType, StringComparison.InvariantCultureIgnoreCase)).OrderBy(c => c.Id.StringValue.Length).FirstOrDefault();
if (formContentTypeFound != null)
{
// Form libraries depend on InfoPath
DataRow row = dt.NewRow();
if (formContentTypeFound.DocumentTemplateUrl.EndsWith(".xsn"))
{
File file = GetFileId(cc, list, formContentTypeFound.DocumentTemplateUrl);
if (file != null)
{
row["IpID"] = file.UniqueId;
}
}
row["SiteColID"] = site.Id;
row["SiteURL"] = site.Url;
row["WebID"] = web.Id;
row["WebURL"] = web.Url;
row["ListorLibID"] = list.Id;
row["RelativePath"] = list.RootFolder.ServerRelativeUrl;
row["InfoPathUsage"] = "ContentType";
row["IpTemplateName"] = Path.GetFileName(formContentTypeFound.DocumentTemplateUrl);
//row["FileName"] = list.Properties.FieldValues["_ipfs_solutionName"].ToString();
row["ItemCount"] = list.ItemCount;
dt.Rows.Add(row);
Logging.GetInstance().WriteToLogFile(Logging.Info, string.Format("Found Content Type {0}", formContentTypeFound.DocumentTemplateUrl));
counter++;
}
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
*/
#endregion
else if (list.BaseTemplate == (int)ListTemplateType.GenericList)
{
try
{
Folder folder = cc.Web.GetFolderByServerRelativeUrl($"{list.RootFolder.ServerRelativeUrl}/Item");
cc.Load(folder, p => p.Properties);
cc.ExecuteQueryRetry();
if (folder.Properties.FieldValues.ContainsKey("_ipfs_infopathenabled") && folder.Properties.FieldValues.ContainsKey("_ipfs_solutionName"))
{
bool infoPathEnabled = true;
if (bool.TryParse(folder.Properties.FieldValues["_ipfs_infopathenabled"].ToString(), out bool infoPathEnabledParsed))
{
infoPathEnabled = infoPathEnabledParsed;
}
// Form libraries depend on InfoPath
if (infoPathEnabled)
{
DataRow row = dt.NewRow();
string templateUrl = list.RootFolder.ServerRelativeUrl + "/Item/" + folder.Properties["_ipfs_solutionName"];
File file = GetFileId(cc, templateUrl);
if (file != null)
{
row["IpID"] = file.UniqueId;
}
row["SiteColID"] = site.Id;
row["SiteURL"] = site.Url;
row["WebID"] = web.Id;
row["WebURL"] = web.Url;
row["ListorLibID"] = list.Id;
row["InfoPathUsage"] = "GenericList";
row["RelativePath"] = list.RootFolder.ServerRelativeUrl + "/Item";
row["IpTemplateName"] = folder.Properties["_ipfs_solutionName"];
row["ItemCount"] = list.ItemCount;
dt.Rows.Add(row);
Logging.GetInstance().WriteToLogFile(Logging.Info, string.Format("Found Generic List InfoPath form {0}", list.DefaultViewUrl));
counter++;
}
}
}
catch (ServerException ex)
{
if (((ServerException)ex).ServerErrorTypeName == "System.IO.FileNotFoundException")
{
// Ignore
}
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message.ToString() + " on " + web.Url);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message.ToString() + " on " + web.Url);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
Logging.GetInstance().WriteToLogFile(Logging.Info, string.Format("Found a total of {0} InfoPath forms in site {1}", counter, web.Url));
Logging.GetInstance().WriteToLogFile(Logging.Info, string.Format("Completed Scanning site {0}", site.Url));
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
//counter = 0;
return dt;
}
private static File GetFileId(ClientContext cc, string documentTemplateUrl)
{
//Guid fileId = new Guid();
File file = null;
try
{
var spfileLocation = String.Concat(documentTemplateUrl);
file = cc.Web.GetFileByServerRelativeUrl(spfileLocation);
// Then getting the file using the server-relative Url of the web object
cc.Load(file);
cc.ExecuteQuery();
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message.ToString() + " on " + documentTemplateUrl);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
return file;
}
public void CreateDataTableColumns(DataTable dt)
{
try
{
dt.Columns.Add("SiteColID");
dt.Columns.Add("SiteURL");
dt.Columns.Add("CreatedBy");
dt.Columns.Add("ModifiedBy");
dt.Columns.Add("ListTitle");
dt.Columns.Add("ListUrl");
dt.Columns.Add("ContentTypeId");
dt.Columns.Add("ContentTypeName");
dt.Columns.Add("ItemCount");
dt.Columns.Add("Scope");
dt.Columns.Add("Version");
dt.Columns.Add("WFTemplateName");
dt.Columns.Add("IsOOBWorkflow");
dt.Columns.Add("RelativePath");
dt.Columns.Add("WFID");
dt.Columns.Add("WebID");
dt.Columns.Add("WebURL");
//dt.Columns.Add("ListorLibID");
//dt.Columns.Add("RelativePath");
//dt.Columns.Add("IpTemplateName");
//dt.Columns.Add("InfoPathUsage");
//dt.Columns.Add("IpID");
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
public DataTable Execute(PSCredential Credential, List<string> sitecollectionUrls)
{
try
{
Logging.GetInstance().WriteToLogFile(Logging.Info, "Starting to analyze SharePoint Online environment");
Console.WriteLine(System.Environment.NewLine);
Console.WriteLine("Starting to analyze SharePoint Online environment");
CreateDataTableColumns(dt);
//FindInfoPathForms(sitecollectionUrls, Credential);
FindWorkflows(sitecollectionUrls, Credential);
Logging.GetInstance().WriteToLogFile(Logging.Info, "***********************************************************************");
Logging.GetInstance().WriteToLogFile(Logging.Info, "TOTAL WORKFLOWS DISCOVERED : " + dt.Rows.Count.ToString());
Logging.GetInstance().WriteToLogFile(Logging.Info, "***********************************************************************");
Console.WriteLine(System.Environment.NewLine);
Console.WriteLine("***********************************************************************");
Console.WriteLine("TOTAL WORKFLOWS DISCOVERED : " + dt.Rows.Count.ToString());
Console.WriteLine("***********************************************************************");
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
return dt;
}
public void DownloadInfoPathForms(DataTable infopathFormLocations, PSCredential Credential)
{
try
{
Console.WriteLine(System.Environment.NewLine);
Console.WriteLine("***********************************************************************");
Console.WriteLine("Beginning to download the InfoPath template forms locally.. ");
Console.WriteLine("***********************************************************************");
Console.WriteLine(System.Environment.NewLine);
Console.WriteLine("Downloading forms...please wait.. ");
Console.WriteLine(System.Environment.NewLine);
Logging.GetInstance().WriteToLogFile(Logging.Info, "***********************************************************************");
Logging.GetInstance().WriteToLogFile(Logging.Info, "Beginning to download the InfoPath template forms locally.. ");
Logging.GetInstance().WriteToLogFile(Logging.Info, "***********************************************************************");
int formsDownloadCounter = 0;
string spfileLocation = string.Empty;
Operations ops = new Operations();
foreach (DataRow infoPathFormLocation in infopathFormLocations.Rows)
{
try
{
spfileLocation = String.Concat(infoPathFormLocation["RelativePath"].ToString(), "/", infoPathFormLocation["IpTemplateName"].ToString());
ClientContext context = null;
context = CreateClientContext(infoPathFormLocation["WebURL"].ToString(), Credential.UserName, Credential.Password);
using (context)
{
List list = context.Web.GetListById(Guid.Parse(infoPathFormLocation["ListorLibID"].ToString()));
context.Load(list);
context.ExecuteQueryRetry();
var file = GetFileId(context, spfileLocation);
//var file = context.Web.GetFileByServerRelativeUrl(infoPathFormLocation["RelativePath"].ToString());
//context.Load(file);
//context.ExecuteQuery();
string folderName = infoPathFormLocation["SiteColID"].ToString();
//var dirInfo = System.IO.Directory.CreateDirectory(string.Concat(DownloadPath, @"\DownloadedForms", @"\", infoPathFormLocation["SiteColID"].ToString()));
var dirInfo = System.IO.Directory.CreateDirectory(string.Concat(DownloadPath, ops.downloadedFormsFolder, @"\", infoPathFormLocation["SiteColID"].ToString()));
string filename = file.Name;
string filePath = string.Concat(DownloadPath, @"\DownloadedForms", @"\", infoPathFormLocation["SiteColID"].ToString(), @"\", infoPathFormLocation["IpID"].ToString(), "_", filename);
//var dirInfo = System.IO.Directory.CreateDirectory(string.Concat(DownloadPath, @"\", infoPathFormLocation["SiteID"], @"\", infoPathFormLocation["WebID"].ToString()));
//string localfile = string.Concat(DownloadPath, @"\", infoPathFormLocation["SiteID"].ToString(), @"\", infoPathFormLocation["WebID"].ToString(), @"\", infoPathFormLocation["ListorLibID"].ToString(), "_", filename);
Logging.GetInstance().WriteToLogFile(Logging.Info, "Starting to download InfoPath located at " + list.DefaultViewUrl);
//Logging.GetInstance().WriteToLogFile(Logging.Info, "Downloading the form locallay to the location " + filePath);
try
{
//Downloading the file to the specified location
using (var fileInfo = Microsoft.SharePoint.Client.File.OpenBinaryDirect(context, spfileLocation))
{
using (FileStream writeStream = System.IO.File.Open(filePath, System.IO.FileMode.OpenOrCreate, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite))
{
fileInfo.Stream.CopyTo(writeStream);
formsDownloadCounter++;
}
}
Logging.GetInstance().WriteToLogFile(Logging.Info, "Finished to download InfoPath located at " + list.DefaultViewUrl);
//Logging.GetInstance().WriteToLogFile(Logging.Info, "Finished to download InfoPath located at " + web.Url + "/" + list.DefaultViewUrl);
//Logging.GetInstance().WriteToLogFile(Logging.Info, "Download complete for the form located in " + spfileLocation);
}
catch (Exception exception)
{
if (infoPathFormLocation["WebURL"] != null)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, exception.Message + " on " + infoPathFormLocation["WebURL"].ToString());
}
Logging.GetInstance().WriteToLogFile(Logging.Error, exception.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, exception.StackTrace);
}
}
}
catch (Exception ex)
{
if (infoPathFormLocation["WebURL"] != null)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message + " on " + infoPathFormLocation["WebURL"].ToString());
}
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
Console.WriteLine("Downloading forms complete !");
Console.WriteLine(System.Environment.NewLine);
Console.WriteLine("***********************************************************************");
Console.WriteLine("INFOPATH FORMS DOWNLOADED : " + formsDownloadCounter);
Console.WriteLine("***********************************************************************");
Console.WriteLine(System.Environment.NewLine);
Logging.GetInstance().WriteToLogFile(Logging.Info, "***********************************************************************");
Logging.GetInstance().WriteToLogFile(Logging.Info, "INFOPATH FORMS DOWNLOADED : " + formsDownloadCounter);
Logging.GetInstance().WriteToLogFile(Logging.Info, "***********************************************************************");
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
//Logging.GetInstance().WriteToLogFile(Logging.Info, "STARTING TO DOWNLOAD INFOPATH FORMS. TOTAL COUNT: " + infopathFormLocations.Rows.Count);
//Load the Summary CSV to InfoPathFormLocations Collection
//foreach (var location in infopathFormLocations)
}
}
}

Просмотреть файл

@ -0,0 +1,370 @@
using Common;
using Discovery;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Administration;
using Microsoft.SharePoint.Client;
using OfficeDevPnP.Core;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Data;
using System.IO;
using System.Management.Automation;
using System.Security;
namespace Root
{
public class GetWorkflowsforOnPrem
{
public string Url { get; set; }
public string Scope { get; set; }
//public string useExistingSummaryFile { get; set; }
public string userName { get; set; }
public string password { get; set; }
public bool OnPrem { get; set; }
public string DownloadPath { get; set; }
public bool DownloadForms { get; set; }
public string DomainName { get; set; }
public DirectoryInfo analysisFolder;
public DirectoryInfo downloadedFormsFolder;
public DirectoryInfo summaryFolder;
public DataTable dt = new DataTable();
//public DataTable Execute(PSCredential Credential)
public DataTable Execute()
{
List<string> siteCollectionsUrl = new List<string>();
try
{
Logging.GetInstance().WriteToLogFile(Logging.Info, "Starting to analyze on-premise environment");
CreateDataTableColumns(dt);
Console.WriteLine(System.Environment.NewLine);
Console.WriteLine("Starting to analyze on-premise environment");
//GetWorkflows();
if (Scope == "Farm")
{
siteCollectionsUrl = QueryFarm();
}
else if (Scope == "WebApplication")
{
siteCollectionsUrl = GetAllWebAppSites();
}
else if (Scope == "SiteCollection")
{
siteCollectionsUrl.Add(Url);
}
//FindWorkflows(siteCollectionsUrl, Credential);
FindWorkflows(siteCollectionsUrl);
Logging.GetInstance().WriteToLogFile(Logging.Info, "***********************************************************************");
Logging.GetInstance().WriteToLogFile(Logging.Info, "TOTAL WORKFLOWS DISCOVERED : " + dt.Rows.Count.ToString());
Logging.GetInstance().WriteToLogFile(Logging.Info, "***********************************************************************");
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
return dt;
}
public List<string> GetAllWebAppSites()
{
List<string> webAppSiteCollectionUrls = new List<string>();
try
{
SPWebApplication objWebApp = null;
objWebApp = SPWebApplication.Lookup(new Uri(Url));
if (objWebApp == null)
{
Console.ForegroundColor = ConsoleColor.DarkMagenta;
Console.WriteLine("Unable to obtain the object for the Web Application URL provided. Check to make sure the URL provided is correct.");
Console.ForegroundColor = ConsoleColor.White;
Logging.GetInstance().WriteToLogFile(Logging.Error, "Unable to obtain the object for the Web Application URL provided. SPWebApplication.Lookup(new Uri(Url)) returned NULL");
}
else
{
foreach (SPSite site in objWebApp.Sites)
{
webAppSiteCollectionUrls.Add(site.Url);
}
}
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
return webAppSiteCollectionUrls;
}
public List<string> QueryFarm()
{
List<string> farmSiteCollectionUrls = new List<string>();
try
{
Logging.GetInstance().WriteToLogFile(Logging.Info, "Starting to query the farm..");
SPServiceCollection services = SPFarm.Local.Services;
foreach (SPService curService in services)
{
try
{
if (curService is SPWebService)
{
var webService = (SPWebService)curService;
if (curService.TypeName.Equals("Microsoft SharePoint Foundation Web Application"))
{
webService = (SPWebService)curService;
SPWebApplicationCollection webApplications = webService.WebApplications;
foreach (SPWebApplication webApplication in webApplications)
{
// WriteVerbose("Processing WebApplication " + webApplication.DisplayName);
if (webApplication != null)
{
if (false)
{
}
else
{
foreach (SPSite site in webApplication.Sites)
{
try
{
farmSiteCollectionUrls.Add(site.Url);
//Console.Write("Gathering InfoPath form locations for Content DB " + contentDatabase.Name + ".....");
//QueryDatabases(contentDatabase.Name, contentDatabase.DatabaseConnectionString);
// Console.WriteLine("Done !");
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
Console.WriteLine("Errored ! See log for details");
}
}
}
}
}
}
}
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
return farmSiteCollectionUrls;
}
//public void FindWorkflows(List<string> sitecollectionUrls, PSCredential Credential)
public void FindWorkflows(List<string> sitecollectionUrls)
{
try
{
foreach (string url in sitecollectionUrls)
{
ClientContext siteClientContext = null;
//siteClientContext = CreateClientContext(url,Credential,DomainName);
siteClientContext = CreateClientContext(url, userName,password, DomainName);
using (siteClientContext)
{
bool hasPermissions = false;
try
{
Console.WriteLine(string.Format("Processing: " + url));
siteClientContext.ExecuteQueryRetry();
hasPermissions = true;
}
catch (System.Net.WebException webException)
{
Console.WriteLine(string.Format(webException.Message.ToString() + " on " + url));
Logging.GetInstance().WriteToLogFile(Logging.Error, webException.Message.ToString() + " on " + url);
Logging.GetInstance().WriteToLogFile(Logging.Error, webException.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, webException.StackTrace);
}
catch (Microsoft.SharePoint.Client.ClientRequestException clientException)
{
Console.WriteLine(string.Format(clientException.Message.ToString() + " on " + url));
Logging.GetInstance().WriteToLogFile(Logging.Error, clientException.Message.ToString() + " on " + url);
Logging.GetInstance().WriteToLogFile(Logging.Error, clientException.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, clientException.StackTrace);
}
catch (Microsoft.SharePoint.Client.ServerUnauthorizedAccessException unauthorizedException)
{
Console.WriteLine(string.Format(unauthorizedException.Message.ToString() + " on " + url));
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.Message.ToString() + " on " + url);
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.StackTrace);
}
if (!hasPermissions)
continue;
Console.WriteLine(string.Format("Attempting to fetch all the sites and sub sites of " + url));
//WriteVerbose("Trying to get all the sites and subsites of : " + url);
IEnumerable<string> expandedSites = siteClientContext.Site.GetAllSubSites();
foreach (string site in expandedSites)
{
//Console.WriteLine(string.Format("Going into " + site));
//WriteVerbose("Going into " + site);
using (ClientContext ccWeb = siteClientContext.Clone(site))
{
try
{
FindWorkflowPerSite(ccWeb);
//FindInfoPathFormsPerSite(ccWeb);
}
catch (Microsoft.SharePoint.Client.ServerUnauthorizedAccessException unauthorizedException)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.StackTrace);
Logging.GetInstance().WriteToLogFile(Logging.Error, unauthorizedException.Message.ToString() + " on " + url);
Console.WriteLine(string.Format(unauthorizedException.Message.ToString() + " on " + url));
//WriteWarning(unauthorizedException.Message.ToString() + " on " + url);
}
}
}
}
}
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
public void FindWorkflowPerSite(ClientContext cc)
{
try
{
var site = cc.Site;
cc.Load(site);
cc.ExecuteQueryRetry();
var web = cc.Web;
cc.Load(web);
cc.ExecuteQueryRetry();
//Host.UI.WriteLine(ConsoleColor.DarkMagenta, Host.UI.RawUI.BackgroundColor, web.Title);
WorkflowManager.Instance.LoadWorkflowDefaultActions();
WorkflowDiscovery wfDisc = new WorkflowDiscovery();
wfDisc.DiscoverWorkflows(cc, dt);
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
//internal ClientContext CreateClientContext(string url, string username, SecureString password, string domainName)
internal ClientContext CreateClientContext(string url, PSCredential Credential, string domainName)
{
ClientContext cc = null;
try
{
AuthenticationManager authManager = new AuthenticationManager();
cc = authManager.GetNetworkCredentialAuthenticatedContext(url, Credential.UserName, Credential.Password, domainName);
Web web = cc.Web;
cc.Load(web, website => website.Title);
cc.ExecuteQuery();
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
return new ClientContext(url)
{
};
}
return cc;
}
internal ClientContext CreateClientContext(string url, string userName, string password, string domainName)
{
ClientContext cc = null;
try
{
AuthenticationManager authManager = new AuthenticationManager();
cc = authManager.GetNetworkCredentialAuthenticatedContext(url, userName, password, domainName);
Web web = cc.Web;
cc.Load(web, website => website.Title);
cc.ExecuteQuery();
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
return new ClientContext(url)
{
};
}
return cc;
}
public void CreateDataTableColumns(DataTable dt)
{
try
{
dt.Columns.Add("SiteColID");
dt.Columns.Add("SiteURL");
dt.Columns.Add("CreatedBy");
dt.Columns.Add("ModifiedBy");
dt.Columns.Add("ListTitle");
dt.Columns.Add("ListUrl");
dt.Columns.Add("ContentTypeId");
dt.Columns.Add("ContentTypeName");
dt.Columns.Add("ItemCount");
dt.Columns.Add("Scope");
dt.Columns.Add("Version");
dt.Columns.Add("WFTemplateName");
dt.Columns.Add("IsOOBWorkflow");
dt.Columns.Add("RelativePath");
dt.Columns.Add("WFID");
dt.Columns.Add("WebID");
dt.Columns.Add("WebURL");
//dt.Columns.Add("ListorLibID");
//dt.Columns.Add("RelativePath");
//dt.Columns.Add("IpTemplateName");
//dt.Columns.Add("InfoPathUsage");
//dt.Columns.Add("IpID");
}
catch (Exception ex)
{
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.Message);
Logging.GetInstance().WriteToLogFile(Logging.Error, ex.StackTrace);
}
}
internal static void PopulateAdminAndOwnerColumns(ConcurrentDictionary<string, SiteScanResult> siteScanResults, ConcurrentDictionary<string, WorkflowScanResult> workflowScanResults)
{
foreach (var workflowScanResult in workflowScanResults)
{
if (siteScanResults.ContainsKey(workflowScanResult.Value.SiteColUrl))
{
var siteScanResult = siteScanResults[workflowScanResult.Value.SiteColUrl];
workflowScanResult.Value.Admins = siteScanResult.Admins;
workflowScanResult.Value.Owners = siteScanResult.Owners;
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("Root")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Root")]
[assembly: AssemblyCopyright("Copyright © 2020")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("c36a3ff3-1a6b-4acd-94fc-0bc798082603")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

241
Root/Root.csproj Normal file
Просмотреть файл

@ -0,0 +1,241 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{C36A3FF3-1A6B-4ACD-94FC-0BC798082603}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Root</RootNamespace>
<AssemblyName>Microsoft.Services.WorkflowAssessment.Root</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="AngleSharp, Version=0.9.9.0, Culture=neutral, PublicKeyToken=e83494dcdc6d31ea, processorArchitecture=MSIL">
<HintPath>..\packages\AngleSharp.0.9.9\lib\net45\AngleSharp.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.ActiveDirectory.GraphClient, Version=2.1.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.ActiveDirectory.GraphClient.2.1.0\lib\portable-net4+sl5+win+wpa+wp8\Microsoft.Azure.ActiveDirectory.GraphClient.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.KeyVault.Core, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.1.1.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Edm, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Edm.5.8.4\lib\net40\Microsoft.Data.Edm.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.OData, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Data.Services.Client, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Data.Services.Client.5.8.4\lib\net40\Microsoft.Data.Services.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Graph, Version=1.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Graph.1.9.0\lib\net45\Microsoft.Graph.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Graph.Core, Version=1.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Graph.Core.1.9.0\lib\net45\Microsoft.Graph.Core.dll</HintPath>
</Reference>
<Reference Include="microsoft.identitymodel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.7.0.0\lib\net35\microsoft.identitymodel.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=3.19.8.16603, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory.Platform, Version=3.19.8.16603, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.19.8\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.JsonWebTokens, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.JsonWebTokens.5.2.4\lib\net451\Microsoft.IdentityModel.JsonWebTokens.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Logging, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Logging.5.2.4\lib\net451\Microsoft.IdentityModel.Logging.dll</HintPath>
</Reference>
<Reference Include="Microsoft.IdentityModel.Tokens, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.IdentityModel.Tokens.5.2.4\lib\net451\Microsoft.IdentityModel.Tokens.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Client.Policy, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Office.Client.Policy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.Client.TranslationServices, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Office.Client.TranslationServices.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Office.SharePoint.Tools, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Office.SharePoint.Tools.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Online.SharePoint.Client.Tenant, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.Online.SharePoint.Client.Tenant.dll</HintPath>
</Reference>
<Reference Include="Microsoft.ProjectServer.Client, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.ProjectServer.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePoint.dll.15.0.4867.1000\lib\Microsoft.SharePoint\Microsoft.SharePoint.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.SharePoint.Client, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.DocumentManagement, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.DocumentManagement.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Publishing, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Publishing.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Runtime, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Runtime.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Runtime.Windows, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Runtime.Windows.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Search, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Search.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Search.Applications, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Search.Applications.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.Taxonomy, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.Taxonomy.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.UserProfiles, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.UserProfiles.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint.Client.WorkflowServices, Version=16.1.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.SharePointOnline.CSOM.16.1.20317.12000\lib\net45\Microsoft.SharePoint.Client.WorkflowServices.dll</HintPath>
</Reference>
<Reference Include="Microsoft.WindowsAzure.Storage, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\WindowsAzure.Storage.7.0.0\lib\net40\Microsoft.WindowsAzure.Storage.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="OfficeDevPnP.Core, Version=3.24.2008.1, Culture=neutral, PublicKeyToken=5e633289e95c321a, processorArchitecture=MSIL">
<HintPath>..\packages\SharePointPnPCoreOnline.3.24.2008.1\lib\net461\OfficeDevPnP.Core.dll</HintPath>
</Reference>
<Reference Include="SharePointPnP.IdentityModel.Extensions, Version=1.2.4.0, Culture=neutral, PublicKeyToken=5e633289e95c321a, processorArchitecture=MSIL">
<HintPath>..\packages\SharePointPnP.IdentityModel.Extensions.1.2.4\lib\net45\SharePointPnP.IdentityModel.Extensions.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.IdentityModel" />
<Reference Include="System.IdentityModel.Selectors" />
<Reference Include="System.IdentityModel.Tokens.Jwt, Version=5.2.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.IdentityModel.Tokens.Jwt.5.2.4\lib\net451\System.IdentityModel.Tokens.Jwt.dll</HintPath>
</Reference>
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0\lib\net4\System.Management.Automation.dll</HintPath>
</Reference>
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Memory.4.5.4\lib\net461\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Net.Http.4.3.1\lib\net46\System.Net.Http.dll</HintPath>
</Reference>
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.6.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Security.Cryptography.Algorithms, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net461\System.Security.Cryptography.Algorithms.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Encoding, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.Primitives, Version=4.0.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll</HintPath>
</Reference>
<Reference Include="System.Security.Cryptography.X509Certificates, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll</HintPath>
</Reference>
<Reference Include="System.ServiceModel" />
<Reference Include="System.Spatial, Version=5.8.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Spatial.5.8.4\lib\net40\System.Spatial.dll</HintPath>
</Reference>
<Reference Include="System.Text.Encodings.Web, Version=4.0.5.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Encodings.Web.4.7.1\lib\net461\System.Text.Encodings.Web.dll</HintPath>
</Reference>
<Reference Include="System.Text.Json, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Text.Json.4.7.2\lib\net461\System.Text.Json.dll</HintPath>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.5.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Web.Http, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="CmdCompareDownloadWorkflows.cs" />
<Compile Include="CmdGetWorkflowAssociationsForOnprem.cs" />
<Compile Include="CmdGetWorkflowAssociationsForSPO.cs" />
<Compile Include="GetWorkflowForSPOnline.cs" />
<Compile Include="GetWorkflowsforOnPrem.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{04a36617-4353-4779-92f9-36baffe6a5f6}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\Discovery\Discovery.csproj">
<Project>{66180571-9292-4411-8b01-b31dce2cc0e8}</Project>
<Name>Discovery</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Content Include="ReferenceDLLs\Microsoft.SharePoint.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

59
Root/app.config Normal file
Просмотреть файл

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Edm" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-11.0.0.0" newVersion="11.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.Services.Client" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.Data.OData" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.8.4.0" newVersion="5.8.4.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.WindowsAzure.Storage" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.SharePoint.Client" publicKeyToken="71e9bce111e9429c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-16.1.0.0" newVersion="16.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Management.Automation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Microsoft.SharePoint.Client.Runtime" publicKeyToken="71e9bce111e9429c" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-16.1.0.0" newVersion="16.1.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.6.0" newVersion="4.0.6.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Threading.Tasks.Extensions" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.2.0.1" newVersion="4.2.0.1" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Buffers" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

41
Root/packages.config Normal file
Просмотреть файл

@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="AngleSharp" version="0.9.9" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.3" targetFramework="net461" />
<package id="Microsoft.Azure.ActiveDirectory.GraphClient" version="2.1.0" targetFramework="net461" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net461" />
<package id="Microsoft.Bcl.AsyncInterfaces" version="1.1.0" targetFramework="net461" />
<package id="Microsoft.Data.Edm" version="5.8.4" targetFramework="net461" />
<package id="Microsoft.Data.OData" version="5.8.4" targetFramework="net461" />
<package id="Microsoft.Data.Services.Client" version="5.8.4" targetFramework="net461" />
<package id="Microsoft.Graph" version="1.9.0" targetFramework="net461" />
<package id="Microsoft.Graph.Core" version="1.9.0" targetFramework="net461" />
<package id="Microsoft.IdentityModel" version="7.0.0" targetFramework="net461" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="3.19.8" targetFramework="net461" />
<package id="Microsoft.IdentityModel.JsonWebTokens" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.IdentityModel.Logging" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.IdentityModel.Tokens" version="5.2.4" targetFramework="net461" />
<package id="Microsoft.PowerShell.5.ReferenceAssemblies" version="1.1.0" targetFramework="net461" />
<package id="Microsoft.SharePoint.dll" version="15.0.4867.1000" targetFramework="net461" />
<package id="Microsoft.SharePointOnline.CSOM" version="16.1.20317.12000" targetFramework="net461" />
<package id="Newtonsoft.Json" version="11.0.1" targetFramework="net461" />
<package id="SharePointPnP.IdentityModel.Extensions" version="1.2.4" targetFramework="net461" />
<package id="SharePointPnPCoreOnline" version="3.24.2008.1" targetFramework="net461" />
<package id="System.Buffers" version="4.5.1" targetFramework="net461" />
<package id="System.IdentityModel.Tokens.Jwt" version="5.2.4" targetFramework="net461" />
<package id="System.Memory" version="4.5.4" targetFramework="net461" />
<package id="System.Net.Http" version="4.3.1" targetFramework="net461" />
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net461" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.7.1" targetFramework="net461" />
<package id="System.Security.Cryptography.Algorithms" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.Primitives" version="4.3.0" targetFramework="net461" />
<package id="System.Security.Cryptography.X509Certificates" version="4.3.0" targetFramework="net461" />
<package id="System.Spatial" version="5.8.4" targetFramework="net461" />
<package id="System.Text.Encodings.Web" version="4.7.1" targetFramework="net461" />
<package id="System.Text.Json" version="4.7.2" targetFramework="net461" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net461" />
<package id="System.ValueTuple" version="4.5.0" targetFramework="net461" />
<package id="WindowsAzure.Storage" version="7.0.0" targetFramework="net461" />
</packages>