PowerShell for Microsoft SharePoint 2010 Administrators in .NET

Create QR Code in .NET PowerShell for Microsoft SharePoint 2010 Administrators

PowerShell for Microsoft SharePoint 2010 Administrators
QR Code 2d Barcode Reader In VS .NET
Using Barcode Control SDK for Visual Studio .NET Control to generate, create, read, scan barcode image in VS .NET applications.
Denso QR Bar Code Printer In .NET
Using Barcode printer for .NET framework Control to generate, create QR Code ISO/IEC18004 image in VS .NET applications.
Figure 14-1
Read QR Code ISO/IEC18004 In .NET
Using Barcode decoder for .NET framework Control to read, scan read, scan image in .NET framework applications.
Bar Code Creation In Visual Studio .NET
Using Barcode printer for .NET Control to generate, create barcode image in Visual Studio .NET applications.
Custom list templates are displayed when creating new lists
Reading Barcode In .NET Framework
Using Barcode scanner for VS .NET Control to read, scan read, scan image in VS .NET applications.
Paint Quick Response Code In Visual C#
Using Barcode printer for .NET framework Control to generate, create QR Code JIS X 0510 image in .NET applications.
Summary
Quick Response Code Creator In Visual Studio .NET
Using Barcode creation for ASP.NET Control to generate, create QR Code 2d barcode image in ASP.NET applications.
QR-Code Maker In VB.NET
Using Barcode generation for VS .NET Control to generate, create QR Code image in Visual Studio .NET applications.
In this chapter, we demonstrated how to create SharePoint lists, fields, and list views using Windows PowerShell Even though this is an easy task to perform through the graphical user interface, there are situations where scripting SharePoint lists, fields, and views can save you a lot of time We also looked at some important concepts around how to optimize scripts by using the GetList and GetField methods to minimize the memory usage You saw how to use CAML queries when managing list views In the next chapter, which covers managing content in SharePoint list items, we will look at some other scenarios where CAML queries are useful
Printing GS1 DataBar Stacked In .NET Framework
Using Barcode generation for VS .NET Control to generate, create GS1 DataBar Stacked image in .NET applications.
Bar Code Generator In .NET
Using Barcode generator for VS .NET Control to generate, create barcode image in Visual Studio .NET applications.
Managing SharePoint List Items
Code 39 Encoder In Visual Studio .NET
Using Barcode maker for .NET framework Control to generate, create USS Code 39 image in VS .NET applications.
Making Code11 In .NET Framework
Using Barcode maker for Visual Studio .NET Control to generate, create Code11 image in .NET applications.
PowerShell for Microsoft SharePoint 2010 Administrators
Code 128 Code Set B Creation In Objective-C
Using Barcode generation for iPhone Control to generate, create USS Code 128 image in iPhone applications.
Paint UPC-A In None
Using Barcode generator for Font Control to generate, create UPC-A Supplement 5 image in Font applications.
harePoint 2010 offers the functionality to change the properties of multiple list items at the same time using the Datasheet view Updating multiple items at the same time is also a viable task for Windows PowerShell and could be very useful when updating items across multiple lists In this chapter, we will cover automating the procedures of creating, updating, and deleting list items using Windows PowerShell The last example demonstrates how to use Windows PowerShell to copy list items from one list to another list The destination list can be located in a different site, and with modification to the script, it could even be in a different SharePoint farm Knowing how to work with list items using Windows PowerShell will come in handy when creating more complex scripts that need to interact with content in SharePoint lists We presented an example of this usage in 11, where we created a script that checked for items in the request site list with a specific status, and if found, created a new site collection
Encode ECC200 In .NET Framework
Using Barcode generator for ASP.NET Control to generate, create Data Matrix 2d barcode image in ASP.NET applications.
Recognizing Barcode In C#
Using Barcode scanner for .NET Control to read, scan read, scan image in Visual Studio .NET applications.
Creating List Items
Scan Bar Code In Java
Using Barcode reader for Java Control to read, scan read, scan image in Java applications.
European Article Number 13 Drawer In Java
Using Barcode maker for Java Control to generate, create EAN-13 Supplement 5 image in Java applications.
For the examples in this chapter, we will use a custom list containing a variety of fields, as shown in Figure 15-1 This custom list contains fields of the following types: Text (single line of text), Note (multiple lines of text), Choice, Number, Currency, DateTime, Lookup, Boolean (yes/no), User (person or group), and URL (hyperlink or picture) We ll begin by creating some new list items using Windows PowerShell First, we need to retrieve a list object Here, we use the Get-SPList function presented in 14
Bar Code Decoder In Visual C#
Using Barcode Control SDK for .NET Control to generate, create, read, scan barcode image in .NET framework applications.
Code 128A Generator In Visual Studio .NET
Using Barcode creation for Reporting Service Control to generate, create Code 128 image in Reporting Service applications.
PS > $spList = Get-SPList -url "http://nimaintranet/Lists/Custom List"
The SPList class provides the AddItem method, which is used to create new list items When you call the AddItem method, an object of the type Microsoft SharePointSPListItem is returned Since we want to populate the properties of the new list item, we need to store the object in a variable in order to continue to work with it
PS > $spListItem = $spListAddItem()
Now we can start assigning values to the different fields the corresponding list item inherits from the parent list The SPListItem class provides a parameterized Item property for accessing the value contained in a particular field To specify the value of the Title field, we can use the following:
PS > $spListItemItem("Title") = "My new ListItem"
15:
Managing SharePoint List Items
Figure 15-1
Custom list in SharePoint 2010
Because the Item property is also an indexer for this class (more information is available at http://msdnmicrosoftcom/en-us/library/microsoftsharepointsplistitem aspx), we can also access field values simply using the indexing notation: placing the field s name within [" "] So, our previous example could also be in this form:
PS > $spListItem["Title"] = "My new ListItem"
PowerShell for Microsoft SharePoint 2010 Administrators
In this example, we assign the value My new ListItem to the list item s Title field Note that the field name is case-sensitive! Since the Title field is a single line of text type, we assign a SystemString value to it The second field in the list is a multiple lines of text type, so we can assign a SystemString value that spans multiple lines A simple way of creating this kind of value is by using a here-string A here-string is typically used for storing text with newlines, quotation marks, and other characters commonly found in large chunks of text In Windows PowerShell, a here-string begins with the characters @" followed by a new line and ends with the "@ characters In the next example, we store a here-string in a variable, and then use the variable as value for the Notes field
PS >> >> >> >> PS > $multipleLines = @" First Line Second Line Third Line "@ > $spListItem["Notes"] = $multipleLines
The next field that we want to add a value to is the Choices field In this type of field, we must add values that match the options available in the field In this example, the field supports the options First Choice, Second Choice, and Third Choice We assign a value of Second Choice to the Choices field
PS > $spListItem["Choices"] = "Second Choice"
NOTE If a Choice type field accepts multiple values, use the ; character to separate them For the Number field, which can contain only numeric values, we can simply type a number as input, since Windows PowerShell automatically interprets numbers as SystemInt32 or SystemDouble, depending on the value
PS > $spListItem["Number"] = 18
In this example, we use 18 as input, and Windows PowerShell will interpret the number as a SystemDouble object Like the Number type field, a Currency type list field accepts numeric values The next example shows how to add a value to this field
PS > $spListItem["Currency"] = 10
The DateTime type list field accepts values that can be interpreted as date and time designators Windows PowerShell includes the Get-Date cmdlet, which we can use when working with such fields in SharePoint 2010
Copyright © OnBarcode.com . All rights reserved.