ĐÀO TẠO DOANH NGHIỆP : SỞ KHOA HỌC CÔNG NGHỆ TỈNH ĐỒNG NAI

ENTERPRISE TRAINING: DONG NAI DEPARTMENT OF SCIENCE AND TECHNOLOGY.

HÌNH ẢNH TẬP HUẤN LỚP SHAREPOINT WORKFLOW VÀ KIẾN TRÚC SHAREPOINT

PHOTOS OF SHAREPOINT WORKFLOW AND ARCHITECTURE CLASS.

HÌNH ẢNH TẬP HUẤN LỚP SHAREPOINT WORKFLOW VÀ KIẾN TRÚC SHAREPOINT

PHOTOS OF SHAREPOINT WORKFLOW AND ARCHITECTURE CLASS.

Monday, November 13, 2017

Configure SharePoint 2013 Workflow Manager

Update window first if you did not update before.
Go to this link” https://go.microsoft.com/?linkid=9737537” to download Web Platform Installer 5.0.

Install Web Platform Installer 5.0
Open Web Platform Installer 5.0
Type Workflow Manager on top right hand.
Click Add on the Workflow manager 1.0 Refresh (CU2) and Click Install.

Click I Accept

Check the I don’t Want to user Microsoft Update and click Continue

Waiting and Finish

Cancel the Wizard and type Workflow Manager on top right hand. Click Add Workflow Manager 1.0 Cumulative Update 3 and then Click Install

Waiting and finish. We will check all of them installed in grogram of windows



Go to Start and on top Right click on Search Icon and Type the Workflow Manager Configuration in the Search Box and click it.

On Workflow Manager Configuration page, Please provide the below information
        1.       SQL Server Instance
        2.       Database Name


Other Database name provided automatically
Input user name and password of farm admin

Check to Auto-generate
Input certificate generation key
Port number => keep default

Check to Allow Workflow management over HTTP on this Computer


On the Service Bus Configuration Page, Please Provide the following information
        1.       SQL SERVER INSTANCE
        2.       Database name keep default

Continue
Check to "Use the Same Service Account credentials as provided for Workflow Manager”
Check to Auto-generate
Check to Use the same certificate generation key as provided for workflow manager

Keep default page

And finish configuration


Here is configuration information

Configuration for Workflow Manager
Management Database SQL Instance      SQL2014
Enable SSL connection with SQL Server instance False
Authentication  Windows Authentication
Management Database Name    WFManagementDB
Instance Management Database SQL Instance    SQL2014
Enable SSL connection with SQL Server instance False
Authentication  Windows Authentication
Instance Management Database Name  WFInstanceManagementDB
Resource Management Database SQL Instance   SQL2014
Enable SSL connection with SQL Server instance False
Authentication  Windows Authentication
Resource Management Database Name WFResourceManagementDB
RunAs Account  SWISSITBRIDGE\spfarm
RunAs Password               ***********
Certificate Generation Key           ***********
Workflow Manager Outbound Signing Certificate              Auto-generated
Service SSL Certificate    Auto-generated
Encryption Certificate    Auto-generated
Workflow Manager Management Port   12290
HTTP Port            12291
Enable firewall rules on this computer    True
Administrators Group    BUILTIN\Administrators
Configuration for Service Bus
Management Database SQL Instance      SQL2014
Enable SSL connection with SQL Server instance False
Authentication  Windows Authentication
Management Database Name    SbManagementDB
Gateway Database SQL Instance SQL2014
Enable SSL connection with SQL Server instance False
Authentication  Windows Authentication
Gateway Database Name             SbGatewayDatabase
Message Container SQL Instance               SQL2014
Enable SSL connection with SQL Server instance False
Authentication  Windows Authentication
Message Container Database Name        SBMessageContainer01
RunAs Account  SWISSITBRIDGE\spfarm
RunAs Password               ***********
Certificate Generation Key           ***********
Farm Certificate Auto-generated
Encryption Certificate    Auto-generated
HTTPS Port          9355
TCP Port               9354
Message Broker Port      9356
Internal Communication Port Range        9000 - 9004
Enable firewall rules on this computer    True
Administrators Group    BUILTIN\Administrators

//////////////// ===> And Powershell  script to configure workflow manager ===/////////////

