SharePoint 2010 Configure PowerShell Commands


CHANGE THE PORT OF CENTRAL ADMINISTRATION

Set-SPCentralAdministration -Port Where: is an available port, greater than 1023 and less than 32767. You can learn more about how to change the port of Central Administration in the TechNet articles “Change the Central Administration Web site port number SharePoint Server 2010)” at http://go.microsoft.com/fwlink/?LinkID=192720 and

CREATE A NEW WEB APPLICATION WITH CLASSIC MODE AUTHENTICATION

New-SPWebApplication -Name -Port -HostHeader -AuthenticationMethod [-AllowAnonymousAccess] [-SecureSocketsLayer] -URL -ApplicationPool -ApplicationPoolAccount -DatabaseName

New-SPWebApplication -Name "Contoso Partner Portal" -Port 443 -HostHeader "partners.contoso.com" -AuthenticationMethod "NTLM" -SecureSocketsLayer -URL "https://partners.contoso.com:443" -ApplicationPool "SharePoint Extranet Applications" –ApplicationPoolAccount (Get-SPManagedAccount "CONTOSO\SP_WebApps") -DatabaseName "SharePoint_Content_Partners"

The above command creates a new application pool. If the application pool already exists, you would not include the -ApplicationPoolAccount parameter and value.

The -SecureSocketsLayer parameter, if specified, enables SSL for the web application. As you learned in Lesson 1, you must also use IIS Manager to create the certificate in the server’s certificate store and bind the certificate to the IIS Web site.

CREATE AN AUTHENTICATION PROVIDER

$ap = New-SPAuthenticationProvider [-UseWindowsIntegratedAuthentication] [-DisableKerberos | DisableKerberos:$false] [-UseBasicAuthentication] [-AllowAnonymous]

CREATE A WEB APPLICATION WITH CLAIMS BASED AUTHENTICATION

A Windows authentication provider is constructed that uses only NTLM—Kerberos is disabled—and passed as the authentication provider for the new web application. $ap = New-SPAuthenticationProvider –UseWindowsIntegratedAuthentication –DisableKerberos New-SPWebApplication -Name "Contoso Partner Portal" -Port 443 -HostHeader "partners.contoso.com" –AuthenticationProvider $ap –SecureSocketsLayer -URL "https://partners.contoso.com:443" -ApplicationPool "SharePoint Extranet Applications" –ApplicationPoolAccount (Get-SPManagedAccount "CONTOSO\SP_WebApps") -DatabaseName "SharePoint_Content_Partners"

CREATE A WEB APPLICATION WITH FORMS-CLAIMS AUTHENTICATION

Forms Based Authentication (FBA) is an identity management system that is based on ASP.NET membership and role provider authentication. The credentials are authenticated against an identity store, which can be AD DS; a database such as a SQL Server database; or an LDAP data store such as Active Directory Lightweight Directory Services (AD LDS), Novell eDirectory, Novell Directory Services (NDS), or Sun ONE. Each ASP.NET role is treated as a domain group by the authorization process in SharePoint Server 2010. The resulting information about the user is converted into claims by the STS, thus FBA is also called Forms-Claims authentication.

$ap = New-SPAuthenticationProvider -ASPNETMembershipProvider "MyMembershipProvider" -ASPNETRoleProviderName "MyRoleManager" New-SPWebApplication -Name "Contoso Partner Portal" -Port 443 -HostHeader "partners.contoso.com" –AuthenticationProvider $ap –SecureSocketsLayer -URL "https://partners.contoso.com:443" -ApplicationPool "SharePoint Extranet Applications" -ApplicationPoolAccount (Get-SPManagedAccount "CONTOSO\SP_WebApps") -DatabaseName "SharePoint_Content_Partners"

CREATE A SITE COLLECTION USING WINDOWS POWERSHELL

New-SPSite -Url "" -ContentDatabase -Name "" -Template