workflow could not update the item, possibly because one or more columns for the item require a different type of information

workflow could not update the item

workflow could not update the item

User created a simple out of box sharepoint approval workflow. User add a document in library. After that when try to start workflow manually, there is error with message as the workflow could not update the item, possibly because one or more columns for the item require a different type of information. Workflow was working fine till few days back but not currently.

The workflow could not update the item, possibly because one or more columns for the item require a different type of information

Solution

I found that someone has changed the workflow settings. They enabled the checkbox under workflow settings “Enable Content Approval” which was not before.

Uncheck the boxEnable Content Approval” option present in workflow settings. Then workflow started working fine for me.

workflow could not update the item, possibly because one or more columns for the item require a different type of information
Advertisements
SharePoint 2019 Glossary Terms

SharePoint 2019 Glossary Terms Part 1

In this article i am going to share SharePoint 2019 Glossary Terms related to Administration Web Service Protocol. This would be very helpful to refer and informative.

  • Absolute URL – The full Internet address of a page or other World Wide Web resource. The absolute URL includes a protocol, such as “http,” a network location, and an optional path and file name — for example, http://www.SharePointTechnicalSupport.com/.
  • Configuration Database – A database that is stored on a back-end database server and contains both persisted objects and site collection metadata for lookup purposes.
  • Endpoint – A communication port that is exposed by an application server for a specific shared service and to which messages can be addressed.
  • Globally Unique Identifier (GUID) – A term used interchangeably with universally unique identifier (UUID) in Microsoft protocol technical documents (TDs).
  • Hypertext Transfer Protocol (HTTP) – An application-level protocol for distributed, collaborative, hypermedia information systems (text, graphic images, sound, video, and other multimedia files) on the World Wide Web.
  • Hypertext Transfer Protocol Secure (HTTPS) – An extension of HTTP that securely encrypts and decrypts web page requests. In some older protocols, “Hypertext Transfer Protocol over Secure Sockets Layer” is still used (Secure Sockets Layer has been deprecated).
  • Language code identifier (LCID) – A 32-bit number that identifies the user interface human language dialect or variation that is supported by an application or a client computer.
  • Portal Site – A type of SharePoint site that can act as an umbrella to other sites and can be used by a large organization.
  • Request Message – A Traversal Using Relay NAT (TURN) message that is sent from a protocol client to a protocol server
  • Response Message – A Traversal Using Relay NAT (TURN) message that is sent from a protocol server to a protocol client in response to a request message. It is sent when the request message is handled successfully by the protocol server.
  • Site – A group of related pages and data within a SharePoint site collection. The structure and content of a site is based on a site definition. Also referred to as SharePoint site and web site.
  • Site Collection – A set of websites that are in the same content database, have the same owner, and share administration settings. A site collection can be identified by a GUID or the URL of the top-level site for the site collection. Each site collection contains a top-level site, can contain one or more subsites, and can have a shared navigational structure.
  • Site Definition – family of site definition configurations. Each site definition specifies a name and contains a list of associated site definition configurations.
  • Site Template – An XML-based definition of site settings, including formatting, lists, views, and elements such as text, graphics, page layout, and styles. Site templates are stored in .stp files in the content database.
  • SOAP – A lightweight protocol for exchanging structured information in a decentralized, distributed environment. SOAP uses XML technologies to define an extensible messaging framework, which provides a message construct that can be exchanged over a variety of underlying protocols. The framework has been designed to be independent of any particular programming model and other implementation-specific semantics. SOAP 1.2 supersedes SOAP 1.1.
  • SOAP action – The HTTP request header field used to indicate the intent of the SOAP request, using a URI value.
  • SOAP body – A container for the payload data being delivered by a SOAP message to its recipient.
  • SOAP fault – A container for error and status information within a SOAP message.
  • Status-Code – A 3-digit integer result code in an HTTP response message.
  • Uniform Resource Locator (URL) – string of characters in a standardized format that identifies a document or resource on the World Wide Web.
  • User Name – A unique name that identifies a specific user account. The user name of an account is unique among the other group names and user names within its own domain or workgroup.
  • Web Application – A container in a configuration database that stores administrative settings and entry-point URLs for site collections
  • Web Services Description Language (WSDL) – An XML format for describing network services as a set of endpoints that operate on messages that contain either document-oriented or procedure-oriented information. The operations and messages are described abstractly and are bound to a concrete network protocol and message format in order to define an endpoint. Related concrete endpoints are combined into abstract endpoints, which describe a network service. WSDL is extensible, which allows the description of endpoints and their messages regardless of the message formats or network protocols that are used.
  • website – A group of related pages and data within a SharePoint site collection. The structure and content of a site is based on a site definition. Also referred to as SharePoint site and site.
  • WSDL operation – A single action or function of a web service. The execution of a WSDL operation typically requires the exchange of messages between the service requestor and the service provider.
  • XML namespace – A collection of names that is used to identify elements, types, and attributes in XML documents identified in a URI reference [RFC3986]. A combination of XML namespace and local name allows XML documents to use elements, types, and attributes that have the same names but come from different sources.
  • XML schema – A description of a type of XML document that is typically expressed in terms of constraints on the structure and content of documents of that type, in addition to the basic syntax constraints that are imposed by XML itself. An XML schema provides a view of a document type at a relatively high level of abstraction.