# To be run in Workflow Manager PowerShell console that has both Workflow Manager and Service Bus installed.

# Create new SB Farm
$SBCertificateAutoGenerationKey = ConvertTo-SecureString -AsPlainText  -Force  -String '***** Replace with Service Bus Certificate Auto-generation key ******' -Verbose;


New-SBFarm -SBFarmDBConnectionString 'Data Source=SQL2014;Initial Catalog=SbManagementDB;Integrated Security=True;Encrypt=False' -InternalPortRangeStart 9000 -TcpPort 9354 -MessageBrokerPort 9356 -RunAsAccount 'SWISSITBRIDGE\spfarm' -AdminGroup 'BUILTIN\Administrators' -GatewayDBConnectionString 'Data Source=SQL2014;Initial Catalog=SbGatewayDatabase;Integrated Security=True;Encrypt=False' -CertificateAutoGenerationKey $SBCertificateAutoGenerationKey -MessageContainerDBConnectionString 'Data Source=SQL2014;Initial Catalog=SBMessageContainer01;Integrated Security=True;Encrypt=False' -Verbose;

# To be run in Workflow Manager PowerShell console that has both Workflow Manager and Service Bus installed.

# Create new WF Farm
$WFCertAutoGenerationKey = ConvertTo-SecureString -AsPlainText  -Force  -String '***** Replace with Workflow Manager Certificate Auto-generation key ******' -Verbose;


New-WFFarm -WFFarmDBConnectionString 'Data Source=SQL2014;Initial Catalog=WFManagementDB;Integrated Security=True;Encrypt=False' -RunAsAccount 'SWISSITBRIDGE\spfarm' -AdminGroup 'BUILTIN\Administrators' -HttpsPort 12290 -HttpPort 12291 -InstanceDBConnectionString 'Data Source=SQL2014;Initial Catalog=WFInstanceManagementDB;Integrated Security=True;Encrypt=False' -ResourceDBConnectionString 'Data Source=SQL2014;Initial Catalog=WFResourceManagementDB;Integrated Security=True;Encrypt=False' -CertificateAutoGenerationKey $WFCertAutoGenerationKey -Verbose;

# Add SB Host
$SBRunAsPassword = ConvertTo-SecureString -AsPlainText  -Force  -String '***** Replace with RunAs Password for Service Bus ******' -Verbose;


Add-SBHost -SBFarmDBConnectionString 'Data Source=SQL2014;Initial Catalog=SbManagementDB;Integrated Security=True;Encrypt=False' -RunAsPassword $SBRunAsPassword -EnableFirewallRules $true -CertificateAutoGenerationKey $SBCertificateAutoGenerationKey -Verbose;

Try
{
    # Create new SB Namespace
    New-SBNamespace -Name 'WorkflowDefaultNamespace' -AddressingScheme 'Path' -ManageUsers 'SWISSITBRIDGE\spfarm','spfarm@SWISSITBRIDGE' -Verbose;

    Start-Sleep -s 90
}
Catch [system.InvalidOperationException]
{
}

# Get SB Client Configuration
$SBClientConfiguration = Get-SBClientConfiguration -Namespaces 'WorkflowDefaultNamespace' -Verbose;

# Add WF Host
$WFRunAsPassword = ConvertTo-SecureString -AsPlainText  -Force  -String '***** Replace with RunAs Password for Workflow Manager ******' -Verbose;


Add-WFHost -WFFarmDBConnectionString 'Data Source=SQL2014;Initial Catalog=WFManagementDB;Integrated Security=True;Encrypt=False' -RunAsPassword $WFRunAsPassword -EnableFirewallRules $true -SBClientConfiguration $SBClientConfiguration -EnableHttpPort  -CertificateAutoGenerationKey $WFCertAutoGenerationKey -Verbose;


Waiting configuration progress

And finish progress



