PS > Get-SPShellAdmin (Get-SPContentDatabase -Identity WSS_Content) UserName -------POWERSHELL\nigo in VS .NET

Creating QR Code ISO/IEC18004 in VS .NET PS > Get-SPShellAdmin (Get-SPContentDatabase -Identity WSS_Content) UserName -------POWERSHELL\nigo

PS > Get-SPShellAdmin (Get-SPContentDatabase -Identity WSS_Content) UserName -------POWERSHELL\nigo
Read Quick Response Code In Visual Studio .NET
Using Barcode Control SDK for VS .NET Control to generate, create, read, scan barcode image in Visual Studio .NET applications.
Print QR Code ISO/IEC18004 In VS .NET
Using Barcode creation for VS .NET Control to generate, create QR Code image in .NET applications.
It is also possible to remove users from the SharePoint Shell Access role using the Remove-SPShellAdmin cmdlet as demonstrated in the example below
Denso QR Bar Code Decoder In Visual Studio .NET
Using Barcode decoder for VS .NET Control to read, scan read, scan image in Visual Studio .NET applications.
Generate Barcode In Visual Studio .NET
Using Barcode maker for VS .NET Control to generate, create barcode image in Visual Studio .NET applications.
PS > Remove-SPShellAdmin -UserName powershell\nigo ` >> -database (Get-SPContentDatabase -Identity WSS_Content)
Recognize Bar Code In .NET
Using Barcode decoder for .NET framework Control to read, scan read, scan image in VS .NET applications.
QR-Code Generator In Visual C#.NET
Using Barcode generation for .NET Control to generate, create QR Code 2d barcode image in .NET applications.
4:
Making QR-Code In .NET Framework
Using Barcode creation for ASP.NET Control to generate, create QR Code ISO/IEC18004 image in ASP.NET applications.
Generating Quick Response Code In VB.NET
Using Barcode encoder for .NET framework Control to generate, create Denso QR Bar Code image in .NET framework applications.
Managing SharePoint 2010 with Windows PowerShell
Make Matrix Barcode In VS .NET
Using Barcode creation for .NET framework Control to generate, create Matrix Barcode image in VS .NET applications.
Barcode Encoder In Visual Studio .NET
Using Barcode creator for .NET framework Control to generate, create barcode image in VS .NET applications.
Managing Content Databases in SharePoint 2010
Draw Code39 In .NET Framework
Using Barcode drawer for Visual Studio .NET Control to generate, create Code 3 of 9 image in .NET framework applications.
Code 93 Full ASCII Generator In .NET
Using Barcode generation for .NET Control to generate, create Code 93 Extended image in .NET framework applications.
Windows PowerShell includes eight cmdlets that you can use when working with the SharePoint 2010 content database To retrieve a list of all content database cmdlets available, use Get-Command with the Noun parameter to list all cmdlets where the noun is SPContentDatabase:
EAN13 Maker In Java
Using Barcode drawer for Android Control to generate, create EAN-13 Supplement 5 image in Android applications.
EAN-13 Supplement 5 Decoder In Visual C#
Using Barcode decoder for .NET framework Control to read, scan read, scan image in .NET framework applications.
PS > Get-Command -Noun SPContentDatabase CommandType ----------Cmdlet Cmdlet Cmdlet Cmdlet Cmdlet Cmdlet Cmdlet Cmdlet Name ---Dismount-SPContentDatabase Get-SPContentDatabase Mount-SPContentDatabase New-SPContentDatabase Remove-SPContentDatabase Set-SPContentDatabase Test-SPContentDatabase Upgrade-SPContentDatabase Definition ---------Dismount-SPContentDatabase Get-SPContentDatabase [[-Id Mount-SPContentDatabase [-N New-SPContentDatabase [-Nam Remove-SPContentDatabase [Set-SPContentDatabase [-Ide Test-SPContentDatabase [-Id Upgrade-SPContentDatabase [
Barcode Generator In .NET Framework
Using Barcode printer for ASP.NET Control to generate, create barcode image in ASP.NET applications.
Create Barcode In .NET
Using Barcode printer for Reporting Service Control to generate, create bar code image in Reporting Service applications.
We ll explore how to use the first six cmdlets here
Bar Code Drawer In None
Using Barcode printer for Software Control to generate, create bar code image in Software applications.
UCC - 12 Generation In Java
Using Barcode encoder for Java Control to generate, create EAN / UCC - 14 image in Java applications.
Getting a SharePoint 2010 Content Database
Barcode Generator In Java
Using Barcode creation for Android Control to generate, create bar code image in Android applications.
2D Barcode Generator In .NET
Using Barcode encoder for ASP.NET Control to generate, create 2D Barcode image in ASP.NET applications.
The Get-SPContentDatabase cmdlet is used to return one or more content databases in SharePoint 2010 You can retrieve a specific content database, a content database based on a site collection, or a content database from a specified web application Let s start by retrieving all available content databases:
PS > Get-SPContentDatabase Id Name WebApplication Server CurrentSiteCount : : : : : 96dfa348-42df-4e9b-bbc5-1f4e8ee1051e WSS_Content SPWebApplication Name=SharePoint - 80 SPServer01 2
To retrieve content databases for a specific site collection, use the Site parameter:
PS > Get-SPContentDatabase -Site http://SPServer01 Id Name WebApplication Server CurrentSiteCount : : : : : 96dfa348-42df-4e9b-bbc5-1f4e8ee1051e WSS_Content SPWebApplication Name=SharePoint - 80 SPServer01 2
PowerShell for Microsoft SharePoint 2010 Administrators
It is even possible to specify a web application and retrieve the content databases attached to it If the web application is associated with more than one content database, all are returned
PS > Get-SPContentDatabase -WebApplication "SharePoint - 80" Id Name WebApplication Server CurrentSiteCount : : : : : 96dfa348-42df-4e9b-bbc5-1f4e8ee1051e WSS_Content SPWebApplication Name=SharePoint - 80 SPServer01 2
Like SPSite and SPWeb, the SPContentDatabase class has a large number of properties containing rich information, which you can retrieve through the appropriate cmdlet As you saw in 3, the Format-List cmdlet displays the information as a list Used with the asterisk wildcard, it retrieves all properties:
PS > Get-SPContentDatabase | Format-List *
Figure 4-1 shows the output from this command
Figure 4-1
Using Format-List to display all properties
4:
Managing SharePoint 2010 with Windows PowerShell
Configuring the SharePoint 2010 Content Database
The Set-SPContentDatabase cmdlet is used to change the properties of a content database This cmdlet allows you to change the maximum number of site collections that a content database can host, change the status of the content database, and specify the number of sites that can be created before a warning event is generated We ll start with modifying the maximum number of site collections allowed First, let s get the current value of the MaximumSiteCount property:
PS > (Get-SPContentDatabase -Site http://SPServer01)MaximumSiteCount 15000
Here s how to change the value using the Set-SPContentDatabase cmdlet:
PS > Get-SPContentDatabase -Site http://SPServer01 | >> Set-SPContentDatabase -MaxSiteCount 20000 PS > (Get-SPContentDatabase -Site http://SPServer01)MaximumSiteCount 20000
This example uses Get-SPContentDatabase to retrieve a content database, and then uses a pipeline to send the object to the Set-SPContentDatabase cmdlet We then use the MaxSiteCount parameter and change the value to 20000, increasing it by 5,000 sites When we check the MaximumSiteCount property, we can see that the value has been updated Next, let s change the status of the content database to Offline:
PS > (Get-SPContentDatabase -Site http://SPServer01)Status Online PS > Get-SPContentDatabase -Site http://SPServer01 | >> Set-SPContentDatabase -Status Offline PS > (Get-SPContentDatabase -Site http://SPServer01)Status Offline
In this example, we use the -Status parameter to change the status of the content database from Online to Offline We verify that the change was made using the Get-SPContentDatabase cmdlet It is just as simple to set the status to Online, as follows:
PS > Get-SPContentDatabase -Site http://SPServer01 | >> Set-SPContentDatabase -Status Online
Attaching and Detaching a Content Database in SharePoint 2010
The SharePoint 2010 snap-in for Windows PowerShell offers two cmdlets that allow you to attach and detach content databases to a SharePoint 2010 farm
PowerShell for Microsoft SharePoint 2010 Administrators
To detach a content database, use the Dismount-SPContentDatabase cmdlet:
PS > Get-SPContentDatabase -Site http://SPServer01 | Dismount-SPContentDatabase Confirm Are you sure you want to perform this action Performing operation "Dismount-SPContentDatabase" on Target "WSS_Content" [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [ ] Help (default is "Y"): Y
As you can see, Windows PowerShell displays a confirmation prompt asking if you are sure that you want to perform the action Cmdlets that perform actions that involve a risk to the system or to user data often require a confirmation When you type Y or just press ENTER, the action is performed If you now try to access your content database with the Get-SPContentDatabase cmdlet, nothing will be returned, since the content database is detached from the farm To attach a content database to a farm in SharePoint 2010, use the MountSPContentDatabase cmdlet:
PS > Mount-SPContentDatabase "WSS_Content" -DatabaseServer SPServer01 ` >> -WebApplication http://SPServer01 Id Name WebApplication Server CurrentSiteCount : : : : : 96dfa348-42df-4e9b-bbc5-1f4e8ee1051e WSS_Content SPWebApplication Name=SharePoint - 80 SPServer01 2
Copyright © OnBarcode.com . All rights reserved.