Get content source in sharepoint 2019 search service application using powershell

Get content source in sharepoint 2019 search service application using powershell

Get content source in sharepoint 2019 search service application using powershell. follow the code below to get the list with Name, Id, Type, CrawlState, CrawlCompleted date and time

$ssa=Get-SPEnterpriseSearchServiceApplication
Get-SPEnterpriseSearchCrawlContentSource -SearchApplication $ssa
Get content source in sharepoint 2019 search service application using powershell
powershell basics information post 1

powershell basics information post 1

Users who want to learn powershell especially for beginners these powershell basics information is the first step to move forward. These powershell basic commands related information will be very helpful while running script.

How to run powershell script

If you are writing scripts and running script is not simply type the name of a script file. As shown in figure below, you can’t simply type the name of a script file in order to run it. Let’s say i am creating one script to get all services running in windows server.

create script in windows

Lets create a very basic and simple powershell command as script. Follow the step by step process how to create powershell script.

  • Open Notepad.
  • Type “Get-Service”.
  • Save note pad as “.ps1” extension say “GetService.ps1”.
run-powershell-script-1

Even with the execution policy configured to permit scripts, you must precede the script filename with a path. In figure below, you see the “.\ path (C:\Users\Administrator)” in use, which refers to the “current directory (PS C:\Users\Administrator)”. You could also provide any other absolute or relative path in order to run a script but you must provide a path of some kind.

run-powershell-script-2

The script I saved in the the path “C:\Users\Administrator” of my system, so when you are at path “.\ path (C:\Users\Administrator)” or “current directory (PS C:\Users\Administrator)” and type name of the script that you saved with say “.\get” in Windows PowerShell ISE, that will be reflected there which you can select and run.

Change Directory in PowerShell

When you are working in production server, all scripts must be stored in a specific folder from where you need to run. In this case you need to change directory while running. Follow the step by step process below so as to change directory in powershell. Let’s say script is stored in the folder “PowershellScript” so the “.\ path” will be “F:\PowershellScript“. you need to change directory by running the below command for running script.

change-directory-powershell-1
Set-Location -Path F:\PowershellScript
or
cd F:\PowershellScript
change directory powershell-2
change directory powershell-3

You can drag the script and place at “Windows PowerShell” window. Then press “Enter“.

running script current directory-2
Advertisements
Advertisements

One script one pipeline

open a console window and run the following, pressing Enter after each line:

Get-Service
Get-Process

Now type those exact same lines into a script file, or into the ISE’s script editing pane, and run the script. You’ll get different results.

In PowerShell, each time you hit Enter you start a new pipeline. Whatever commands you typed are run in that single pipeline, and at the end of the pipeline PowerShell converts the contents of the pipeline into a text display.

When you ran the two commands in the normal console, you did so in two distinct pipelines.Therefore, PowerShell was able to construct a unique display for each set of output. When entered into a script, however, both commands ran in the same pipeline and PowerShell formatting system isn’t sophisticated enough to construct the same unique output for two different sets of results.

Try running this in the console:

Get-Service;Get-Process

Those results should look the same as they did when you ran the script containing those two commands. That’s because in this case both commands ran in a single pipe-line—which is hat happened when you ran the script

PowerShell variables

Variables provide a named, temporary place in memory that can store objects whether those are simple values like the number 5 or a collection of complex objects like the output of Get-Service.

Think of variables as a box, into which you can put one or more things even dis-similar things. The box has a name, and in PowerShell that name can include almost anything. “Var” can be a variable name, as can “{my variable}“. In that second example, the curly brackets enclose a Variable name that contains spaces. As per best practice, stick with variable names that include letters, numbers, and underscores.

Using a variable’s name references the entire box, but if you want to reference the contents of the box you need to add a dollar sign: $var. Most commonly, you will see PowerShell variables preceded with the dollar sign because the whole point of using one is to get at the contents. It’s important to remember, however, that the dollar sign isn’t part of the variable name: It’s just a cue to tell PowerShell that you want the contents rather than the box itself.