Login to server with farm account.
Open Internet Information Services(IIS)
In the Internet Manager expands the Sites ( on left-hand side), Click on Workflow Manager Site and On right-Hand side under Actions click on Bindings
On this Page, Select Https and Click on Edit
On this Page Under the SSL Certificate, click on View certificates
On this page click on Details tab
On this page Click Copy to File
On Welcome to the certificate Export Wizard Click Next
On Export Private Key page Please Select, No, Do not export the private key and click Next
On export File Format page, Select Der encoded binary X.509(.cer) and click Next
On File to export page, Please select the path where certificate will be save and Click Next
On Completing the Certificate export wizard, Click Finish
You will get message "the export was sucessful". and click Ok
Import Certificate into SharePoint.
Now Login on the SharePoint Server with Farm Admin account
Open the Central Admin Site
Click on Security and Click on Trust on right-hand side
on Trust Page Click on New
Input Name of the Certificate and browse Path of Certificate( where you save the certificate)
You will see your certificate added.
Register Workflow Service Proxy
Register-SPWorkflowService -SPSite "http://sp2016" -WorkflowHostUri "http://sp2016:12291/" –AllowOAuthHttp

Verify from Central Admin:
Go to central admin >> Application Management > Under Service Application >> Manager Service Application >> click on Workflow Service Application proxy >> on ribbon click to manage. You will see the message” Workflow is Connected”
Verify Using the PowerShell:
Open the SharePoint PowerShell console on the SharePoint Server. Run the Below Command.
Get-SPWorkflowServiceApplicationProxy | Select *

The result is: Open SPD 2013 at left panel click to workflow and create list workflow you can see popup to choose SharePoint 2013 workflow




Friday, October 6, 2017

sharepoint 2010 Quick Parts Word

How to pull SharePoint 2010 document properties into Word (Quick Parts)

We use Shared Document library for this example, Create 2 columns is DisplayName and Province link below image

 Creating new word document with any content then save to template

 Go back to Shared Document library setting >> Advanced settings

 Click to Yes
 Click on "Document" content type
 Click to Advanced settings

 Upload your template here


 Edit your template
Insert you content here then click to add Quick Parts

Choose Document property >> Display name

Doing the same with Province property

Save then close word

Click to OK

Go back Shared Documents >> New Document

Input some content then save
 Save to your location

Upload your document which it was created before

Here is document was uploaded with properties

Open document and you can see the document properties is mapped to ...


 Note: 
When you create the new properties and you want to map it to Quick Parts, do the same step "Edit your template" and map the new document properties to new Quick Parts then Save it. But remember that: you must create the new document to apply the new Quick Parts. If you edit the old document with new properties, you will not see the change.

Get start with SPO management shell using CSOM

      1.       Download SharePoint Server 2016 Client Components SDK at this link: https://www.microsoft.com/en-us/download/details.aspx?id=51679


      2.       Install it, it should be appeared at below:

      3.       Open your SharePoint site and create list “Leave Request”

      4.       Open SharePoint Online Management Shell

      5.       Enter the command then input your password:
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll" 
Add-Type -Path "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll" 
 