#assigns a string object to the variable var
$var = 'hello'
#creates a variable with an integer
$number = 1
#creates an array, because PowerShell interprets all comma-separated lists as an array, or collection, of items
$numbers = 1,2,3,4,5,6,7,8,9

These examples show how to place items into a variable, by using the assignment operator (=).

One thing that can sometimes confuse newcomers is that PowerShell doesn’t understand any meaning you may associate with a variable name. A variable like $computername doesn’t tell the shell that the variable will contain a computer name. Similarly, $numbers doesn’t tell the shell that a variable will contain more than one number the shell doesn’t care if you use a variable name that happens to be plural. $numbers=1 is equally valid to the shell, as is $numbers=’fred’.

Variable names normally consist of just letters, numbers, and the underscore character. But ${thisisalsoalegalvariablename} is also a valid variable name. In this example, the curly brackets enclose the entire name. This is not recommend using that approach. it’s confusing to read, and there’s really no need to have such a long variable name.

When a variable does contain multiple values, you can use a special syntax to access just a single one of them. $numbers[0] gets the first item, $numbers[1] is the second,$numbers[-1] is the last, $numbers[-2] is the second to last, and so on.

Quotation marks

#insert a variable’s contents into a string
$name = 'Don'
#$prompt will now contain My name is Don because $name will be replaced with the contents of the variable
$prompt = "My name is $name"
$processes = Get-Process
$prompt = "The first process is using $($processes[0].vm) bytes of VM."
$debug = "`$computer contains $computer" #the first $ is escaped
$head = "Column`tColumn`tColumn" #`t is the tab character
$filter1 = "name='BITS'"
$computer = 'BITS'
$filter2 = "name='$computer'"
Advertisements
Advertisements

PowerShell object members and variables

Everything in PowerShell is an object. Even a string ‘name’ is also an object, of type System.String. We can pipe any object to Get-Member to see its type name (that is, the kind of object it is) as well as its members, which include its properties and methods.

$var = 'Hello'
$var | Get-Member
PowerShell object members and variables

Similarly we can check for objects of type integer.

Use a period after a variable name to tell the shell, “I don’t want to access the entire object within this variable; I want to access just one of its properties or methods.” After the period, provide the property or method name. Method names are always followed by parentheses (). Some methods accept input arguments, and those go within the parentheses in a comma-separated list. Other methods require no arguments, and so the parentheses are empty. But don’t forget the parentheses!

$svc = Get-Service
$svc[0].name         #get the first object's name property
$name = $svc[1].name
$name.length         #get the length property
$name.ToUpper()      #invoke the ToUpper method
PowerShell object members and variables 1
PowerShell object members and variables 2
PowerShell object members and variables 3

line 2 : Accessing the first item in the $svc variable. The period means “I don’t want that entire object—I just want a property or method.” We’ve then accessed just the name property. Line 5 illustrates how to access a method, by providing its name after a period, and then following that with the parentheses.

A period is normally an illegal character within a variable name, because the period means we want to access a property or method. That means line 2 below won’t work the way you might expect:

$service = 'bits'
$name = "Service is $service.ToUpper()"
$upper = $name.ToUpper()
$name = "Service is $upper"

On line 2, $name will contain Service is BITS.ToUpper() whereas on line 4 $name will contain Service is BITS.

Save list as template sharepoint 2019 powershell

Most of the cases end user or site owner who actually own the sharepoint site for production server, create list using out of box UI to create sharepoint list. There are certain cases where requirement is to save list as template and create another list using the saved template. Here i will share how to Save list as template sharepoint 2019 powershell. Creating powershell is very fast, easy, less performance issues compared to UI method.

I have a custom sharepoint list “Name: Report 2019”. The number of list items crossed the limit of listview threshold 5000. You got a request to create another list of similar template without including content. This case Save list as template sharepoint 2019 powershell would be helpful. Please find the script below.

Save list as template sharepoint 2019 powershell
#Configuration parameters
$WebURL="http://win-7uqhlrcrq7g:40331/sites/SpTechSupport/"
$ListName="Report 2019"
$TemplateName="Report 2019 Template"
$TemplateFileName="Report2019Template"
$TemplateDescription="Report 2019 List Template"
$SaveData = $true

#Get the Web and List objects
$Web = Get-SPWeb $WebURL
$List = $Web.Lists[$ListName]

#Save List as Template
$List.SaveAsTemplate($TemplateFileName, $TemplateName, $TemplateDescription, $SaveData)
Write-Host "List Saved as Template!"
Advertisements
Advertisements
Save list as template sharepoint 2019 powershell-2
Save list as template sharepoint 2019 powershell-2

Navigate to “List Template” and see, we save list as template.

Save list as template sharepoint 2019 powershell -3