$siteURL = "https://bbv2016.sharepoint.com" 
$userId = "hungdo@bbv2016.onmicrosoft.com" 
$pwd = Read-Host -Prompt "Enter password" -AsSecureString 
 

      6.       Continue enter the command to display ID and title of list
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($userId, $pwd) 
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteURL) 
$ctx.credentials = $credentials 
try{ 
    $lists = $ctx.web.Lists 
    $list = $lists.GetByTitle("Leave Request") 
    $listItems = $list.GetItems([Microsoft.SharePoint.Client.CamlQuery]::CreateAllItemsQuery()) 
    $ctx.load($listItems)       
    $ctx.executeQuery() 
    foreach($listItem in $listItems) 
    { 
        Write-Host "ID - " $listItem["ID"] "Title - " $listItem["Title"] 
    } 
catch{ 
    write-host "$($_.Exception.Message)" -foregroundcolor red 
 


      7.       Finished

Connect SharePoint Online using SharePoint Designer 2013

1    1.  Login to office 365 >> admin center https://portal.office.com/adminportal#/homepage then navigate to Office 365 > Admin  >  Admin Center  > SharePoint  > Settings . At custom script allow all option

1    2.       Download SharePoint Online Management Shell at this link: https://www.microsoft.com/en-us/download/details.aspx?id=35588&751be11f-ede8-5a0c-058c-2ee190a24fa6=True


1    3.       Install SharePoint Online Management then open it as administrator then input the command
Connect-SPOService -Url https://<youradmindomain>.sharepoint.com -credential admin@<yourdomain>.onmicrosoft.com
-Url  : Pass Sharepoint Online site url.
-Credential : Admin user Name/ Password (It will prompt screen for enter password).
Example:
            Connect-SPOService -Url https://bbv2016-admin.sharepoint.com -credential hungdo@bbv2016.onmicrosoft.com

1    4.       If have no any error, continue enter the command:

       Set-SPOSite -Identity https://<yoursitecollection>.sharepoint.com -DenyAddAndCustomizePages   $false
       Example: Set-SPOSite -Identity https://bbv2016.sharepoint.com -DenyAddAndCustomizePages $false

1    5.       Access to your site collection >> Site settings >> under Site Collection Administration then click to SharePoint Designer Settings

1    6.       Check to all checkbox if one of them not selected

1    7.       Download SharePoint designer 2013 then install then open it >> Open SharePoint Site >> enter your SharePoint site (https://bbv2016.sharepoint.com), type your email


1    8.       And type your password

1    9.       You will see error appear if you did not add your site to trust site of internet explorer setting

1    10.   Open Internet explorer >> setting >> internet options >> security tab >> click on Trust sites and add your site


1    11.   Reopen SharePoint designer 2013 then connect again, it should be successful

Finished


Register SharePoint 2016 Online (O365 Enterprise E3)

1)      Register SharePoint online (O365 enterprise E3) at below link:



2)      Next, enter your user ID and password


3)      Enter your phone number then click Text me


4)      Your phone will receive code, then enter code then Next

5)      Waiting to finish your registration

6)      Sign-in page: https://portal.office.com/ with your user ID and password. After sign in successful, you will see this page is setting up
 

7)      After finished to set up all, then click to Admin icon
 

8)      Admin center page here, then click to SharePoint under “Admin centers”
 

9)      This is SharePoint central admin, and list all site collections appear
 

10)   Access to first site collection (https://bbv2016.sharepoint.com), it will be displayed like below.
  

11)   Finished.

Sunday, October 30, 2016

PowerShell script for adding multiple WSP solutions

$names = get-childitem C:\WSP
foreach ($solution in $names) {Add-SPSolution -LiteralPath ("C:\WSP\" + $solution.Name) }

Wednesday, October 5, 2016

Create, Update, Delete a List Item Using COM

Using C# console


Add reference to dll: Microsoft.SharePoint, Microsoft.SharePoint.Client, Microsoft.SharePoint.Client.Runtime

For Create action:


using Microsoft.SharePoint;
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BasicOperationUsingCSOM
{
    class Program
    {
        static void Main(string[] args)
        {
            string siteUrl = "http://web";
            ClientContext clientContext = new ClientContext(siteUrl);
            List oList = clientContext.Web.Lists.GetByTitle("MyCustomList");
            ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
            ListItem oListItem = oList.AddItem(itemCreateInfo);
            oListItem["Title"] = "My New Item!";
            oListItem["Description"] = "Hello World!";
            oListItem.Update();
            clientContext.ExecuteQuery();
        }
    }
}

For Update:

using Microsoft.SharePoint;
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BasicOperationUsingCSOM
{
    class Program
    {
        static void Main(string[] args)
        {
            string siteUrl = "http://web";
            ClientContext clientContext = new ClientContext(siteUrl);
            List oList = clientContext.Web.Lists.GetByTitle("MyCustomList");
            ListItem oListItem = oList.GetItemById(1);
            oListItem["Title"] = "Hello World Updated!!!";
            oListItem["Description"] = "Hello World Updated!!!";
            oListItem.Update();
            clientContext.ExecuteQuery();
        }
    }
}


For Delete:

using Microsoft.SharePoint;
using Microsoft.SharePoint.Client;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BasicOperationUsingCSOM
{
    class Program
    {
        static void Main(string[] args)
        {
            string siteUrl = "http://web";
            ClientContext clientContext = new ClientContext(siteUrl);
            List oList = clientContext.Web.Lists.GetByTitle("MyCustomList");
            ListItem oListItem = oList.GetItemById(1);
            oListItem.DeleteObject();
            clientContext.ExecuteQuery();
        }
    }
}