Add-SPServiceApplicationProxyGroupMember
Example
[image]

Adds a member to the service application proxy group.

Add-SPServiceApplicationProxyGroupMember -Identity <SPServiceApplicationProxyGroupPipeBind> -Member <SPServiceApplicationProxyPipeBind[]> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

SPServiceApplicationProxyGroupPipeBind.

Specifies the service application proxy group to which to add the member.

Member

Required

SPServiceApplicationProxyPipeBind[]

Specifies an array of members to add to the service application proxy group.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Add-SPServiceApplicationProxyGroupMember cmdlet adds a member to the service application proxy group.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Add-SPServiceApplicationProxyGroupMember RemoteProxyGroup -Member babab30e-8e3a-428b-8ff4-4d5c8f455e6d

The following example adds a select service application proxy to the service application proxy group named "RemoteProxyGroup".

The service application proxy group GUID is unique to every farm. You can run Get-SPServiceApplicationProxyGroup | Select Name,Id to see the GUID of the serviceapplication proxy groups. Use this result for any other SPServiceApplicationProxyGroup cmdlets.
Click here to submit feedback on this topic.


Backup-SPConfigurationDatabase
Example
[image]

Performs a configuration-only backup.

Backup-SPConfigurationDatabase -Directory <String> [-AssignmentCollection <SPAssignmentCollection>] [-DatabaseCredentials <PSCredential>] [-DatabaseName <String>] [-DatabaseServer <String>] [-Item <String>] [-Passphrase <SecureString>] [-ShowTree <SwitchParameter>]

Parameters

Parameter Required Type Description

Directory

Required

System.String

The type must be either of the valid paths:

  • C:\ folder_name

  • \\ server_name \ folder_name

Note:
The spbr* folders are created automatically.

The path where <token SharePoint 14> should store the backup package it generates. If you have a computer that has <token for SQL Server 2006> and an instance of <token SharePoint 14> installed, you can use local drive paths . This would include a basic installation . However, if <token for SQL Server 2006> and <token SharePoint 14> are installed on multiple computers, you must use Universal Naming Convention (UNC) share paths so that the SQL database and search components are written to the same location; for example, \\computer_name\volume\Backup.

Multiple backup packages can be stored in the same location. This is the same path that you pass to the Directory parameter of the Restore-SPFarm operation .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

DatabaseCredentials

Optional

System.String

Specifies the password that corresponds to the administrator user name for the SQL Server database.

DatabaseName

Optional

System.String

Specifies the administrator user name for the SQL Server database. The type must be a valid user name; for example, domain\username.

DatabaseServer

Optional

System.String

Specifies the server on which to create the content database. The default value is the local computer name. The type must be a valid database server; for example, DS.

Item

Optional

System.String

Indicates the part of the farm to be backed up. You can use the full farm path notation, as displayed by the ShowTree parameter, or you can use the name of the target component in the path if it has a unique name. If multiple items are included in the same match, the full path must be provided. By default, the top node is selected. Surround the item or path in double quotation marks if it contains a space. If this parameter is absent, the entire farm is backed up. The type must be a valid item; for example, Web Application\SharePoint-80.

Passphrase

Optional

System.Security. SecureString

ShowTree

Optional

System.Management.Automation.SwitchParameter

Displays the objects in the farm to be backed up based on the other parameters that were passed to the backup operation , namely the Item parameter. Items to be excluded from the backup based on the other parameters passed to the Backup-SPFarm operation are preceded with an asterisk (*). Items that cannot be backed up are enclosed in brackets ([ ]). A backup is performed if the ShowTree parameter is present.

Detailed Description

The Backup-SPConfigurationDatabase cmdlet performs a configuration-only version of a backup to a configuration database.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Backup-SPFarm
Example
[image]

Creates a backup of an individual database, Web application, or the entire farm.

Backup-SPFarm -BackupMethod <String> -Directory <String> [-AssignmentCollection <SPAssignmentCollection>] [-BackupThreads <Int32>] [-ConfigurationOnly <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-Item <String>] [-Percentage <Int32>] [-WhatIf [<SwitchParameter>]]
Backup-SPFarm -ShowTree <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>] [-ConfigurationOnly <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Item <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

BackupMethod

Optional

System.String

Specifies the type of backup file to be created. The values are full or differential.

A full backup is a backup of all the selected data. A differential backup is a backup of all the selected data that has changed since the last full backup.

The type must be either of the following:

  • Full

  • Differential

Directory

Optional

System.String

Specifies the path where <token of SharePoint 14> stores the backup package it generates. If a computer has <token of SQL Server 2006> and an instance of <token of SharePoint 14> installed, you can use local drive paths. This would include a basic installation. However, if <token of SQL Server 2006> and <token of SharePoint 14> are installed on multiple computers, you must use Universal Naming Convention (UNC) share paths so that the SQL Server database and search components are written to the same location; for example, \\computer_name\volume\Backup).

Multiple backup packages can be stored in the same location. This is the same path that you pass to the Directory parameter of the Restore-SPFarm cmdlet.

The type must be either of the valid paths:

  • C:\ folder_name

  • \\server_name\folder_name

Note:
The spbr* folders are automatically created.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

BackupThreads

Optional

System.Int32

Specifies the number of threads to be used during the backup. For Windows SharePoint Services , the recommended value is 3 threads.

The default value is 1 and the maximum is 10. The fewer the threads, the easier the backup log file is to read and understand.

ConfigurationOnly

Optional

System.Management.Automation.SwitchParameter

Permits custom settings to be backed up.

Force

Optional

System.Management.Automation.SwitchParameter

Use to force a backup operation .

Item

Optional

System.String

Indicates the part of the farm to back up. You might use the full farm path notation as displayed by the ShowTree parameter or the name of the target component in the path if the component has a unique name. If multiple items are included in the same match, the full path must be provided. By default, the top node is selected. Surround the item or path in quotation marks if it contains a space. If this parameter is absent, the entire farm is backed up.

The type must be a valid item; for example, Web Application\SharePoint-80.

Percentage

Optional

System.Int32

Requests progress updates about the backup operation to be displayed in increments of that percentage; for example, a value of 5 displays backup progress updates at 5 percent completed, and a value of 10 displays backup progress updates at 10 percent completed).

Note:
This percentage is not precise and the actual progress updates might be lower or greater than requested.

For a very large database, 1 is the optimal value to use to see some updates displayed.

The default value is 5.

An integer value between 1 and 100.

The default value is 5.

Parameter Set 2

Parameter

Required

Type

Description

ShowTree

Required

System.Management.Automation.SwitchParameter

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

ConfigurationOnly

Optional

System.Management.Automation.SwitchParameter

Permits custom settings to be backed up.

Item

Optional

System.String

Indicates the part of the farm to back up. You might use the full farm path notation as displayed by the ShowTree parameter or the name of the target component in the path if the component has a unique name. If multiple items are included in the same match, the full path must be provided. By default, the top node is selected. Surround the item or path in quotation marks if it contains a space. If this parameter is absent, the entire farm is backed up.

The type must be a valid item; for example, Web Application\SharePoint-80.

Detailed Description

The Backup-SPFarm cmdlet creates a backup for the entire farm. If you want to back up a single site collection, use the Backup-SPSite cmdlet.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Backup-SPSite
See Also Example
[image]

Performs a backup of a site collection.

Backup-SPSite -Identity <SPSitePipeBind> -Path <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-NoSiteLock <SwitchParameter>] [-UseSqlSnapshot <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Specifies the URL or GUID of the site collection to be backed up.

For example, a valid URL, such as http://server_name/sites/site_name or a GUID such as, "01234567-89ab-cdef-0123-456789abcdef"

Path

Required

System.String

Specifies the full path to the backup file (that is, C:\Backup\site_name.bak.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Specify to overwrite an existing backup file if it already exists.

NoSiteLock

Optional

System.Management.Automation.SwitchParameter

Specifies the site collection to remain read/write during the backup.

If the NoSiteLock parameter is not specified, then a site collection that has a site collection lock setting of "none" or "no additions" will be temporarily set to "read only" while the site collection backup is performed. Once the backup has completed, the site collection lock will return to its original state. The backup package will record the original site collection lock state so that it is restored to that state.

If users are writing to the site collection while the site collection is being backed up, then the NoSiteLock parameter is not recommended for potential impact to backup integrity

UseSqlSnapshot

Optional

System.Management.Automation.SwitchParameter

Specifies a SQL Database Snapshot will be created when the backup begins, and all site collection data will be retrieved directly from the database snapshot. This snapshot will be deleted automatically when the backup completes

The UseSqlSnapshot parameter is recommended if the database server hosting your content database supports database snapshots such as such as SQL Server Enterprise Edition and SQL Server Developer Edition. This is because it will ensure a valid backup while allowing users to continue reading and writing to the site collection during the backup.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Backup-SPSite cmdlet performs a backup of the site collection when the Identity parameter is used.

By default, the site collection will be set to read-only for the duration of the backup to reduce the potential for user activity during the backup operation to corrupt the backup. If you have SQL Server Enterprise Edition, we recommend the UseSqlSnapshot parameter to be used as this will ensure a valid backup while allowing users to continue reading and writing to the site collection during the backup.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

-------------------EXAMPLE 1--------------------
Copy Code
Backup-SPSite http://server_name/sites/site_name -Path C:\Backup\site_name.bak

This example backs up a site collection at http://server_name/sites/site_name to the C:\Backup\site_name.bak file.

-------------------EXAMPLE 2--------------------
Copy Code
Get-SPSiteAdministration http://server_name/sites/site_name | Backup-SPSite -Path C:\Backup\site_name.bak

This example backs up a site collection at http://server_name/sites/site_name to the C:\Backup\site_name.bak file. Same result as Example 1, but a different way of performing the operation.

-------------------EXAMPLE 3--------------------
Copy Code
Backup-SPSite http://server_name/sites/site_name -Path C:\Backup\site_name.bak -UseSqlSnapshot

This example backs up a site collection using database snapshots to ensure backup integrity.

See Also

Move-SPSite

Reference

Get-SPSite
New-SPSite
Remove-SPSite
Restore-SPSite
Set-SPSite

Click here to submit feedback on this topic.


Clear-SPLogLevel
Example
[image]

Resets the Windows trace logging and event logging levels to their default values.

Clear-SPLogLevel [-AssignmentCollection <SPAssignmentCollection>] [-Identity <String[]>] [-InputObject <PSObject>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Identity

Optional

System.String[]

Providing an invalid category is a nonfatal error because invalid categories will be ignored .

Specifies the category name to be set . If the Identity parameter is not specified, the event throttling setting is applied to all categories in the farm.

InputObject

Optional

System.Management.Automation.PSObject

The InputObject is pipelined to the cmdlet and can be a string in a format identical to the Identity parameter, or can be an SPDiagnosticsCategory . The user can retrieve one or more categories from the Get-SPLogLevel cmdlet, modify their values, and then pipeline them into the Set-SPLogLevel cmdlet.

Detailed Description

The Clear-SPLogLevel cmdlet resets the Windows event logging and trace logging levels for the specified categories to the default values. If the Identity parameter is not provided, all categories are affected.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Clear-SPLogLevel -Identity Cat1

This example resets the log levels for a single category.

--------------EXAMPLE 2-----------------
Copy Code
Cat1", "Cat2", "Cat3" | Clear-SPLogLevel

This example resets the log levels for multiple categories.

--------------EXAMPLE 3-----------------
Copy Code
Get-SPLogLevel | Clear-SPLogLevel

This example resets the log levels for all categories.


Disable-SPFeature
Example
[image]

Disables an installed SharePoint Feature at a given scope.

Disable-SPFeature -Identity <SPFeatureDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-Url <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPFeatureDefinitionPipeBind

Specifies the name of the Feature or GUID to disable.

The type must be the name of the Feature folder located in the 14\Template\Features folder or GUID, in the format 21d186e1-7036-4092-a825-0eb6709e9281.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Forces a Feature to be disabled.

Url

Optional

System.String

Specifies the URL of the Web application, site collection, or Web site to which the Feature is being disabled.

The type must be a valid URL, such as http://server_name.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Disable-SPFeature cmdlet disables a SharePoint Feature at the given scope. If the scope of the Feature is the farm, the URL is not needed. Otherwise, provide the URL at which this Feature should be deactivated (explicit scope is not needed).

Input Types

Return Types

none

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Disable-SPFeature -identity "MyCustom" -URL http://somesite

This example disables the "MyCustom" Web site scoped feature at http://somesite.

--------------EXAMPLE 2-----------------
Copy Code
$w = Get-SPWeb http://somesite/myweb | ForEach{ $_.URL }
Copy Code
Get-SPFeature -Web $w |%{ Disable-SPFeature -Identity $_ -URL $w}

This example disables all features in the subsite at http://somesite/myweb.

You do not need to use SPAssignment here because the Web object is not stored — only the string value for the URL.


Enable-SPFeature
Example
[image]

Enables an installed SharePoint Feature at the given scope.

Enable-SPFeature -Identity <SPFeatureDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-PassThru <SwitchParameter>] [-Url <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPFeatureDefinitionPipeBind

Specifies the name of the Feature or GUID to uninstall.

The type must be the name of the Feature folder located in the 14\Template\Features folder or GUID, in the form 21d186e1-7036-4092-a825-0eb6709e9281.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Forces the activation of a Feature. This causes any custom code associated with the Feature to rerun.

PassThru

Optional

System.Management.Automation.SwitchParameter

If provided, the cmdlet outputs the Feature definition object after enable .

Url

Optional

System.String

Specifies the URL of the Web application, site collection, or Web site for which the Feature is being activated.

The type must be a valid URL; for example, http://server_name.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Enable-SPFeature cmdlet enables an installed feature at the given scope. If the feature is a farm feature, no URL is needed. Otherwise, provide the URL where the feature is to be enabled and it will be enabled at the proper scope based on the Feature definition.

This cmdlet has no output unless the PassThru parameter is provided, in which case the SPFeatureDefinition for the newly enabled feature is returned.

Note:
If you try to use the Url parameter on a farm-scoped feature, you receive the following error message: "The feature '<feature name>' applies to the entire farm; the Url parameter cannot be used with farm-scoped features."

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Enable-SPFeature -identity "MyCustom" -URL http://somesite

This example enables the "MyCustom" site scoped SharePoint Feature at http://somesite.

--------------EXAMPLE 2-----------------
Copy Code
$w = Get-SPWeb http://somesite/myweb | ForEach{ $_.URL }
Copy Code
Get-SPFeature -Web $w |%{ Enable-SPFeature -Identity $_ -URL $w}

This example enables all SharePoint Features in the subsite at http://somesite/myweb.


Export-SPSiteSubscriptionSettings
Example
[image]

Creates a backup file of site subscription data.

Export-SPSiteSubscriptionSettings -Identity <SPSiteSubscriptionPipeBind> -Path <String> [-AdminProperties <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>] [-Force <SwitchParameter>]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind

Specifies the ID of the site subscription from which to back up data.

The type must be a valid URL, in the form http://server_name or a GUID in the form 1234-4567-985tg.

Path

Required

System.String

Specifies the location of the output file.

The type must be a valid path; for example, C:/backupfile.back .

AdminProperties

Optional

System.Management.Automation.SwitchParameter

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Force

No

System.Management.Automation.SwitchParameter

Forces the output backup file (if provided) to overwrite any existing file at the given path.

Detailed Description

The Export-SPSiteSubscriptionSettings cmdlet generates a backup file of all settings in the subscription data store for the given site subscription.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPSiteSubscription http://contoso.com | Backup-SPSiteSubscriptionSettings -path "c:/backups"

The example backs up the Subscription Settings store of http://www.contoso.com.


Export-SPWeb
Example
[image]

Exports a site collection, Web application, list, or library.

Export-SPWeb -Identity <SPWebPipeBind> -Path <String> [-AssignmentCollection <SPAssignmentCollection>] [-CompressionSize <Int32>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-HaltOnError <SwitchParameter>] [-HaltOnWarning <SwitchParameter>] [-IncludeUserSecurity <SwitchParameter>] [-IncludeVersions <LastMajor | CurrentVersion | LastMajorAndMinor | All>] [-ItemUrl <String>] [-NoFileCompression <SwitchParameter>] [-NoLogFile <SwitchParameter>] [-UseSqlSnapshot <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebPipeBind

Specifies the URL of the Web application or GUID to be exported.

The type must be a valid GUID, in the form 1234-4567-5678a; a valid URL; (for example, http://server_name; or an object .

Path

Required

System.String

Specifies the name of the export file.

If the NoFileCompression parameter is used, a directory must be specified; otherwise, any file format is valid.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

CompressionSize

Optional

System.Int32

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Forcibly performs an export operation .

The type must be either of the following values:

  • True

  • False

The default value is False.

HaltOnError

Optional

System.Management.Automation.SwitchParameter

Stops the export process when an error occurs.

HaltOnWarning

Optional

System.Management.Automation.SwitchParameter

Stops the export process when a warning occurs.

IncludeUserSecurity

Optional

System.Management.Automation.SwitchParameter

Preserves the user security settings.

IncludeVersions

Optional

Microsoft.SharePoint.Deployment.SPIncludeVersions

Indicates the type of file and list item version history to be included in the export operation. If the IncludeVersions parameter is absent, the Export-SPWeb cmdlet by default uses a value of 1 .

The type must be any one of the following versions:

  1. Last major version for files and list items (default)

  2. The current version, either the last major version or the last minor version

  3. Last major and last minor version for files and list items

  4. All versions for files and list items

ItemUrl

Optional

System.string

Specifies the URL of the Web application, GUID, or object to be exported.

The type must be a valid URL; for example, http://server_name.

NoFileCompression

Optional

System.Management.Automation.SwitchParameter

NoLogFile

Optional

System.Management.Automation.SwitchParameter

Either enables or disables file compression in the export package. The export package is stored in the folder specified by the Path parameter or Identity parameter. We recommend that you use this parameter for performance reasons. If compression is enabled, the export process can increase by approximately 30 percent.

UseSqlSnapshot

Optional

System.Management.Automation.SwitchParameter

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Export-SPWeb cmdlet exports a site collection, Web application, list, or library from your <token of SharePoint 14>. The capability to export from a library is a new feature in <token of SharePoint 14>.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPAlternateURL
See Also Example
[image]

Returns all alternate URLs that match a given criterion.

Get-SPAlternateURL [-Identity <SPAlternateUrlPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Zone <String>]
Get-SPAlternateURL [-Identity <SPAlternateUrlPipeBind>] -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Zone <String>]
Get-SPAlternateURL [-Identity <SPAlternateUrlPipeBind>] -ResourceName <String> [-AssignmentCollection <SPAssignmentCollection>] [-Zone <String>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPAlternateUrlPipeBind

Specifies the URL or GUID of the alternate URL to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh, or a valid URL, in the form http://server_name.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Zone

Optional

System.String

Specifies one of the five zones with which to list the existing alternate URLs .

Must be a valid zone: Default, Intranet, Internet, Extranet, or Custom

Parameter Set 2

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPAlternateUrlPipeBind

Specifies the URL or GUID of the alternate URL to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh, or a valid URL, in the form http://server_name.

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the Web application from which to list alternate URLs.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Zone

Optional

System.String

Specifies one of the five zones with which to list the existing alternate URLs .

Must be a valid zone: Default, Intranet, Internet, Extranet, or Custom

Parameter Set 3

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPAlternateUrlPipeBind

Specifies the URL or GUID of the alternate URL to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh, or a valid URL, in the form http://server_name.

ResourceName

Required

System.String

Specifies the name of the resource from which to list alternate URLs.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Zone

Optional

System.String

Specifies one of the five zones with which to list the existing alternate URLs .

Must be a valid zone: Default, Intranet, Internet, Extranet, or Custom

Detailed Description

The Get-SPAlternateURL cmdlet returns all alternate URLs that match the scope given by either the optional Identity parameter or by a combination of the optional WebApplication, Zone, or Resource parameters. Each criterion that is added narrows the scope. If no criteria are specified then all alternate URLs are returned.

If the Identity parameter is used, only the specific matching alternate URL is returned. If no alternate URL with the given identity exists at the given scope, nothing is returned.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Get-SPAlternateURL -WebApplication http://localhost

This example displays all the alternate URLs on a given Web application.

--------------EXAMPLE 2-----------------
Copy Code
Get-SPAlternateURL -ResourceName "MyResource"

This example displays all the alternate URLs for a given resource.

See Also

Reference

New-SPAlternateUrl
Set-SPAlternateUrl
Remove-SPAlternateUrl

Click here to submit feedback on this topic.


Get-SPDatabase
Example
[image]

Retrieves all properties of a database.

Get-SPDatabase [-Identity <SPDatabasePipeBind>] [-AssignmentCollection <SPAssignmentCollection>]

Get-SPDatabase -ServerInstance <SPDatabaseServiceInstancePipeBind> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPDatabasePipeBind

Specifies the name of the database to display public properties.

The type must be a valid GUID, in the form 1234-3456-567kg.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 2

Parameter

Required

Type

Description

ServerInstance

Required

Microsoft.SharePoint.PowerShell.SPDatabaseServiceInstancePipeBind

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPDatabase cmdlet displays all public properties of a database to the current window. If the Identity parameter is specified, only properties of that ID are displayed.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPDiagnosticConfig
Example
[image]

Retrieves diagnostic configuration values from the farm.

Get-SPDiagnosticConfig [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPDiagnoticConfig cmdlet retrieves diagnostic configuation values from a Unified Logging Service (ULS) log that is in the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPDiagnosticConfig

This example returns all diagnostic configuration values.


Get-SPFarm
Example
[image]

Returns the local SharePoint farm.

Get-SPFarm [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPFarm cmdlet returns the local SharePoint farm. No parameters are used.

Input Types

Return Types

SPFarm

Errors

Error | Description

Exceptions

Exceptions | Description

Example
Copy Code
$f = Get-SPFarm

This example stores the local farm in a variable.


Get-SPFarmConfig
Example
[image]

Returns a global property or a collection of global properties for the local farm.

Get-SPFarmConfig [-AssignmentCollection <SPAssignmentCollection>] [-ServiceConnectionPoint <SwitchParameter>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

ServiceConnectionPoint

Optional

System.Management.Automation.SwitchParameter

Gets the information stored in the current farm's service connection point in Active Directory.

Detailed Description

The Get-SPFarmConfig cmdlet retrieves global settings for the local farm that are not members of the SPFarm object. This cmdlet creates a new PSCustomObject object from the collection of properties returned from the local farm, and then adds this object to the pipeline. The PSCustomObject object can be read, or modified and passed to the Set-SPFarmConfig cmdlet to change parameter values.

The properties collected in the PSCustomObject object must be farm-wide settings, and must be configurable only once for the entire farm. The parameter name added to the PSCustomObject object must match exactly the input parameter name for the Set-the SPFarmConfig cmdlet.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

-------------EXAMPLE----------------
Copy Code
$a = Get-SPFarmConfig
PS> $a.AjaxTimeout = 200
PS> $a | Set-SPFarmConfig

This example uses the Get-SPFarmConfig cmdlet to add the Ajax Timeout setting to the PSCustomObject object, sets the value for Ajax Timeout, and then passes PSCustomObject to the Set-SPFarmConfig cmdlet to change the Ajax Timeout setting. Ajax Timeout, a farm-wide setting, is a member of the SPWebService object and cannot be accessed with a PowerShell cmdlet.

You can perform the same operations with either of the following commands.

Copy Code
Set-SPFarmConfig -AjaxTimeout 200
Copy Code
Get-SPFarmConfig | Select AjaxTimeout 200


Get-SPFeature
Example
[image]

Returns the SharePoint Features based on a given scope.

Get-SPFeature [-Identity <SPFeatureDefinitionPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Limit <String>]
Get-SPFeature [-Identity <SPFeatureDefinitionPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Farm <SwitchParameter>] [-Limit <String>]
Get-SPFeature [-Identity <SPFeatureDefinitionPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Limit <String>] [-Sandboxed <SwitchParameter>] [-Site <SPSitePipeBind>]
Get-SPFeature [-Identity <SPFeatureDefinitionPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Limit <String>] [-Web <SPWebPipeBind>]
Get-SPFeature [-Identity <SPFeatureDefinitionPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Limit <String>] [-WebApplication <SPWebApplicationPipeBind>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPFeatureDefinitionPipeBind

Specifies the name of the Feature to retrieve.

The type must be the full or partial name, in the form Feature1, or a GUID, in the form 1234-4567-9879, of the Feature to get .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Limit

Optional

System.String

Limits the display results. If " All " is specified, all Features are displayed.

The type must be a valid number greater than 0. The default value is 200.

Parameter Set 2

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPFeatureDefinitionPipeBind

Specifies the name of the Feature to retrieve.

The type must be the full or partial name, in the form Feature1, or a GUID, in the form 1234-4567-9879, of the Feature to get .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Farm

Optional

System.Management.Automation.SwitchParameter

Specifies that if this parameter is used, only enabled farm Features are displayed .

Limit

Optional

System.String

Limits the display results. If " All " is specified, all Features are displayed.

The type must be a valid number greater than 0. The default value is 200.

Parameter Set 3

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPFeatureDefinitionPipeBind

Specifies the name of the Feature to retrieve.

The type must be the full or partial name, in the form Feature1, or a GUID, in the form 1234-4567-9879, of the Feature to get .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Limit

Optional

System.String

Limits the display results. If " All " is specified, all Features are displayed.

The type must be a valid number greater than 0. The default value is 200.

Site

Optional

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Specifies the name of the site collection from which to get enabled Features.

The type must be a valid URL for a site collection, in the form http://server_name .

Parameter Set 4

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPFeatureDefinitionPipeBind

Specifies the name of the Feature to retrieve.

The type must be the full or partial name, in the form Feature1, or a GUID, in the form 1234-4567-9879, of the Feature to get .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Limit

Optional

System.String

Limits the display results. If " All " is specified, all Features are displayed.

The type must be a valid number greater than 0. The default value is 200.

Web

Optional

Microsoft.SharePoint.PowerShell.SPWebPipeBind

Specifies the URL or GUID of the Web .

The type must be a valid URL, in the form http://server_name , or a GUID, in the form 1234-5678-9876-0987.

Parameter Set 5

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPFeatureDefinitionPipeBind

Specifies the name of the Feature to retrieve.

The type must be the full or partial name, in the form Feature1, or a GUID, in the form 1234-4567-9879, of the Feature to get .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Limit

Optional

System.String

Limits the display results. If " All " is specified, all Features are displayed.

The type must be a valid number greater than 0. The default value is 200.

Web

Optional

Microsoft.SharePoint.PowerShell.SPWebPipeBind

Specifies the URL or GUID of the Web .

The type must be a valid URL, in the form http://server_name , or a GUID, in the form 1234-5678-9876-0987.

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the name of the Web application from which to get enabled Features.

The type must be a valid URL to the Web application in the form http://server_name .

Detailed Description

All SPFeature sets take the Identity parameter, which can be either the relative path of the SharePoint Feature (considered the feature name) or the GUID of a Feature definition. If the Identity parameter is provided, the cmdlets attempt to find the given Feature definition or instance for the given scope. If no parameters are specified, all installed features are returned.

The Get-SPFeature cmdlet behaves differently at each scope, returning the enabled Features at each level. If no scope is provided, all installed Features are returned.

get-spfeature (returns all the installed Feature definitions in the farm)

get-spfeature-farm ( returns all the enabled Feature in the farm)

get-spfeature -webapplication (returns all enabled the Features in the Web application)

get-spfeature -site (returns all the enabled Features on the site <<both full trusted and particially trusted code>>)

get-spfeature -site -sandboxed (returns all installed the ptc Feature definitions on the site)

get-spfeature -web (returns all the enabled Features in the Web)

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Get-SPFeature -Limit ALL | Where-Object {$_.Scope -eq "SITE"}

This example returns a list of all installed "SITE" scoped Features.

--------------EXAMPLE 2-----------------
Copy Code
Get-SPSite http://somesite | Get-SPWeb -Limit ALL |%{ Get-SPFeature -Web $_ } | Select DisplayName,ID -Unique

This example returns the name and identifier (ID) of each uniquely enabled Feature on every SPWeb object in the site collection at http://somesite.


Get-SPIisWebServiceApplicationPool
Example
[image]

Returns the specified Internet Information Services (IIS) application pool.

Get-SPIisWebServiceApplicationPool [-Identity <SPIisWebServiceApplicationPoolPipeBind>] [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPIisWebServiceApplicationPoolPipeBind

Specifies the name or identifier (ID) of the application pool to get.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPIisWebServiceApplicationPool cmdlet returns the IIS application pool specified by the Identity parameter, or returns all application pools if the Identity parameter is not specified.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPIisWebServiceApplicationPool

This example returns all the service application pool in the farm.


Get-SPLogEvent
Example
[image]

Returns results from a Unified Logging Service (ULS) trace log.

Get-SPLogEvent [-AssignmentCollection <SPAssignmentCollection>] [-AsString <SwitchParameter>] [-ContextKey <String[]>] [-Directory <String>] [-EndTime <DateTime>] [-MinimumLevel <String>] [-StartTime <DateTime>]

Get-SPLogEvent [-AssignmentCollection <SPAssignmentCollection>] [-AsString <SwitchParameter>] [-ContextKey <String[]>] [-EndTime <DateTime>] [-File <String>] [-MinimumLevel <String>] [-StartTime <DateTime>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentColletion

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

AsString

No

System.Management.Automation.SwitchParameter

Returns each record as a separate string

ContextKey

Optional

System.String[]

Specifies that context data should be added to the results for the specified Context Keys, for example: -ContextKey @("UserName", "SiteName").

Directory

Optional

System.String

Lists log files from an alternate directory (any directory other than the configured LogLocation directory).

MinimumLevel

Optional

System.String

Returns records at or above the specified level. The valid values are Error or Warning .

EndTime

Optional

System.DateTime

The type must be a valid DateTime format that is culture-specific to the administrative language, such as 2/16/2007 12:15:12 for English-US.

StartTime

Optional

System.DateTime

The type must be a valid DateTime format that is culture-specific to the administrative language, such as 2/16/2007 12:15:12 for English-US.

Parameter Set 2

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentColletion

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

AsString

No

System.Management.Automation.SwitchParameter

Returns each record as a separate string

ContextKey

Optional

System.String[]

Specifies that context data should be added to the results for the specified Context Keys, for example: -ContextKey @("UserName", "SiteName").

MinimumLevel

Optional

System.String

Returns records at or above the specified level. The valid values are Error or Warning .

EndTime

Optional

System.DateTime

The type must be a valid DateTime format that is culture-specific to the administrative language, such as 2/16/2007 12:15:12 for English-US.

File

Optional

System.String

Specifies a specific file to query records from.

StartTime

Optional

System.DateTime

The type must be a valid DateTime format that is culture-specific to the administrative language, such as 2/16/2007 12:15:12 for English-US.

Detailed Description

The Get-SPLogEvent cmdlet returns records from a ULS trace log file that match the criteria. If no parameters are specified, only records from the most recent log file are returned.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Get-SPLogEvent -List
Copy Code
Get-SPLogEvent -List -AsString

This example returns a list of all log files. The first syntax includes file name and size, and the second syntax includes only the file name.

--------------EXAMPLE 2-----------------
Copy Code
Get-SPLogEvent -List -Directory "C:\Logs"

This example returns a list files from an alternate directory.

--------------EXAMPLE 3-----------------
Copy Code
Get-SPLogEvent -Newest 1

The following example returns the content of the most recent log file using default formatting.

--------------EXAMPLE 4-----------------
Copy Code
Get-SPLogEvent -Newest 1 -Limit all

The following example returns all records from the most recent log file.

--------------EXAMPLE 5-----------------
Copy Code
Get-SPLogEvent -Directory "C:\Logs" -Limit all | Where-Object {$_.Level -eq "Warning"}

The following example returns all warning entries from log files in the C:\Logs directory.

--------------EXAMPLE 6-----------------
Copy Code
Get-SPLogEvent -StartTime "12/04/2007 17:00" -EndTime "12/04/2007 18:00"

The following example returns error entries that occurred during a time span.

--------------EXAMPLE 7-----------------
Copy Code
Get-SPLogEvent -Newest 1 -Correlation "UserName,SiteName"

The following example returns the contents of the most recent log file and adds correlation data.

--------------EXAMPLE 8-----------------
Copy Code
Get-SPLogEvent -Newest 5 -Limit all | Where-Object {$_.Level -eq "Error" -and {$_.Area -eq "Windows SharePoint Services "}

The following example returns all error entries related to Windows SharePoint Services in the five most recent log files.

--------------EXAMPLE 9-----------------
Copy Code
Get-SPLogEvent | Where-Object {$_.Category -like "Excel*"}

The following example returns entries for categories related to Microsoft Excel.

--------------EXAMPLE 10-----------------
Copy Code
Get-SPLogEvent -Newest 1 -Correlation "UserName,SiteName" Where-Object {$_.UserName -eq "contoso\jdoe"}

The following example returns the contents of the most recent log file and filters on correlation data.


Get-SPLogLevel
Example
[image]

Displays a list of objects or diagnostic levels.

Get-SPLogLevel [-AssignmentCollection <SPAssignmentCollection>] [-Identity <String[]>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Identity

No

Specifies the category name.

The type must be a valid category name; for example, Backup and Restore.

Detailed Description

The Get-SPLogLevel cmdlet displays a list of objects or diagnostic levels based on the criteria specified. If no parameter is specified, a list of all categories is returned.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Get-SPLogLevel

This example returns a list of categories and their configured levels.

--------------EXAMPLE 2-----------------
Copy Code
Get-SPLogLevel -Identity "AreaName:Category1"

This example returns a diagnostics category object for a single category named Category1 within the AreaName provider.

The list of providers (areas) and category names can be obtained by running the Get-SPLogLevel cmdlet with no parameters specified.


Get-SPManagedAccount
Example
[image]

Retrieves accounts registered in the configuration database.

Get-SPManagedAccount [-Identity <SPManagedAccountPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Service <SPServicePipeBind>]
Get-SPManagedAccount [-Identity <SPManagedAccountPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-WebApplication <SPWebApplicationPipeBind>]
Get-SPManagedAccount [-Identity <SPManagedAccountPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Server <SPServerPipeBind>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPManagedAccountPipeBind

Specifies the full name or partial name of the managed accounts to retrieve.

The type must be a valid account name, in the form Domain\User, or a GUID, in the form 1234-3456-09876.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Service

Optional

Microsoft.SharePoint.PowerShell.SPServicePipeBind

Specifies the scope to a service.

Parameter Set 2

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPManagedAccountPipeBind

Specifies the full name or partial name of the managed accounts to retrieve.

The type must be a valid account name, in the form Domain\User, or a GUID, in the form 1234-3456-09876.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the scope to a Web application.

Parameter Set 3

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPManagedAccountPipeBind

Specifies the full name or partial name of the managed accounts to retrieve.

The type must be a valid account name, in the form Domain\User, or a GUID, in the form 1234-3456-09876.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Server

Optional

Microsoft.SharePoint.PowerShell.SPServerPipeBind

Specifies the scope to a server.

Detailed Description

The Get-SPManagedAccount cmdlet returns the managed accounts that match the given scope. The scope can be any one of the following values: Web application, service, or server.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPManagedAccount

This example displays all the managed accounts in the farm.


Get-SPManagedPath
Example
[image]

Returns all managed paths that match the given criteria.

Get-SPManagedPath [-Identity <SPPrefixPipeBind>] -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>]
Get-SPManagedPath [-Identity <SPPrefixPipeBind>] -HostHeader <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPPrefixPipeBind

Specifies the URL or GUID of the managed path to return.

The type must be a valid URL, in the http://server_name or a valid GUID (for example, 12345678-90ab-cdef-1234-567890bcdefgh).

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the URL or GUID of the Web application from which to get the managed path.

The type must be a valid URL, in the form http://server_name, or a valid GUID (for example, 12345678-90ab-cdef-1234-567890bcdefgh).

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 2

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPPrefixPipeBind

Specifies the URL or GUID of the managed path to return.

The type must be a valid URL, in the http://server_name or a valid GUID (for example, 12345678-90ab-cdef-1234-567890bcdefgh).

HostHeader

Required

System.Management.Automation.SwitchParameter

If provided, the managed paths returned are for the HostHeader sites in the farm .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPManagedPath cmdlet returns the SharePoint managed path that matches the provided Identity for either a WebApplication site collection or for all HostHeader site collections. If an identity is not provided, all managed paths for the given scope are returned.

HostHeader sites (no matter the Web application in which they are contained) share a single set of managed paths. Use the HostHeader flag to return host header managed paths.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Get-SPManagedPath -WebApplication http://localhost

This example returns all managed paths for the specified Web application.

--------------EXAMPLE 2-----------------
Copy Code
Get-SPManagedPath -identity "Sites" -HostHeader

This example gets the Sites managed path from the HostHeader managed paths.


Get-SPMobileMessagingAccount
See Also Example
[image]

Retrieves mobile messaging accounts for the specified Web application.

Get-SPMobileMessagingAccount [-Identity <SPMobileMessagingAccountPipeBind>] -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPMobileMessagingAccountPipeBind

Specifies whether to return either Short Message Service (SMS) or Multimedia Messaging Service (MMS) account information. Valid values are SMS and MMS . If you do not specify this parameter, account information is returned for both SMS and MMS.

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the identity of the Web application that hosts the managed path to delete . The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid Web application name (for example, WebApplication1212); or a valid name (for example, WebApp2423).

You either must specify WebApplication or must use the HostHeader switch and specify the full URL in the Identity parameter.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPMobileMessagingAccount cmdlet retrieves the specified mobile messaging accounts for the specified Web application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPMobileMessagingAccount -WebApplication http://localhost

This example retrieves the current mobile account settings information of the Web application http://localhost.

See Also

Reference

Set-SPMobileMessagingAccount

Click here to submit feedback on this topic.


Get-SPObjectSecurity
Example
[image]

Returns the security information for the specified service application.

Get-SPObjectSecurity -ServiceApplication <SPServiceApplicationPipeBind> -Type <String> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

ServiceApplication

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

The identity of the service application for which to get security information.

Type

Required

System.String

The type of security information to get.

The type must be either of the valid values Admin or Access .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPObjectSecurity cmdlet returns the security information for the service application that is specified by the ServiceApplication parameter.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-------------------
Copy Code
Get-SPObjectSecurity 053c34be-d251-488c-8e94-644eae94da26 -Type Admin

This example displays the Administrator type access information for the given service application.

The service application GUID is unique to every farm. You can run the Get-SPServiceApplication cmdlet to see the GUID of the service applications, and then use the result from the Get-SPServiceApplication cmdlet for other SPServiceApplication cmdlets (for example, Grant-SPServiceApplication or Publish-SPServiceApplication).


Get-SPProduct
Example
[image]

Returns a list of the SharePoint-related products installed in the farm and the versions of all updates installed for each product.

Get-SPProduct [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Local <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Get-SPProduct [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Server <SPServerPipeBind>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Local

Optional

System.Management.Automation.SwitchParameter

Returns product and update information for only the local computer. If you use the Local parameter, you cannot use the Server parameter.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Server

Optional

Microsoft.SharePoint.PowerShell.SPServerPipeBind

Returns product and update information for a specified server. If you use the Server parameter, you cannot use the Local parameter.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Get-SPProduct cmdlet returns a list of the SharePoint-related products installed in the farm and the versions of all updates installed for each product. By default this cmdlet returns the list of SharePoint-related products installed in the farm. However, if you use the Local parameter to get only information about the local server. Or, a specific server can be specified to get the list for if you use the Server parameter.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPProduct -Local

This example displays the SharePoint-related products installed on the local server.


Get-SPServer
Example
[image]

Returns the server or servers in the farm that match the given identity.

Get-SPServer [-Identity <SPServerPipeBind>] [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServerPipeBind

Specifies the address of the server to return.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPServer cmdlet returns the SPServer object for the given identity (if it exists in the farm). If no server is given, the cmdlet returns all servers in the farm.

Input Types

Return Types

Microsoft.SharePoint.Administration.SPServer

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Get-SPServer

This example returns all servers in the local farm in a list.

--------------EXAMPLE 2-----------------
Copy Code
Get-SPServer | Where{ $_.NeedsUpgrade -eq $TRUE}

This example returns a list of all servers in the farm that need an upgrade.


Get-SPServiceApplication
Example
[image]

Returns the specified service application.

Get-SPServiceApplication [-Identity <SPServiceApplicationPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Name <String>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the GUID of the service application to get.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPServiceApplication cmdlet returns the service application specified by the Identity parameter. If no service application is specified, the cmdlet returns all service applications in the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE----------------------
Copy Code
Get-SPServiceApplication

This example returns all service applications in the farm.


Get-SPServiceApplicationProxy
Example
[image]

Returns an instance of the specified service application proxy.

Get-SPServiceApplicationProxy [-Identity <SPServiceApplicationProxyPipeBind>] [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPServiceApplicationProxyPipeBind

Specifies the GUID of the service application proxy to return.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPServiceApplicationProxy cmdlet returns an instance of the service application proxy specified by the Identity parameter.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPServiceApplicationProxy

This example retrieves all the service application proxies in the farm.


Get-SPServiceApplicationProxyGroup
Example
[image]

Returns the proxy group for the specified service application.

Get-SPServiceApplicationProxyGroup [-Identity <SPServiceApplicationProxyGroupPipeBind>] [-AssignmentCollection <SPAssignmentCollection>]
Get-SPServiceApplicationProxyGroup -Default <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPServiceApplicationProxyGroupPipeBind

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 2

Parameter

Required

Type

Description

Default

Required

System.Management.Automation.SwitchParameter

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

Enter detail description

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPServiceApplicationProxyGroup

This example retrieves all of the service application proxy groups in the farm.


Get-SPServiceInstance
Example
[image]

Returns the services instance for a specific server or the entire farm.

Get-SPServiceInstance [-Identity <SPServiceInstancePipeBind>] [-AssignmentCollection <SPAssignmentCollection>]
Get-SPServiceInstance -Server <SPServerPipeBind> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPServiceInstancePipeBind

Specifies the GUID of the service instance.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 2

Parameter

Required

Type

Description

Server

Required

Microsoft.SharePoint.PowerShell.SPServerPipeBind

Specifies the server from which to return the service instance.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPServiceInstance cmdlet returns the services instance specified by the Identity parameter for a specific server. If the Server parameter is not specified, the Get-SPServiceInstance cmdlet returns results for the entire farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPServiceInstance -Server ServerA

This example displays the service instances from a given server.


Get-SPSite
Example
[image]

Returns all site collections that match the given criteria.

Get-SPSite [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit <String>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]]
Get-SPSite -Identity <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit <String>] [-Regex <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Get-SPSite -ContentDatabase <SPContentDatabasePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit <String>] [-WhatIf [<SwitchParameter>]]
Get-SPSite -SiteSubscription <SPSiteSubscriptionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Filter

Optional

System.Management.Automation.ScriptBlock

Specifies the script block of the server-side filter to apply.

The type must be a valid filter name and value in the form {$_PropertyName < operator > " filterValue "}.

Limit

Optional

System.String

Specifies the maximum number of site collections to return. The default value is 200 .

The type must be a valid non-negative number. Specify ALL to return all site collections for the given scope.

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the URL, GUID, or name of the Web application from which to list sites.

The type must be a valid URL, in the form http://server_name, a valid GUID (for example, 12345678-90ab-cdef-1234-567890bcdefgh); or the Web application name (for example, WebApplication1212).

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Specifies t he URL or GUID of the site collection to get.

The type must be a valid URL, in the form http://server_name or http://server_name/sites/sitename, or a valid GUID (for example, 12345678-90ab-cdef-1234-567890bcdefgh).

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Filter

Optional

System.Management.Automation.ScriptBlock

Specifies the script block of the server-side filter to apply.

The type must be a valid filter name and value in the form {$_PropertyName < operator > " filterValue "}.

Limit

Optional

System.String

Specifies the maximum number of site collections to return. The default value is 200 .

The type must be a valid non-negative number. Specify ALL to return all site collections for the given scope.

Regex

Optional

System.Management.Automation.SwitchParameter

Enabling this switch causes the URL provided for the Identity parameter to be treated as a regular expression.

The type must be a valid number between 0 and ??

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 3

Parameter

Required

Type

Description

ContentDatabase

Required

Microsoft.SharePoint.PowerShell.SPContentDatabasePipeBind

Specifies the GUID of the content database from which to list site collections.

The type must be a valid database name, in the form SPContentDB01, or a valid GUID (for example, 12345678-90ab-cdef-1234-567890bcdefgh).

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Filter

Optional

System.Management.Automation.ScriptBlock

Specifies the script block of the server-side filter to apply.

The type must be a valid filter name and value in the form {$_PropertyName < operator > " filterValue "}.

Limit

Optional

System.String

Specifies the maximum number of site collections to return. The default value is 200 .

The type must be a valid non-negative number. Specify ALL to return all site collections for the given scope.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 4

Parameter

Required

Type

Description

SiteSubscription

Required

Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind

Specifies the site subscription from which to get site collections.

The type must be a valid URL, in the form http://server_name or a valid GUID (for example, 12345678-90ab-cdef-1234-567890bcdefgh).

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Filter

Optional

System.Management.Automation.ScriptBlock

Specifies the script block of the server-side filter to apply.

The type must be a valid filter name and value in the form {$_PropertyName < operator > " filterValue "}.

Limit

Optional

System.String

Specifies the maximum number of site collections to return. The default value is 200 .

The type must be a valid non-negative number. Specify ALL to return all site collections for the given scope.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Get-SPSite cmdlet returns either a single site that matches the Identity parameter, or all the sites that match the Filter parameter for the specified scope. The scopes are the WebApplication, ContentDatabase , and SiteSubscription parameters. If none of these scopes is provided, the scope is the farm. If the scope is specified with no Filter parameter, all sites in that scope are returned.

The Identity parameter supports providing a partial URL that ends in a wildcard character (*). All site collections that match this partial URL for the specified scope are returned. Additionally, if the Regex parameter is provided, the Identity parameter is treated as a regular expression and any site collection with a URL provided in the given scope that matches the expression is returned.

The Filter parameter is a server-side filter for certain site collection properties that are stored in the content database; without the Filter parameter, filtering on these properties is a slow process. These site collection properties are Owner, SecondaryOwner, and LockState. The Filter parameter is a script block that uses the same syntax as a Where-Object statement, but is run server-side for faster results.

It is important to note that every site collection returned by the Get-SPSite cmdlet is automatically disposed of at the end of the pipeline. To store the results of Get-SPSite in a local variable, the Start-SPAssignment and Stop-SPAssignment cmdlets must be used to avoid memory leaks. See Get-Help About_SPAssignment for more information.

Input Types

None

Return Types

One or more Microsoft.SharePoint.SPSite objects

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1---------------------
Copy Code
Get-SPSite 'http://sitename' | Get-SPWeb -Limit All | Select Title

This example gets the collection of subweb titles in site collection at http://sitename.

------------------EXAMPLE 2---------------------
Copy Code
Get-SPSite -ContentDatabase "b399a366-d899-4cff-8a9b-8c0594ee755f" | Format-Table -Property Url, Owner, SecondaryOwner

This example gets a subset of data from all of the sites in the content database b399a366-d899-4cff-8a9b-8c0594ee755f.

------------------EXAMPLE 3---------------------
Copy Code
Start-SPAssignment -Global
Copy Code
$s = Get-SPSite -Identity http://MyApp/Sites/Site1
Copy Code
$s.Url
Copy Code
Stop-SPAssignment -Global

This example gets the sites specified by the Identity parameter and inserts the results in the variable s

The previous example uses the Global method of assignment collection. The Global method is easier to use but the contents of this object grows quickly. Be careful not to run a Get-SPSite command that returns many results while global assignment is enabled.

------------------EXAMPLE 4---------------------
Copy Code
$GC = Start-SPAssignment
Copy Code
$Sites = $GC | Get-SPSite -Filter {$_.Owner -eq "DOMAIN\JDoe"} -Limit 50
Copy Code
Stop-SPAssignment $GC

This example gets the first 50 sites owned by user DOMAIN\JDoe by using a server-side query, and assigns them to a local variable.

This example uses advanced Assignment Collection methods.

------------------EXAMPLE 5---------------------
Copy Code
Get-SPWebApplication http://localhost | Get-SPSite -Limit All |ForEach-Object {$sum=0}{ $sum+=$_.Usage.Storage }{$sum}

This example shows a command that returns the sum of the disk space usage for all sites in a given Web application.

------------------EXAMPLE 6---------------------
Copy Code
Get-SPSite -identity "http://localserver/(my|personal)/sites" -RegexL

This example returns all sites that match the given regular expression.

The Quotes on the Identity parameter are required when the Regex parameter is used.

------------------EXAMPLE 7---------------------
Copy Code
Get-SPSite http://sitename/sites/teams/* -Limit 100

This example gets up to 100 of the sites under the URL http://sitename/sites/teams.

------------------EXAMPLE 8---------------------
Copy Code
Get-SPSite | select url, @{Expression={$_.Usage.Storage}}

This example gets the amount of storage used by a site collection, by using the storage field of the .UsageInfo property.


Get-SPSiteAdministration
Example
[image]

Returns a site administration object that allows farm administrators to view certain information about site collections to which they might not have access.

Get-SPSiteAdministration [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit <String>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]]
Get-SPSiteAdministration -Identity <SPSiteAdministrationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit <String>] [-Regex <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Get-SPSiteAdministration -ContentDatabase <SPContentDatabasePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit <String>] [-WhatIf [<SwitchParameter>]]
Get-SPSiteAdministration -SiteSubscription <SPSiteSubscriptionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Filter

Optional

System.Management.Automation.ScriptBlock

Specifies the script block of the server-side filter to apply.

The type must be a valid filter name and a value in the form { $_ PropertyName <operator > " filterValue "}}

Limit

Optional

System.String

Specifies the maximum number of site collections to return. The default value is 200.

The type must be a valid non-negative number. Provide ALL to return all site collections for the given scope .

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the URL, GUID, or name of the Web application from which to list sites.

The type must be a valid URL, in the form http://server_name; a valid GUID (for example, 12345678-90ab-cdef-1234-567890bcdefgh); or the Web application name (for example, WebApplication1212).

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSiteAdministrationPipeBind

Specifies the URL (full or partial) or GUID of the site collection to retrieve.

The type must be a valid URL, in the form http://server_name, or a GUID, in the form 1234-456-987fg.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Filter

Optional

System.Management.Automation.ScriptBlock

Specifies the script block of the server-side filter to apply.

The type must be a valid filter name and a value in the form { $_ PropertyName <operator > " filterValue "}}

Limit

Optional

System.String

Specifies the maximum number of site collections to return. The default value is 200.

The type must be a valid non-negative number. Provide ALL to return all site collections for the given scope .

Regex

Optional

System.Management.Automation.SwitchParameter

Enabling this switch causes the URL provided for Identity parameter to be treated as a regular expression .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 3

Parameter

Required

Type

Description

ContentDatabase

Required

Microsoft.SharePoint.PowerShell.SPContentDatabasePipeBind

Specifies the URL (full or partial) or GUID of the site collection to retrieve.

The type must be a valid URL, in the form http://server_name, or a GUID, in the form, 1234-456-987fg.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Filter

Optional

System.Management.Automation.ScriptBlock

Specifies the script block of the server-side filter to apply.

The type must be a valid filter name and a value in the form { $_ PropertyName <operator > " filterValue "}}

Limit

Optional

System.String

Specifies the maximum number of site collections to return. The default value is 200.

The type must be a valid non-negative number. Provide ALL to return all site collections for the given scope .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 4

Parameter

Required

Type

Description

SiteSubscription

Required

Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind

Specifies the site group from which to get site collections.

The type must be a valid site subscription in the form, " ??"

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Filter

Optional

System.Management.Automation.ScriptBlock

Specifies the script block of the server-side filter to apply.

The type must be a valid filter name and a value in the form { $_ PropertyName <operator > " filterValue "}}

Limit

Optional

System.String

Specifies the maximum number of site collections to return. The default value is 200.

The type must be a valid non-negative number. Provide ALL to return all site collections for the given scope .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Get-SPSiteAdminitration cmdlet returns a site administration object that allows farm administrators to view certain information about site collections to which they might not have access.

Input Types

Return Types

Microsoft.SharePoint.Administration.SPSiteAdministration

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPSiteSubscription
Example
[image]

Returns the site subscription for the given URL or all site subscriptions in the local farm.

Get-SPSiteSubscription [-Identity <SPSiteSubscriptionPipeBind>] [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind

Specifies the ID of the subscription.

The type must be a valid URL, in the form http://server_name.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPSiteSubscription cmdlet returns the site subscription for the given URL when the Identity parameter is used. If no site collection is given, all unique site subscriptions in the farm are listed.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE----------------------
Copy Code
$SiteSub = Get-SPSiteSubscription http://Contoso.com
Copy Code
$SiteSub = Get-SPSite http://contoso.com | Get-SPSiteSubscription

This example retrieves the site subscription for http://Contoso.com.


Get-SPUsageApplication
Example
[image]

Returns a specified usage application.

Get-SPUsageApplication [-Identity <SPUsageApplicationPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-UsageService <SPUsageServicePipeBind>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPUsageApplicationPipeBind

Specifies the usage application to get. If the Identity parameter is not specified, the cmdlet returns the local usage application .

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a usage application (for example, UsageApplication1); or an instance of a valid SPUsageApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

UsageService

Optional

Microsoft.SharePoint.PowerShell.SPUsageServicePipeBind

Filters to return the usage application with the specified parent SPUsageService object.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a usage service (for example, UsageService1); or an instance of a valid SPUsageService object.

Detailed Description

The Get-SPUsageApplication cmdlet return a specified usage application. If the Identity parameter is not specified, the cmdlet returns the local usage application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPUsageService
Example
[image]

Returns a usage service.

Get-SPUsageService [-Identity <SPUsageServicePipeBind>] [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPUsageServicePipeBind

Specifies the usage service to get. If the Identity parameter is not specified, the cmdlet returns the local usage service.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a usage service (for example, UsageService1); or an instance of a valid SPUsageService object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPUsageService cmdlet returns the specified usage service. If the Identity parameter is not specified, the cmdlet returns the local usage service.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPUser
Example
[image]

Returns the user(s) that match a given search criteria.

Get-SPUser [-Identity <SPUserPipeBind>] -Web <SPWebPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Group <SPGroupPipeBind>] [-Limit <String>]

Parameters

Parameter | Required | Type | Description
Identity | Optional | Microsoft.SharePoint.PowerShell.SPUserPipeBind | Specifies the GUID or login name of the user to be returned. The type must be a valid URL, in the form http://server_name, or GUID, in the form1234-5678-9807.
Web | Required | Microsoft.SharePoint.PowerShell.SPWebPipeBind | Specifies the name of the URL or GUID to be used as a scope. The type must be a valid URL, in the form http://server_name, or a GUID, in the form 1234-5678-9807.
AssignmentCollection | Optional | Microsoft.SharePoint.PowerShell. SPAssignmentCollection |
Group | Optional | Microsoft.SharePoint.PowerShell.SPGroupPipeBind |
Limit | Optional | System.UInt32 |

Detailed Description

The Get-SPUser cmdlet returns all SharePoint users that match the scope given by the Identity, Web, or UserGroup parameters.

The Identity parameter can use the alias of a user for returning exact matches. However, a scope must be provided if the Get-SPUser cmdlet is to work.

The Filter parameter is a server-side filter tag that can be used to allow for a broader scope when used the PermissionLevel type.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPWeb
Example
[image]

Returns all subsites that match the given criteria.

Get-SPWeb [-Identity <SPWebPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Filter <ScriptBlock>] [-Limit <String>] [-Regex <SwitchParameter>] [-Site <SPSitePipeBind>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPWebPipeBind

Specifies the name or full or partial URL of the subsite. If you use a relative path, you must specify the Site parameter.

A valid URL in the form http://server_name or a relative path in the form of /SubSites/MySubSite.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Filter

Optional

System.Management.Automation.ScriptBlock

Specifies the server-side filter to use for the specified scope.

The type must be a valid filter in the form {filterName <operator> " filterValue "}.

Limit

Optional

System.String

Specifies the maximum number of subsites to return. The default value is 200 . To return all sites, enter ALL .

The type must be a valid number greater than 0 or ALL.

Regex

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Enabling this switch causes the URL provided for the Identity parameter to be treated as a regular expression .

Site

Optional

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Specifies the URL or GUID of the site collection from which to list subsites.

The type must be a valid URL, in the form of http://server_name; a GUID, in the form 1234-5678-9807, or an SPSite object.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Get-SPWeb cmdlet returns all subsites that match the scope given by the Identity parameter. All subsites that meet the criteria are returned.

The Identity can be either the full URL or a relative path. If you specify a relative path, you must also specify the Site parameter to identify the site collection from which to return the subsite.

The Identity parameter also supports providing a partial URL that ends in a wildcard character (*). All subsites that match this partial URL for the specified scope are returned. Additionally, if the Regex parameter is provided, the Identity parameter is treated as a regular expression and any subweb with a URL provided in the given scope that matches the expression is returned.

The Filter parameter is a server-side filter for certain subsite properties that are stored in the content database; without the Filter parameter, filtering on these properties is a slow process. These subsite properties are Template and Title. The Filter parameter is a script block that uses the same syntax as a Where-Object statement, but is run server-side for faster results.

It is important to note that every site collection returned by the Get-SPWeb cmdlet is automatically disposed of at the end of the pipeline. To store the results of Get-SPWeb in a local variable, the Start-SPAssignment and Stop-SPAssignment cmdlets must be used to avoid memory leaks. See Get-Help About_SPAssignment for more information.

Input Types

Return Types

Microsoft.SharePoint.SPWeb

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------------EXAMPLE 1----------------------
Copy Code
Get-SPWeb -site http://localhost/sites/site1

This example returns all the subwebs in a given site collection.

--------------------EXAMPLE 2----------------------
Copy Code
Get-SPWeb -filter {$_.Template -eq "STS#0"}

This example displays all subsites that use the "STS#0" template.

--------------------EXAMPLE 3----------------------
Copy Code
Start-SPAssignment -Global
Copy Code
$w = Get-SPWeb http://sitename
Copy Code
$w.set_SiteLogoUrl("http://PathToImage/test.jpg")
Copy Code
$w.Update()
Copy Code
Stop-SPAssignment -Global

This example demonstrates how to save a subsite as a variable and to call object model methods on the SPAssignment object.


Get-SPWebApplication
Example
[image]

Returns all Web applications that match the given criteria.

Get-SPWebApplication [-Identity <SPWebApplicationPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-IncludeCentralAdministration <SwitchParameter>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the name, URL, or GUID of the Web application.

The type must be a valid URL, in the form http://server_name; a GUID, in the form 1234-5678-9876-0987; or a valid name, in the form SPWebApplication - 1212.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

IncludeCentralAdministration

Optional

System.Management.Automation.SwitchParameter

Includes the Central Administration Web Application in the collection of Web applications that can be returned. Central Administration must still meet any other filters provided.

Detailed Description

The Get-SPWebApplication cmdlet returns all Web applications that match the scope given by the Identity parameter. The Identity can be the name of the name, URL, or GUID of the Web application. If no Identity is specified, all Web applications are returned.

The Central Administration Web application is only returned if its exact identity is provided or the IncludeCentralAdministration flag is provided.

Input Types

Return Types

Microsoft.SharePoint.Administration.SPWebApplication

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1----------------------
Copy Code
$w = Get-SPWebApplication http://sitename

This example gets the Web application for http://sitename and stores it in a variable.

------------------EXAMPLE 2-----------------------
Copy Code
C:\Users\FarmAdmin> Get-SPWebApplication -IncludeCentralAdministration | Where { $_.DefaultServerComment -eq "SharePoint Central Administration v4"} | Format-List *

This example displays all public properties on the SharePoint Central Administration Web application in list format.


Get-SPWebPartPack
Example
[image]

Returns the Web Part packages that were installed for the specified scope.

Get-SPWebPartPack [-Identity <String>] [-AssignmentCollection <SPAssignmentCollection>] [-GlobalOnly <SwitchParameter>] [-WebApplication <SPWebApplicationPipeBind>]

Parameters

Parameter Required Type Description

Identity

Optional

System.String

Specifies the full or partial name of the Web Part package from the configuration database.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

GlobalOnly

Optional

System.Management.Automation.SwitchParameter

Returns only Web Part packages that are installed in the global assembly cache (GAC).

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the Web application from which to list Web Part packages. If no Web application is specified, the specified Web Part packages will be returned from all Web applications.

Detailed Description

The Get-SPWebPartPack cmdlet returns the installed Web Part packages that match the Identity parameter. The scope of results can be narrowed by using the optional WebApplication parameter. The scope does not include any Web Part packages installed in the global assembly cache (GAC) unless the GlobalOnly parameter is used. If this parameter is used, only Web Part packages that have been installed in the GAC are returned.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPWebTemplate
Example
[image]

Displays all globally installed site templates that match the given identity.

Get-SPWebTemplate [-Identity <SPWebTemplatePipeBind>] [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the name of the Web template to display.

The type must be the ID or full or partial name of the Web template.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPWebTemplate cmdlet displays all installed site templates that match the full or partial identity that was given.

Input Types

Return Types

Microsoft.SharePoint.SPWebTemplate

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
$template = Get-SPWebTemplate "STS#0"
Copy Code
New-SPSite http://contoso.com -OwnerAlias "DOMAIN\JDOE" -Template $template

This example creates a site collection by using the team site Web template (ID=STS#0)

--------------EXAMPLE 2-----------------
Copy Code
Get-SPWebTemplate "STS*"

This example displays basic information about all the STS templates.


Get-SPWorkflowConfig
See Also Example
[image]

Returns workflow settings for the specified Web application.

Get-SPWorkflowConfig -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter | Required | Type | Description
WebApplication | Required | Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind | Specifies the name or URL of the Web application. The type must be a valid name, in the form WebApplication-1212, or a URL, in the form http://server_name/WebApplicaiton-1212.
AssignmentCollection | Optional | Microsoft.SharePoint.PowerShell.SPAssignmentCollection |

Detailed Description

The Get-SPWorkflowConfig cmdlet returns workflow settings for the Web application specified by the WebApplication parameter.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPWorkFlowConfig -webapplication http://localhost

This example gets workflow settings for the specified Web application (http://localhost).

To get farm-level workflow settings for event delivery time-out, postpone threshold, and batch size, use the Get-SPFarmConfig cmdlet.

See Also

Reference

Set-SPWorkflowConfig

Click here to submit feedback on this topic.


Grant-SPServiceApplication
Example
[image]

Grants a user account access to the service application.

Grant-SPServiceApplication -Identity <SPServiceApplicationPipeBind> -UserPrincipal <String> -Rights <String[]> -Type <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the GUID of the service application to which to grant access.

The type must be a valid GUID , in the form 12345678-90ab-cdef-1234-567890bcdefgh.

UserPrincipal

Required

System.String

Specifies the identity to grant access to the service application.

The type must be a valid user principal name, in the form DOMAIN\user, or a claim, in the form CA:NTLM:Identity-username:domain\user.

Rights

Required

System.String[]

Specifies the r ights to grant the user. By default, the following right exists - 'full' for both the admin and access types. Service applications can define their own rights.

The type must be a string array with valid user rights entries .

Type

Required

System.String

Specifies whether to grant the principal administrator rights or access rights.

Either Admin or Access .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Grant-SPServiceApplication cmdlet grants the specified level of access to the specified user accounts to the specified service application with the specified rights.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE---------------------
Copy Code
Grant-SPServiceApplication 053c34be-d251-488c-8e94-644eae94da26 -UserPrincipal testdomin\tester1 -Rights Full Control -Type Admin

This example grants Full Control administrative access to the given user principal for the selected service application.

The service application GUID is unique to every farm. You can run the Get-SPServiceApplication cmdlet to see the GUID of the service applications, and then use the result from the Get-SPServiceApplication cmdlet for other SPServiceApplication cmdlets; for example, Grant-SPServiceApplication or Publish-SPServiceApplication.


Import-SPSiteSubscriptionSettings
Example
[image]

Restores a backup of subscription site settings to the given subscription identifier.

Import-SPSiteSubscriptionSettings -Identity <SPSiteSubscriptionPipeBind> -Path <String> [-AdminProperties <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind

Specifies the ID of the subscription to restore to .

The type must be a valid URL, in the form http://server_name, or a GUID, in the form 1234-4567-985tg.

Path

Required

System.String

Specifies the location of the input file.

The type must be a valid path, in the form C:\filename.bak .

AdminProperties

Optional

System.Management.Automation.SwitchParameter

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

No

System.Management.Automation.SwitchParameter

If a setting key already exists, determines whether the value should be overwritten with the value in the backup file.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Import-SPSiteSubscriptionSettings cmdlet restores a backup of subscription site settings to the given subscription identifier. Restores a backup of settings for the specified subscription identifier using the Identity parameter. To overwrite existing settings, use the Force parameter.

Input Types

Return Types

None.

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Get-SPSiteSubscription http://contoso.com | Import-SPSiteSubscriptionSettings -path "c:/backups/contoso_settings_file.bak" -force

This example restores the subscription settings store of contoso.com.


Import-SPWeb
Example
[image]

Imports a site collection, Web application, list, or library.

Import-SPWeb -Identity <SPWebPipeBind> -Path <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-HaltOnError <SwitchParameter>] [-HaltOnWarning <SwitchParameter>] [-IncludeUserSecurity <SwitchParameter>] [-NoFileCompression <SwitchParameter>] [-NoLogFile <SwitchParameter>] [-UpdateVersions <Append | Overwrite | Ignore>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebPipeBind

Specifies the URL of the Web application or GUID to be exported.

The type must be a valid URL, GUID, or object; for example, a valid URL, in the form http://server_name, or a GUID, in the form, 1234-4567-5678a.

Path

Required

System.String

Specifies the name of the export file.

If the NoFileCompression parameter is used, a directory must be specified; otherwise, any file format is valid.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Confirm

Optional

System.Management.Automation.SwitchParameter

Force

Optional

System.Management.Automation.SwitchParameter

Forces an import operation .

The type must be either of the following values

  • True

  • False

The default value is False .

HaltOnError

Optional

System.Management.Automation.SwitchParameter

Stops the export process when an error occurs.

HaltOnWarning

Optional

System.Management.Automation.SwitchParameter

Stops the export process when a warning occurs.

IncludeUserSecurity

Optional

System.Management.Automation.SwitchParameter

Preserves the user security settings.

NoFileCompression

Optional

System.Management.Automation.SwitchParameter

NoLogFile

Optional

System.Management.Automation.SwitchParameter

Suppresses the generation of an export log file. If this parameter is absent, the Import-SPWeb cmdlet generates an import log file in the same location as the import package. The log file uses Unified Logging Service (ULS).

We recommend that you use this parameter. However, for performance reasons, you might not want to generate a log file.

UpdateVersions

No

Microsoft.SharePoint.Deployment.SPUpdateVersions

Indicates how to resolve situations where a file to be imported to a site already exists in that site. If the -UpdateVersions parameter is absent, the import operation by default uses a value of 1 .

The type must be any one of the following:

  1. Add new versions to the current file (default)

  2. Overwrite the file and all of its versions (delete then insert)

  3. Ignore the file if it exists on the destination

WhatIf

Optional

System.Management.Automation.SwitchParameter

Detailed Description

The Import-SPWeb cmdlet imports a site collection, Web application, list, or library from your <token of SharePoint 14>. The capability to export from a library is a new feature in <token of SharePoint 14>.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Install-SPFeature
Example
[image]

Installs a feature by using the Feature.xml file.

Install-SPFeature -Path <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Install-SPFeature -AllExistingFeatures <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Path

Required

System.String

Specifies a valid file path; for example, MyFeature.

Name of feature to install.

Path to feature must be a literal path to the 14\Template\Features directory . Can be any standard character that the Windows system supports for a file name. The feature.xml filename is implied and does not need to be provided.

If the feature file is not found on disk, the following error message is displayed: "Failed to find the XML file at location 14\Template\Features\<file path >."

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Forces the installation of an already installed feature .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

AllExistingFeatures

Required

System.Management.Automation.SwitchParameter

Scans for existing, but unregistered features, and then registers them with the farm.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Forces the installation of an already installed feature .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Install-SPFeature cmdlet installs a specific SPFeature by providing in the Identity parameter the relative path from the folder "$env:ProgramFiles\Common Files\Microsoft Shared Debug\Web Server Extensions\14\TEMPLATE\FEATURES\ to the feature. The SharePoint Feature's files must already be put in the proper directory, either manually or by using a solution installer.

If the AllExistingFeatures is provided, the file system is scanned and any new features are installed. This is generally only used during deployment and upgrade.

Input Types

Return Types

Microsoft.SharePoint.Administration.SPFeatureDefinition

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Install-SPFeature -path "MyCustomFeature"

This example installs a new feature at $env:ProgramFiles\Common Files\Microsoft Shared Debug\Web Server Extensions\14\TEMPLATE\FEATURES\MyCustomFeature/feature.xml.

--------------EXAMPLE 2-----------------
Copy Code
Install-SPFeature -AllExistingFeatures -Whatif

The following example shows the unregistered features, available on the file system, that are installed if this command is run without the WhatIf parameter. This is commonly done after an upgrade process.


Install-SPHelpCollection
Example
[image]

Installs the provided Help collection files.

Install-SPHelpCollection -LiteralPath <String> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

LiteralPath

Optional

System.String

Provides this parameter to install a specific custom Help file. If left blank, all available Help file collections are installed.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Install-SPHelpCollection cmdlet provides a Help collection to install by means of the LiteralPath parameter or installs all available Help collection files. Any existing Help collection files are overwritten.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Install-SPWebPartPack
Example
[image]

Installs the specified Web Part package to the specified location.

Install-SPWebPartPack -LiteralPath <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-GlobalInstall <SwitchParameter>] [-Language <UInt32>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]]

Install-SPWebPartPack [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-GlobalInstall <SwitchParameter>] [-Language <UInt32>] [-LiteralPath <String>] [-Name <String>] [-WhatIf [<SwitchParameter>]]

Install-SPWebPartPack -Name <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-GlobalInstall <SwitchParameter>] [-Language <UInt32>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]]

Install-SPWebPartPack [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-Language <UInt32>] [-LiteralPath <String>] [-Name <String>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

LiteralPath

Required

System.String

Specifies the exact path to the Web Part package.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Overwrites any existing Web Part package with the same Path and Name .

GlobalInstall

Optional

System.Management.Automation.SwitchParameter

Installs the Web Part package in the global assembly cache (GAC) rather than in the /bin directory of each Web application. This installation makes the Web Part globally accessible on the servers.

Language

Optional

System.UInt32

Specifies the l anguage ID for the Web Part package.

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the Web application on which to install the Web Part pack. If no Web application is specified, the Web Part pack is installed on all Web applications.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

LiteralPath

Required

System.String

Specifies the exact path to the Web Part package.

Name

Required

System.String

Specifies the name of the Web Part package to install.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Overwrites any existing Web Part package with the same Path and Name .

GlobalInstall

Optional

System.Management.Automation.SwitchParameter

Installs the Web Part package in the global assembly cache (GAC) rather than in the /bin directory of each Web application. This installation makes the Web Part globally accessible on the servers.

Language

Optional

System.UInt32

Specifies the l anguage ID for the Web Part package.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 3

Parameter

Required

Type

Description

Name

Required

System.String

Specifies the name of the Web Part package to install.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Overwrites any existing Web Part package with the same Path and Name .

GlobalInstall

Optional

System.Management.Automation.SwitchParameter

Installs the Web Part package in the global assembly cache (GAC) rather than in the /bin directory of each Web application. This installation makes the Web Part globally accessible on the servers.

Language

Optional

System.UInt32

Specifies the l anguage ID for the Web Part package.

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the Web application on which to install the Web Part pack. If no Web application is specified, the Web Part pack is installed on all Web applications.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 4

Parameter

Required

Type

Description

LiteralPath

Required

System.String

Specifies the exact path to the Web Part package.

Name

Required

System.String

Specifies the name of the Web Part package to install.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Overwrites any existing Web Part package with the same Path and Name .

Language

Optional

System.UInt32

Specifies the l anguage ID for the Web Part package.

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the Web application on which to install the Web Part pack. If no Web application is specified, the Web Part pack is installed on all Web applications.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Install-SPWebPartPack cmdlet installs the Web Part package, at the LiteralPath parameter location, in the local farm. The Web Part package can be installed in a specific Web application by using the WebApplication parameter. If a Web application is not specified, the Web Part package is installed in all Web applications.

Use the Language parameter to specify a package language.

Use the GlobalInstall parameter to install the package to the global assembly cache (GAC) that gives this package full trust over the system.

Use the Force parameter to install the package to overwrite any existing Web Part package with the same Path or Name.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Install-SPWebTemplate
Example
[image]

Installs the given site template.

Install-SPWebTemplate -Path <String> -Name <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Description <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Path

Required

System.String

Specifies the path to the site template package.

The type must be a valid path; for example, < example of path >.

Name

Required

System.String

Specifies the name of the template.

The type must be a valid name; for example, MyTemplate.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Description

Optional

System.String

Specifies the template description.

The type must be a valid description; for example, Joe's Template.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Install-SPWebTemplate cmdlet installs the given site template using the name provided (title) as the unique ID.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
Install-SPSiteTemplate -path "mytemplate.cab" -name "My Template" -description "TestFarm"

This example installs the mytemplate.cab file as My Template with the description "TestFarm" on the farm.


Merge-SPLogFile
Example
[image]

Combines trace log entries from all farm computers into a single log file on the local computer.

Merge-SPLogFile -Path <String> [-Activity <Guid[]>] [-Area <String[]>] [-AssignmentCollection <SPAssignmentCollection>] [-Category <String[]>] [-Context <String[]>] [-EndTime <DateTime>] [-IncludeNestedActivities <SwitchParameter>] [-Level <String>] [-Message <String[]>] [-Overwrite <SwitchParameter>] [-Process <String[]>] [-StartTime <DateTime>] [-Tag <String[]>] [-Thread <UInt32[]>]

Parameters

Parameter Required Type Description

Path

Required

System.String

Specifies the path and file name to which to write the merged log file. Relative paths are supported.

Activity

Optional

System.Guid[]

Specifies the activity ID to filter on.

The type must be a valid GUID, in the form F0BB0790-4523-4323-A153-096FC80E24D4.

Area

Optional

System.String[]

Specifies the area ID to filter on.

The type must be a valid name; for example, Microsoft SharePoint Foundation 2010 .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Category

Optional

System.String[]

Specifies the category ID to filter on.

The type must be a valid category name; for example, category1 .

Context

Optional

System.String[]

Specifies the activity context, in the form key=value.

EndTime

Optional

System.DateTime

Specifies the end time of the log entries returned.

The type must be a valid date:time format that is culture-specific to the administrative language , in the form 2/16/2007 12:15:12.

IncludeNestedActivities

Optional

System.Management.Automation.SwitchParameter

Includes nested activities in the results

The type must be either of the following values:

  • True

  • False

The default value is True .

Level

Optional

System.String

Specifies the level name to filter on.

Message

Optional

System.String[]

Specifies the message Text to filter on.

The type must be a valid text; for example, this is a test.

Overwrite

No

System.Management.Automation.SwitchParameter

Overwrites the log file if it already exists at the specified path.

The type must be either of the following values:

  • True

  • False

The default value is False .

Process

Optional

System.String[]

Specifies the process name to filter on.

StartTime

Optional

System.DateTime

Specifies the start time of the log entries returned.

The type must be a valid date:time format that is culture-specific to the administrative language; for example, 2/16/2007 12:15:12.

The default time is CurrentTime minus 1 hour.

Tag

Optional

System.String[]

Specifies the tag ID to filter on.

Thread

Optional

System.UInt32[]

Specifies the thread ID to filter on.

The type must be a valid integer between 0 and 4,294,967,295.

Detailed Description

The Merge-SPLogFile cmdlet returns records from Unified Logging Service (ULS) trace log files on each farm server that match the criteria, and writes the results to a new log file on the local computer. If no results are returned, a warning is written to the Windows PowerShell console window.

If a filtering parameter is not specified, then no filtering is done on that column.

Most of the work of the Merge-SPLogFile cmdlet is done through timer jobs. The basic workflow is as follows:

  1. Merge-SPLogFile cmdlet is invoked.

  2. Input parameters are validated. If parameters are valid, the operation continues.

  3. Master timer job is created. To perform local filtering, this timer job creates child timer jobs on each computer and uploads results to the Central Administration document library.

  4. When all child jobs are completed, the master timer job merges log files from the Central Administration document library and writes the results as a single file on the local computer.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1-----------------
Copy Code
Merge-SPLogFile -Path "C:\Logs\FarmMergedLog.log" -Overwrite

This example merges the last hour of log data from all farm computers with no filtering.

--------------EXAMPLE 2-----------------
Copy Code
Merge-SPLogFile -Path "C:\Logs\FarmMergedLog.log" -Overwrite -Area Search

This example merges the last hour of log data from the Search area.

--------------EXAMPLE 3-----------------
Copy Code
Merge-SPLogFile -Path "C:\Logs\FarmMergedLog.log" -Overwrite -Area "Excel and Access Services","Web Companions"

This example merges the last hour of log data from the Excel and Access Services and Web Companions areas.

--------------EXAMPLE 4-----------------
Copy Code
Merge-SPLogFile -Path "C:\Logs\FarmMergedLog.log" -Overwrite -Level Assert

This example merges the log data of level Assert or higher.

--------------EXAMPLE 5-----------------
Copy Code
Merge-SPLogFile -Path "C:\Logs\FarmMergedLog.log" -Overwrite -StartTime "06/09/2008 16:00" - EndTime "06/09/2008 16:15"

This example merges the log data for events in a particular time range, which is culture-specific to the United States.

--------------EXAMPLE 6-----------------
Copy Code
Merge-SPLogFile -Path "C:\Logs\FarmMergedLog.log" -Overwrite -Message "*permission changed*"

This example merges the log data for events with permission changed in the message text.

--------------EXAMPLE 7-----------------
Copy Code
Merge-SPLogFile -Overwrite -Path d:\1.log -Context "name=timer job*" -Area "*search*"

This example merges the log data for all search timer jobs.

--------------EXAMPLE 8-----------------
Copy Code
Merge-SPLogFile -Overwrite -Path d:\2.log -Context "user=redmond?joeuser"

This example shows how to merge the log data for all users that have a contoso\joeuser or Contoso/joeuser format.


Move-SPUser
Example
[image]

Migrates a user account in Microsoft SharePoint Server 2010.

Move-SPUser -Identity <SPUserPipeBind> -NewAlias <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-IgnoreSID <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPUserPipeBind

Specifies the GUID or login name of the user to be returned.

The type must be a valid GUID of the user, in the form 1234-5678-9876-0987.

NewAlias

Required

System.String

Specifies the name of the URL or GUID that to be used as a scope.

The type must be a valid URL and GUID, in the form http://server_name or 1234-5678-9807.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

IgnoreSID

Optional

System.Management.Automation.SwitchParameter

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Move-SPUser cmdlet migrates user access from one domain user to another. If an entry for the new login name already exists, the entry is marked for deletion to make way for the migration.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example
Copy Code

            Click here to

      submit feedback
             on this topic.


New-SPAlternateUrl
See Also Example
[image]

Creates a new public or internal URL for the specified Web application zone or resource.

New-SPAlternateUrl -Url <String> -WebApplication <SPWebApplicationPipeBind> -Zone <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Internal <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
New-SPAlternateUrl -Url <String> -ResourceName <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Url

Required

System.String

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the name, URL, or GUID of the Web application for which to create the mapping.

The type must be a valid name, URL, in the form WebApplication-1212, http://server_name, or GUID, in the form 1234-5678-9876-0987.

Zone

Required

System.String

Specifies one of the five zones with which the alternate URL is associated.

The type must be a valid zone: Default, Intranet, Internet, Extranet, or Custom.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Internal

Optional

System.Management.Automation.SwitchParameter

Makes this alternate URL an internal URL. If this parameter is not provided, the URL is a public URL.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Url

Required

System.String

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

ResourceName

Optional

System.String

Specifies the resource name, if the alternate URL is for an external resource. If no value is specified, the value is left blank.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPAlternateUrl cmdlet creates a new public or internal URL for the specified Web application zone or resource. Use the ResourceName parameter if the alternate URL is for an external resource.

Each Web application can be associated with a collection of mappings between internal and public URLs. Both internal and public URLs consist of the protocol and domain portion of the full URL; for example, https://www.fabrikam.com. Users type a public URL to get to the SharePoint site, and that URL appears in the links on the pages. Internal URLs are in the URL requests that are sent to the SharePoint site. Many internal URLs can be associated with a single public URL in multiserver farms; for example, when a load balancer routes requests to specific IP addresses to various servers in the load-balancing cluster.

Each Web application supports five collections of mappings per URL; the five collections correspond to five zones (default, intranet, extranet, Internet, and custom). When the Web application receives a request for an internal URL in a particular zone, links on the pages returned to the user have the public URL for that zone.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
#create the public URL
New-SPAlternateURL https://www.contoso.com -Zone "Internet"
Copy Code
#create the internal URL
New-SPAlternateURL http://sharepoint.dmz.contoso.com -Zone "Internet" -internal

This example translates incoming requests for https://www.contoso.com into http://sharepoint.dmz.contoso.com (on the Internet zone).

When a reverse proxy is being set up to handle off-box SSL termination, alternate access mappings must be configured to handle the URL translation.

See Also

Reference

Set-SPAlternateUrl
Get-SPAlternateURL
Remove-SPAlternateUrl

Click here to submit feedback on this topic.


New-SPCentralAdministration
Example
[image]

Creates a new SharePoint Central Administration Web application.

New-SPCentralAdministration [-Port <Int32>] [-WindowsAuthProvider <String>] [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Port

Optional

System.Int32

Specifies the port number for Central Administration. If no port is specified, a nonconflicting port number is auto-generated.

The type must be a valid port number.

Important:
If you specify a port number that has already been assigned, IIS does not start the new site until you change either the port number of the new site or the port number of the old site.

WindowsAuthProvider

Optional

System.String

Specifies the authorization provider for this Web application. If no authentication provider is specified, the default value Claims is used.

The type must be one of three values: Kerberos , NTLM , or Claims .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The New-SPCentralAdministration cmdlet creates a new Central Administration Web application and starts the central administration service on the local machine. Central Administration is available only on machines where this service is running.

Input Types

Return Types

None.

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
New-SPCentralAdministration -Port 3000

This example creates the Central Administration site at port 3000 on the local farm.


New-SPConfigurationDatabase
See Also Example
[image]

Creates a new configuration database.

New-SPConfigurationDatabase -DatabaseName <String> -DatabaseServer <String> [-DirectoryDomain <String>] [-DirectoryOrganizationUnit <String>] [-AdministrationContentDatabaseName <String>] [-DatabaseCredentials <PSCredential>] -FarmCredentials <PSCredential> -Passphrase <SecureString> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

DatabaseName

Required

System.String

Specifies the name of the new configuration database.

DatabaseServer

Required

System.String

Specifies the database server on which to create the configuration database. If no value is specified, the default value is used .

DirectoryDomain

Optional

System.String

Specifies the directory domain for the new farm . If no domain is specified, the domain in which the local computer is located is used .

DirectoryOrganizationUnit

Optional

System.String

Specifies the directory organizational unit for the new configuration database. If no organizational unit is specified, the organizational unit in which the local computer is l ocated is used.

AdministrationContentDatabaseName

Required

System.String

Specifies the name for the Central Administration content database for the new farm. If no name is specified, a default name is used.

DatabaseCredentials

Optional

System.Management.Automation.PSCredential

Specifies the Credential object for the database user. Use this parameter if you use SQL authentication. If no database credentials are provided, Windows authentication is used .

FarmCredentials

Required

System.Management.Automation.PSCredential

Specifies credentials for the Farm Administrator account.

Passphrase

Required

System.Security.SecureString

Specifies the secure password phrase for the new farm. This passphrase is used to join other machines to this farm.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The New-SPConfigurationDatabase cmdlet creates a new configuration database in the specified database server. This is the central database for a new SharePoint farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
New-SPConfigurationDatabase -DatabaseName "SharePointConfigDB1" -DatabaseServer "SQL-01" -Passphrase (ConvertTo-SecureString "MyPassword" -AsPlainText -force) -FarmCredentials (Get-Credential)

This example prompts the user to provide user credentials for the default Farm Administrator account.

See Also

Dismount-SPConfigurationDatabase

Reference

Backup-SPConfigurationDatabase
Disconnect-SPConfigurationDatabase
Connect-SPConfigurationDatabase
Remove-SPConfigurationDatabase

Click here to submit feedback on this topic.


New-SPServiceApplicationPool
Example
[image]

Creates a new Web service application pool.

New-SPIisWebServiceApplicationPool -Name <String> -Account <SPProcessAccountPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Name

Required

System.String

Specifies the name of the new Web service application pool.

Account

Required

Microsoft.SharePoint.PowerShell.SPProcessAccountPipeBind

Specifies the credentials that will be the Identity of the new application pool.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPIisWebServiceApplicationPool cmdlet creates a new Web service application pool in Internet Information Services (IIS).

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------------EXAMPLE-----------------------
Copy Code
New-SPIisWebServiceApplicationPool -Name TestServiceWebApplicationPool -Account testdomain\testuser1

This example creates a new Web service application pool.

For the Account parameter, the name of a managed account in the farm can be given. Use the Get-SPManagedAccount cmdlet to view the existing managed account in the farm. Also, a process account from the output of the Get-SPProcessAccount cmdlet can be used.


New-SPLogFile
Example
[image]

Creates a new log file.

New-SPLogFile [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The New-SPLogFile cmdlet ends the current log file and starts a new log file.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE-----------------
Copy Code
New-SPLogFile

This example ends the current log file and starts a new log file.


New-SPManagedAccount
Example
[image]

Registers a new managed account.

New-SPManagedAccount -Credential <PSCredential> [-AssignmentCollection <SPAssignmentCollection>]
New-SPManagedAccount -Password <SecureString> -Username <String> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Credential

Required

System.Management.Automation.PSCredential

Indicates the Credential object that specifies the credentials of the new managed account. If you use Credential , you cannot specify Username and Password .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 2

Parameter

Required

Type

Description

Password

Required

System.Security.SecureString

Specifies the password for the user specified in Username . If you use Credential , you cannot specify Username and Password .

Username

Required

System.String

Specifies the user name of the new managed account. If you use Credential , you cannot specify Username and Password .

The type must be a valid user name, in the form domain\username.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The New-SPManagedAccount cmdlet registers a new managed account for the specified Credential or Username, and Password.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
$cred = Get-Credential
Copy Code
New-SPManagedAccount -Credential $cred

This example adds a new managed account to the farm by using credentials that are prompted for.


New-SPManagedPath
See Also Example
[image]

Creates a new managed path for the given Web application for all host header site collections.

New-SPManagedPath -RelativeURL <String> -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Explicit <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
New-SPManagedPath -RelativeURL <String> -HostHeader <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Explicit <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

RelativeURL

Required

System.String

Specifies the relative URL for the new managed path.

The type must be a valid partial URL such as site or sites/teams/.

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the Web application group to add this path.

The type must be a valid URL, in the form http://server_name, or a GUID, in the form 1234-5678-0987645a.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Explicit

Optional

System.Management.Automation.SwitchParameter

Specifies whether the managed path is explicit or wildcard.

If not provided, the managed path is a wildcard path.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

RelativeURL

Required

System.String

Specifies the relative URL for the new managed path.

The type must be a valid partial URL such as site or sites/teams/.

HostHeader

Required

System.Management.Automation.SwitchParameter

If this parameter is provided, this managed path applies to all host header site collections .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Explicit

Optional

System.Management.Automation.SwitchParameter

Specifies whether the managed path is explicit or wildcard.

If not provided, the managed path is a wildcard path.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPManagedPath cmdlet adds a new managed path to a given Web application or for use with all host header site collections. If the HostHeader switch is provided, the managed path is shared among all host header site collections; otherwise, a Web application must be specified to create this managed path within. The relative URL should be just the partial URL representing the managed path and giving only the slash mark (/) defines the root. If the Explicit parameter is not provided, the new managed path is a wildcard path.

Input Types

Return Types

Microsoft.SharePoint.Administration.SPPrefix

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
New-SPManagedPath "Teams" -WebApplication "http://somesite"

This example creates a Teams managed path for a given Web application (http://somesite).

See Also

Reference

Get-SPManagedPath
Remove-SPManagedPath

Click here to submit feedback on this topic.


New-SPServiceApplicationProxyGroup
Example
[image]

Creates a new service application proxy group.

New-SPServiceApplicationProxyGroup -Name <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Name

Required

System.String

Specifies the name of the new service application proxy group.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPServiceApplicationProxyGroup cmdlet creates a new service application proxy group specified by the Name parameter.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
New-SPServiceApplicationProxyGroup -Name RemoteProxyGroup

This example creates a new service application proxy with the name RemoteProxyGroup.


New-SPSite
Example
[image]

Creates a new site collection at the specified URL.

New-SPSite -Url <String> -OwnerAlias <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-ContentDatabase <SPContentDatabasePipeBind>] [-Description <String>] [-HostHeaderWebApplication <SPWebApplicationPipeBind>] [-Language <UInt32>] [-Name <String>] [-OwnerEmail <String>] [-QuotaTemplate <SPQuotaTemplatePipeBind>] [-SecondaryEmail <String>] [-SecondaryOwnerAlias <String>] [-SiteSubscription <SPSiteSubscriptionPipeBind>] [-Template <SPWebTemplatePipeBind>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Url

Required

System.String

Specifies the URL that the new site collection uses. If this is not a host header site, the URL must start with the containing the Web application URL .

OwnerAlias

Required

System.String

Specifies the user login name of the site owner.

The type must be a valid user alias, in the form Domain\username.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

ContentDatabase

Optional

Microsoft.SharePoint.PowerShell.SPContentDatabasePipeBind

Specifies the name or GUID of the content database in which to create the new site. If no content database is specified, the site collection is selected automatically.

The type must be a valid database name, in the form SiteContent1212, or a GUID, in the form 1234-5678-9807.

Description

Optional

System.String

Describes the new site. If no value is specified, the value is left blank.

HostHeaderWebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies that if the URL provided is a host header, this must be the name, URL, GUID, or SPWebApplication object for the Web application in which this site collection is created. If no value is specified, the value is left blank.

The type must be a valid name, in the form WebApplication-1212; a URL (for example, http://server_name); or a GUID (for example, 1234-5678-9876-0987).

Language

Optional

System.Int32

Specifies the language ID for the new site collection. If no language is specified, the site collection is created with the same language that was specified when the product was installed.

This must be a valid language identifier ( LCID ).

Name

Optional

System.String

Specifies the t itle of the new site collection. If no name is specified, the default name is applied.

OwnerEmail

Optional

System.String

Specifies the e-mail address of site owner. If no value is specified, the value is left blank.

The type must be a valid e-mail address in the form, someone@example.com.

QuotaTemplate

Optional

Microsoft.SharePoint.PowerShell.SPQuotaTemplatePipeBind

Specifies the quota template for the new site. The template must exist already. If no template is specified, no quota is applied.

SecondaryEmail

Optional

System.String

Specifies the e-mail address of the secondary site owner. If no value is specified, the value is left blank.

The type must be a valid e-mail address, in the form someone@example.com.

SecondaryOwnerAlias

Optional

System.String

Specifies the user login credentials of the secondary site owner. If no value is specified, the value is left blank.

The type must be a valid user alias, in the form Domain\username.

Template

Optional

Microsoft.SharePoint.PowerShell.SPWebTemplatePipeBind

Specifies the Web template for the root Web of the new site collection. The template must be already installed. If no template is specified, no template is provisioned.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPSite cmdlet creates a new site collection with the URL and owner specified by the Url and OwnerAlias parameters.

Input Types

Return Types

Microsoft.SharePoint.SPSite

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
New-SPSite http://localhost/sites/test -OwnerAlias "DOMAIN\JDoe" -Language 1033

This example creates an English site collection at http://localhost/sites/test that is owned by user DOMAIN\Jdoe.

------------------EXAMPLE 2-----------------------
Copy Code
$w = Get-SPWebApplication http://localhost
Copy Code
New-SPSite http://www.contoso.com -OwnerAlias "DOMAIN\jdoe" -HostHeaderWebApplication $w -Title "Contoso" -Template "STS#0"

This example creates a host header site collection. Because the template is provided, the root Web of this site collection will be created.

------------------EXAMPLE 3-----------------------
Copy Code
Get-SPWebTemplate | Where{ $_.Title -eq "Team Site" } | ForEach-Object{ New-SPSite http://localhost/sites/test -OwnerAlias DOMAIN\jdoe -Template $_ }

This example creates a site collection by using the "Team Site" Web template.


New-SPSiteSubscription
Example
[image]

Creates a new site subscription.

New-SPSiteSubscription [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The New-SPSiteSubscription cmdlet creates a new subscription to which SPSites can belong. Sites that are members of a site subscription can share settings and configuration information. A site collection can be a member of only one site subscription and, once set, cannot be changed.

Site subscriptions are not persisted in a database until used in conjunction with either an SPSite or the Site Subscription Settings Service. After a site subscription is applied to any site collection in the farm, the site subscription can be retrieved by using the Get-SPSiteSubscription cmdlet.

Input Types

Return Types

Microsoft.SharePoint.SPSiteSubscription

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
New-SPSiteSubscription |%{ New-SPSite http://contoso.com/sites/admin -SiteSubscription $_ -Template "TenantAdmin#0"}
Copy Code

This example creates a new site subscription and applies it to a new Tenant Administration site collection.

------------------EXAMPLE 2-----------------------

    Copy Code
$s = New-SPSiteSubscription

    Copy Code
Get-SPSite http://sitename | Set-SPSite -SiteSubscription $s

    Copy Code
Set-SPSite http://sitename -SiteSubscription {New-SPSiteSubscription}

This example adds a new subscription to an existing site collection at http://sitename.

            Click here to

      submit feedback
             on this topic.


New-SPSubscriptionSettingsServiceApplicationProxy
Example
[image]

Creates an application proxy to a subscription settings service application.

New-SPSubscriptionSettingsServiceApplicationProxy -Uri <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]
New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication <SPServiceApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Uri

Required

System.String

Specifies the address of the subscription settings service application to associate the new application proxy with.

The type must be a valid URI, in the form file:\\server_name\sitedocs.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

ServiceApplication

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the subscription settings service application associated with the new proxy.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a subscription settings service application (for example, SubscriptionSettingsApp1); or an instance of a valid SPServiceApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the New-SPSubscriptionSettingsServiceApplicationProxy cmdlet to create an applicationproxy to a subscription settings service application. This is required for the local farm to consume a subscription settings service application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------------EXAMPLE---------------------------
Copy Code
$AppPool = New-SPIisWebServiceApplicationPool -Name SettingsServiceAppPool -Account (Get-SPManagedAccount DOMAIN\jdoe)
Copy Code
$App = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPool -Name SettingsServiceApp -DatabaseName SettingsServiceDB
Copy Code
$proxy = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $App
Copy Code
Get-SPServiceInstance | where{$_.TypeName -eq "Windows SharePoint Services Subscription Settings Service"} | Start-SPServiceInstance

This example creates an application pool, a new settings service application, a settings service application proxy, and then starts the service instance on the local machine. This example assumes that a managed account for DOMAIN\jdoe already exists.


New-SPUsageApplication
Example
[image]

Creates a new usage application.

New-SPUsageApplication [-Name <String>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DatabaseName <String>] [-DatabasePassword <SecureString>] [-DatabaseServer <String>] [-DatabaseUsername <String>] [-UsageService <SPUsageServicePipeBind>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Name

Optional

System.String

Specifies the friendly name of the new usage application.

The type must be a valid name of a usage application; for example, UsageApplication1.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DatabaseName

Optional

System.String

Specifies the name of the logging database.

The type must be a valid name of a SQL Server database; for example, UsageLogDB1.

DatabasePassword

Optional

System.Security.SecureString

Specifies the password for the user specified in DatabaseUserName . Use this parameter only if SQL authentication is used to access the logging database.

The type must be a valid password.

DatabaseServer

Optional

Microsoft.SharePoint.PowerShell.SPServerPipeBind

Specifies the SPServer object where the logging database is created.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; the IP address of a server computer, in the form 208.77.188.166; a valid name of a SQL Server host service (for example, SQLServerHost1); or an instance of a valid SPServer object.

DatabaseUsername

Optional

System.String

Specifies the user name to use for connecting to the logging database. Use this parameter only if SQL authentication is used to access the logging database.

The type must be a valid user name; for example, UserName1.

UsageService

Optional

Microsoft.SharePoint.PowerShell.SPUsageServicePipeBind

Filters to return the usage application with the specified parent SPUsageService object.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a usage service (for example, UsageService1); or an instance of a valid SPUsageService object.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPUsageApplication cmdlet creates a new usage application in the local farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


New-SPUsageLogFile
Example
[image]

Starts a new usage log file on the current server computer.

New-SPUsageLogFile [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The New-SPUsageLogFile cmdlet starts a new usage log file on the current server computer. The usage data in memory is flushed to the current usage log file before the new log file is created.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


New-SPUser
Example
[image]

Adds an existing user to a <token for SharePoint 14> site with the designated permissions.

New-SPUser -UserAlias <String> -Web <SPWebPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DisplayName <String>] [-Email <String>] [-Group <SPGroupPipeBind>] [-MobileNumber <String>] [-PermissionLevel <String[]>] [-SiteCollectionAdmin <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

UserAlias

Required

System.String

Web

Required

Microsoft.SharePoint.PowerShell.SPWebPipeBind

Specifies the URL or GUID of the Web on which to create this user.

The type must be a valid URL, in the form http://server_name, or a GUID, in the form 1234-5678-9876-0987.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DisplayName

Optional

System.String

Specifies a string that contains the display name of the user.

The type must be a valid user name; for example, Joe.

Email

Optional

System.String

Specifies the e-mail address of the new user.

The type must be a valid e-mail address, in the form someone@example.com.

UserGroup

Optional

Microsoft.SharePoint.PowerShell.SPGroupPipeBind

Specifies the user group to which the new user belongs.

MobileNumber

Optional

System.String

Specifies the user e-mail address of the new user.

The type must be a valid e-mail address, in the form someone@example.com.

PermissionLevel

Optional

System.String[]

Adds a user to a permission policy level.

The type must be a valid permission policy level for the user; for example, Full , Read , Contribute , or All .

SiteCollectionAdmin

Optional

System.Management.Automation.SwitchParameter

Specifies whether to add the user as an administrator to the site collection.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPUser cmdlet adds an existing user to a <token for SharePoint 14> Web with the designated permissions. This user has the given permissions in all subsites that inherit permissions. The user account must already exist in the user directory.

If your environment is in Active Directory mode, the user must already exist in Active Directory and only the UserAlias parameter is required; all other fields are pulled from Active Directory. If only an alias is given and the farm is in Active Directory Account Create Mode, the Email parameter is also required.

Input Types

Return Types

Microsoft.SharePoint.SPUser

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1----------------------
Copy Code
PS> New-SPUser - UserAlias 'Contoso\Jdoe'-displayname 'John Doe' -web http://contoso.com

This example adds a new user named John Doe to the Contoso domain.

------------------EXAMPLE 2----------------------
Copy Code
Get-SPWeb http://sitename | New-SPUser -UserAlias Contoso\Jdoe

This example adds Contoso\Jdoe to all Webs in the http://sitename site collection. Because this site collection uses inherited permissions, only the top-level Web site needs to be touched.


New-SPWeb
Example
[image]

Creates a new site in any existing site collection.

New-SPWeb -Url <String> [-AddToQuickLaunch <SwitchParameter>] [-AddToTopNav <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Description <String>] [-Language <UInt32>] [-Name <String>] [-Template <SPWebTemplatePipeBind>] [-UniquePermissions <SwitchParameter>] [-UseParentTopNav <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Url

Required

System.String

Specifies the URL where the new site is to be created. The URL must be inside an existing site collection. The URL must be a valid URL, in the form http://server_name/site1.

Language

Optional

System.UInt32

Specifies the language template identifier for the new site. If no language is specified, the site is created with the same language that was specified when the product was installed.

The type must be a valid language identifier ( LCID ).

Template

Optional

SPWebTemplatePipeBind

Specifies the Web template for the new site. The template must already exist. If no template is specified, no template is applied and a template can be selected later.

Name

Optional

System.String

Specifies the title of the new site. If no title is specified, the default title is applied. The default title is configured for each template.

Description

Optional

System.String

Describes the new site. If no description is specified, the entry is left blank.

AddToQuickLaunch

Optional

System.Management.Automation.SwitchParameter

Adds this site to the Quick Launch.

UniquePermissions

Optional

System.Management.Automation.SwitchParameter

Specifies that this site is to be created with unique permissions.

AddToTopNav

Optional

System.Management.Automation.SwitchParameter

Adds this site to the top-level navigation bar .

UseParentTopNav

Optional

System.Management.Automation.SwitchParameter

Specifies that the same top-level navigation bar as the parent site is to be used for this site.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPWeb cmdlet creates a new site in the existing site collection specified by the Url parameter. You can create a site with a specific default language by specifying the Language parameter. If no language is specified, the site is created with the same language that was specified when the product was installed. You can create a site from a specific template by specifying the Template parameter. If no template is specified, the site is created and the template can be provided later or by the first user to log on.

Input Types

none

Return Types

Microsoft.SharePoint.SPWeb

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
New-SPWeb http://somesite/subweb1 -Template "STS#0"

This example creates a new subsite by using the "Team Site" template at the provided URL (http://somesite/subweb1).


New-SPWebApplication
Example
[image]

Creates a new Web application within the local farm.

New-SPWebApplication -Name <String> [-AllowAnonymousAccess <SwitchParameter>] [-ApplicationPool <String>] [-ApplicationPoolAccount <SPProcessAccountPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-AuthenticationMethod <String>] [-Confirm [<SwitchParameter>]] [-DatabaseCredentials <PSCredential>] [-DatabaseName <String>] [-DatabaseServer <String>] [-HostHeader <String>] [-IdentityProvider <SPIdentityProviderPipeBind[]>] [-Path <String>] [-Port <UInt32>] [-SecureSocketsLayer <SwitchParameter>] [-Url <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

ApplicationPool

Required

System.String

Specifies the name of an application pool to use ; for example, SharePoint - 1213. If an application pool with the name provided does not exist, the ApplicationPoolAccount parameter must be provided and a new one is created. If no value is specified the default application pool will be used .

Name

Required

System.String

Specifies the name of the new Web application.

AllowAnonymousAccess

Optional

System.Management.Automation.SwitchParameter

Allow anonymous access to the Web application.

ApplicationPoolAccount

Optional

Microsoft.SharePoint.PowerShell.SPProcessAccountPipeBind

Specifies the user account that this application pool will run as. Use the Get-SPApplicationPool cmdlet to use a system account .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

AuthenticationMethod

Optional

System.String

Uses Kerberos or NTLM to specify the authentication method. If no value is specified, the default NTLM is applied.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DatabaseCredentials

Optional

System.Management.Automation.PSCredential

Specifies the PowerShell Credential object for the database user account.

DatabaseName

Optional

System.String

Specifies the name of the initial content database for the new Web application. The type must be a valid database name; for example, ContentDB1. If no value is specified, a value in the format WSS_Content_<GUID> is auto-generated.

DatabaseServer

Optional

System.String

Specifies the database server name. The type must be a valid database server name, in the form SQL1, where named instances are used; the format can appear as server\server. The default SQL server is used if a value not provided.

HostHeader

Optional

System.String

Specifies a valid URL assigned to the Web application by that must correlate to the alternate access mapping configuration, in the form http://server_name.

When the HostHeader parameter is present, the value of this field is the internal URL for the Web application. The Url parameter is used to specify the public URL. If no value is specified, the value is left blank.

Path

Optional

Directory

Specifies the physical directory for the new Web application (in the virtual directories folder). The value is a valid path, in the form C:\Inutepub\wwwroot\MyWebApplication. If no value is specified, the value %wwwroot%\wss\VirtualDirectories\<portnumber > is applied .

Port

Optional

Number

Specifies the port on which this Web application can be accessed. Can be any valid port number . If no port is specified, a nonconflicting port number is auto-generated.

Important:
If you specify a port number that has already been assigned, IIS does not start the new site until you change either the port number of the new site or the port number of the old site .

SecureSocketsLayer

Optional

System.Management.Automation.SwitchParameter

Enables SSL encryption for this Web application. If you choose to use Secure Sockets Layer you must add the certificate on each server by using the IIS administration tools. Until this is done, the Web application is inaccessible from this IIS Web site .

Url

Optional

System.String

Specifies the load-balanced URL for the Web application .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Creates a new Web application specified by the Name parameter. The user specified by the DatabaseCredentials parameter must be a member of the dbcreator fixed server role on the database server.

Input Types

Return Types

Microsoft.SharePoint.Administration.SPWebApplication

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
New-SPWebApplication -Name "Contoso Internet Site" -Port 80 -HostHeader "http://sharepoint.dmz.contoso.com" -URL "https://www.contoso.com" -ApplicationPool "ContosoAppPool" -ApplicationPoolAccount (Get-SPManagedAccount "DOMAIN\jdoe")

This example creates a new Web application by using an internal host header of sharepoint.dmz.contoso.com and a public URL of https://www.contoso.com.


New-SPWebApplicationExtension
Example
[image]

Creates a new zone instance for the Web application.

New-SPWebApplicationExtension -Identity <SPWebApplicationPipeBind> -Name <String> -Zone <String> [-AllowAnonymousAccess <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>] [-AuthenticationMethod <String>] [-Confirm [<SwitchParameter>]] [-HostHeader <String>] [-Path <String>] [-Port <UInt32>] [-SecureSocketsLayer <SwitchParameter>] [-Url <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the Web application to extend.

Name

Required

System.String

Specifies the name of the new IIS Web site in the Web application.

Zone

Required

System.String

Specifies one of the five zones with which the internal URL of this new extension is to be associated. This zone cannot already be in use. The type must be any one of the following values: Default, Intranet, Internet, Extranet, or Custom.

AllowAnonymousAccess

Optional

System.Management.Automation.SwitchParameter

Allows anonymous access to the Web application zone.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

AuthenticationMethod

Optional

String

Uses Kerberos or NTLM to specify the authentication method.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

HostHeader

Optional

System.String

Specifies a valid URL assigned to the Web application by that must correlate to the alternate access mapping configuration, in the form http://server_name.

When the HostHeader parameter is present, the value of this field is the internal URL for the Web application. The Url parameter is used to specify the public URL.

Path

Optional

System.String

Specifies the physical directory for the new Web site (in the virtual directories folder). The type is a valid path, in the form C:\Inutepub\wwwroot\MyWebApplication.

Port

Optional

System.UInt32

Specifies the application port. Can be any valid port number . If no port is specified, a nonconflicting port number is auto-generated.

Important:
If you specify a port number that is already assigned, IIS does not start the new site until you change either the port number of the new site or the port number of the old site.

SecureSocketsLayer

Optional

System.Management.Automation.SwitchParameter

Enables Secure Sockets Layer (SSL) encryption for this Web application. If you use SSL, you must add the certificate on each server using the IIS administration tools. Until this is done, the Web application is inaccessible from this IIS Web site.

Url

Optional

System.String

Specifies the load-balanced URL for the Web application zone .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPWebApplicationExtension cmdlet creates a new zone instance for the Web application. This is also known as extending a Web application and allows alternate permissions to be configured for the same content that is available in the existing Web application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Get-SPWebApplication http://sitename | New-SPWebApplicationExtension -Name "ExtranetSite" -SecureSocketsLayer -Zone "Extranet" -URL "http://extranet.sitename.com"

This example extends the given Web application at http://sitename to the Extranet zone for SSL use.


Publish-SPServiceApplication
Example
[image]

Shares the specified local service application outside the farm.

Publish-SPServiceApplication -Identity <SPServiceApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Description <String>] [-InfoLink <Uri>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the GUID of the service application to share outside the farm.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Description

Optional

System.String

Describes the service application to share outside the farm. If no value is specified, the value is left blank.

InfoLink

Optional

System.Uri

Specifies the link to more information about the service application to share outside the farm. If no link is specified, no link is made available.

The type must be a valid URL, in the form http://server_name/Site_Name/page_name.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Publish-SPServiceApplication cmdlet publishes the local service application, specified by the Identity parameter, outside the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Publish-SPServiceApplication 053c34be-d251-488c-8e94-644eae94da26 -Description "Connect to this TestServiceApplcation of you want to use FeatureA in your farm" -InfoLink http://testurl

This example publishes a service application to another farm.

The service application GUID is unique to every farm. You can run the Get-SPServiceApplication cmdlet to see the GUID of the service applications, and then use the result from the Get-SPServiceApplication cmdlet for other SPServiceApplication cmdelts (for example, Grant-SPServiceApplication).


Receive-SPSharedServiceApplicationInfo
Example
[image]

Configures this farm to receive service information from another farm.

Receive-SPSharedServiceApplicationInfo -FarmUrl <Uri> [-AssignmentCollection <SPAssignmentCollection>] [-Filter <String>]

Parameters

Parameter Required Type Description

FarmUrl

Required

System.Uri

Specifies the URL of the farm from which to receive service application information.

The type must be a valid URL, in the form http://server_name.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Filter

Optional

System.String

Detailed Description

The Receive-SPSharedServiceApplicationInfo cmdlet retrieves the list of service applications published by another farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Receive-SPSharedServiceApplicationInfo -FarmUrl http://FarmB/topology/topology.svc

This example retreives a list of service applications published by a given farm.

The FarmURL parameter can be obtained by the Get-SPTopologyWebServiceApplication cmdlet.


Remove-SPAlternateUrl
See Also Example
[image]

Completely deletes the specified alternate URL.

Remove-SPAlternateUrl -Identity <SPAlternateUrlPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter | Required | Type | Description
Identity | Required | Microsoft.SharePoint.PowerShell.SPAlternateUrlPipeBind | Specifies the identity of the alternate URL to delete. The identity can be either a valid URL, in the form http://server_name , or a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.
AssignmentCollection | Optional | Microsoft.SharePoint.PowerShell.SPAssignmentCollection |
Confirm | Optional | System.Management.Automation.SwitchParameter | Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters
WhatIf | Optional | System.Management.Automation.SwitchParameter | Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPAlternateUrl cmdlet completely deletes the alternate URL specified by the Identity parameter.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
Remove-SPAlternateURL -WebApplication http://localhost -Zone Extranet

This example deletes the extranet URL for the given Web application.

------------------EXAMPLE 2-----------------------
Copy Code
Get-SPWebApplication |%{ Get-SPAlternateURL -WebApplication $_ -Zone "Extranet" } | Remove-SPAlternateURL

This example removes all extranet alternate URLs in the farm.

See Also

Reference

New-SPAlternateUrl
Get-SPAlternateURL
Set-SPAlternateUrl

Click here to submit feedback on this topic.


Remove-SPConfigurationDatabase
See Also Example
[image]

Permanently removes a configuration database.

Remove-SPConfigurationDatabase [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPConfigurationDatabase cmdlet permanently removes the farm's configuration database. The configuration database must be already dismounted from any associated farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Remove-SPConfigurationDatabase

This example permanently deletes a configuration database from a farm.

See Also

Dismount-SPConfigurationDatabase

Reference

Backup-SPConfigurationDatabase
Disconnect-SPConfigurationDatabase
Connect-SPConfigurationDatabase
New-SPConfigurationDatabase

Click here to submit feedback on this topic.


Remove-SPServiceApplicationPool
Example
[image]

Completely deletes the specified Web service application pool.

Remove-SPIisWebServiceApplicationPool -Identity <SPIisWebServiceApplicationPoolPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPIisWebServiceApplicationPoolPipeBind

Specifies the identity of the Web service application pool to delete.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPIisWebServiceApplicationPool cmdlet completely deletes the specified Web service application pool.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Remove-SPIisWebServiceApplicationPool TestServiceWebApplicationPool

This example deletes the selected service application pool.


Remove-SPManagedAccount
Example
[image]

Removes a managed account from the farm.

Remove-SPManagedAccount -Identity <SPManagedAccountPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPManagedAccountPipeBind

Specifies the full name or partial name of the managed accounts to retrieve.

The type must be a valid account name, in the form Domain\User, or a GUID, in the form 1234-3456-09876.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPManagedAccount cmdlet removes account registration from the configuration database.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Remove-SPManagedPath
Example
[image]

Deletes the specified managed path from the specified host header or Web application.

Remove-SPManagedPath -Identity <SPPrefixPipeBind> -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Remove-SPManagedPath -Identity <SPPrefixPipeBind> -HostHeader <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPPrefixPipeBind

Specifies the name of the managed path to delete. For example, in the URL http://localhost/sites/site1, sites is the name of the managed path.

WebApplication

Required

Microsoft.SharePoint.PowerShell.WebApplicationPipeBind

Specifies the identity of the Web application that hosts the managed path to delete. The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid Web application name (for example, WebApplication1212); or a valid name, in the form WebApp2423.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPPrefixPipeBind

Specifies the name of the managed path to delete. For example, in the URL http://localhost/sites/site1, sites is the name of the managed path.

HostHeader

Required

System.Management.Automation.SwitchParameter

Specifies that the Identity is a host header managed path.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPManagedPath cmdlet deletes the managed path specified by the Identity parameter from the host header or the Web application. The Identity must be the partial URL of the managed path to be deleted.

If you are using host headers, specify the HostHeader parameter. To delete a HostHeader managed path, provide the HostHeader switch. Otherwise, you must specify the WebApplication that contains the managed path to be deleted.

Input Types

SPPrefixPipeBind

Return Types

none

Errors

Error | Description

Exceptions

Exceptions | Description

Example

----------------------EXAMPLE 1----------------------------
Copy Code
Remove-SPManagedPath "sites" -HostHeader

This example removes the sites managed path from the list of HostHeader managed paths.

Depending on the confirmation level of the local system, the preceding example can prompt prior to execution.

------------------EXAMPLE 2-----------------------
Copy Code
Get-SPWebApplication | Remove-SPManagedPath "personal" -confirm:$false

This example removes the personal managed path from all Web applications in the farm. This command does not prompt for confirmation.


Remove-SPServiceApplication
Example
[image]

Deletes the specified service application on the local server.

Remove-SPServiceApplication -Identity <SPServiceApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-RemoveData <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the GUID of the service application to remove.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

RemoveData

Optional

SwitchParameter

Deletes all databases and other data associated with the service application.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPServiceApplication cmdlet deletes the specified service application from the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------------EXAMPLE---------------------------
Copy Code
Remove-SPServiceApplication 053c34be-d251-488c-8e94-644eae94da26
-removedata

This example deletes the service application and its database.

The service application GUID is unique to every farm. You can run the Get-SPServiceApplication cmdlet to see the GUID of the service applications, and then use the result from the Get-SPServiceApplication cmdlet for other SPServiceApplication cmdelts (for example, Grant-SPServiceApplication or Publish-SPServiceApplication).


Remove-SPServiceApplicationProxy
Example
[image]

Deletes the specified service application proxy.

Remove-SPServiceApplicationProxy -Identity <SPServiceApplicationProxyPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-RemoveData <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationProxyPipeBind

Specifies the GUID of the service application proxy to remove.

The type must be a GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.

RemoveData

Optional

System.Management.Automation.SwitchParameter

Deletes all databases and other data associated with the service application proxy.

AssignmentColletion

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentColletion

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPServiceApplicationProxy cmdlet deletes the service application proxy specified by the Identity parameter.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Remove-SPServiceApplicationProxy babab30e-8e3a-428b-8ff4-4d5c8f455e6d

This example deletes the given service application proxy.

The service application GUID is unique to every farm. You can run the Get-SPServiceApplication cmdlet to see the GUID of the service applications, and then use the result from the Get-SPServiceApplication cmdlet for other SPServiceApplication cmdelts (for example, Grant-SPServiceApplication or Publish-SPServiceApplication).


Remove-SPServiceApplicationProxyGroup
Example
[image]

Completely deletes the specified service application proxy group.

Remove-SPServiceApplicationProxyGroup -Identity <SPServiceApplicationProxyGroupPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationProxyGroupPipeBind

The identity of the service application proxy group to delete.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Completely deletes the specified service application proxy group.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------------EXAMPLE-------------------------
Copy Code
Remove-SPServiceApplicationProxyGroup RemoteProxyGroup

This example deletes the service application proxy group named RemoteProxyGroup.

The service application proxy group GUID is unique to every farm. You can run Get-SPServiceApplicationProxyGroup | Select Name,Id to see the GUID of the service application proxy groups. Use this result for any other SPServiceApplicationProxyGroup cmdlets.


Remove-SPServiceApplicationProxyGroupMember
Example
[image]

Removes one or more proxies from the specified service application proxy group.

Remove-SPServiceApplicationProxyGroupMember -Identity <SPServiceApplicationProxyGroupPipeBind> -Member <SPServiceApplicationProxyPipeBind[]> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationProxyGroupPipeBind

Specifies the identity of the service application proxy group from which to remove the member or members.

Member

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationProxyPipeBind[]

Specifies the member or members to remove from the service application proxy group.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPServiceApplicationProxyGroupMember cmdlet removes one or more proxies from the specified service application proxy group.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Remove-SPServiceApplicationProxyGroupMember RemoteProxyGroup -Member babab30e-8e3a-428b-8ff4-4d5c8f455e6d

This example removes a service application proxy from the selected service application proxy group named RemoteProxyGroup.

The service application proxy group GUID is unique to every farm. You can run Get-SPServiceApplicationProxyGroup | Select Name,Id to see the GUID of the service application proxy groups. Use this result for any other SPServiceApplicationProxyGroup cmdlets.


Remove-SPSite
Example
[image]

Completely deletes an existing site collection and all subsites.

Remove-SPSite -Identity <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DeleteADAccounts <SwitchParameter>] [-GradualDelete <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Specifies the identity of the site to delete. The identity can be either a valid URL, in the form http://server_name; a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or an SPSite object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DeleteADAccounts

Optional

System.Management.Automation.SwitchParameter

Forces deletion of user accounts from Active Directory. This applies when in Active Directory account creation mode and the value of this parameter is True , THIS_SKU also deletes Active Directory accounts associated with the site collection from Active Directory .

GradualDelete

Optional

System.Management.Automation.SwitchParameter

If provided, occurs gradually to use less system load. This operation is strongly recommended for deleting very large sites.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPSite cmdlet completely deletes an existing site collection and all subsites. This operation cannot be undone.

Input Types

Return Types

none

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Remove-SPSite -identity "http://sitename" -GradualDelete -Confirm:$False

This example removes the given site collection and all included sites by using GradualDelete; confirmation has been suppressed.


Remove-SPSiteSubscription
Example
[image]

Removes data stored in a subscription settings service application for a set of site subscriptions.

Remove-SPSiteSubscription -Identity <SPSiteSubscriptionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Yes

Specifies the name of the site subscription to remove.

Specifies the site subscription settings service application that contains the service data to delete.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a subscription settings service application (for example, SubscriptionSettingsApp1); or an instance of a valid SPSubscriptionSettingsServiceApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

No

System.Management.Automation.SwitchParameter

Forces the removal of a site subscription and is the only way to stop this command from prompting for confirmation.

The type must be either of the following values:

  • True

  • False

The default value is False .

WhatIf

Optional

System.Management.Automation.SwitchParameter

PShell_param_WhatIf

Detailed Description

The Remove-SPSiteSubscription cmdlet removes a site subscription along with all contained site collections and settings.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Remove-SPSiteSubscription "http://contoso.com"

This example removes all data for the contoso.com site subscription (site collections, site subscription, and settings).


Remove-SPUsageApplication
Example
[image]

Removes a usage application from the local farm.

Remove-SPUsageApplication -Identity <SPUsageApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-RemoveData <SwitchParameter>] [-UsageService <SPUsageServicePipeBind>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPUsageApplicationPipeBind

Specifies the usage application to delete.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a usage application (for example, UsageApplication1); or an instance of a valid SPUsageApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

RemoveData

Optional

System.Management.Automation.SwitchParameter

Specifies that the logging database is also removed.

UsageService

Optional

Microsoft.SharePoint.PowerShell.SPUsageServicePipeBind

Specifies the SPUsageService object that is the parent of the usage application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a usage service (for example, UsageService1); or an instance of a valid SPUsageService object.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPUsageApplication cmdlet deletes a usage application from the local farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Remove-SPUser
Example
[image]

Removes a user from a Web site.

Remove-SPUser -Identity <SPUserPipeBind> -Web <SPWebPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Group <SPGroupPipeBind>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPUserPipeBind

Specifies the GUID, the user name, or SPUser object to remove.

The type must be a valid GUID of the user, in the form 1234-5678-9876-0987.

Web

Required

Microsoft.SharePoint.PowerShell.SPWebPipeBind

Specifies the name of the URL or GUID from which the user is to be removed. This parameter is needed only if the identity provided is the user name.

The type must be a valid URL, in the form http://server_name, or a GUID, in the form 1234-5678-9807.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Group

Optional

Microsoft.SharePoint.PowerShell.SPGroupPipeBind

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPUser cmdlet specifies the identity and user group from which a user is to be removed. The Remove-SPUser cmdlet does not remove the user from Active Directory.

Input Types

Return Types

none

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
Remove-SPUser "Contoso \jdoe" -web http://test/web1
Copy Code
Get-SPWeb "http://test/web1" | Remove-SPUser "Contoso\jdoe"

This example removes the user (Contoso\jdoe) from the Web application http://test/web1.

------------------EXAMPLE 2-----------------------
Copy Code
Get-SPSite http://contoso.com |Get-SPWeb |Remove-SPUser "Contoso\jdoe"

This syntax removes the user (Contoso\Jdoe) from every Web in a site collection located at http://contoso.com.


Remove-SPWeb
Example
[image]

Completely deletes the specified Web.

Remove-SPWeb -Identity <SPWebPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebPipeBind

Specifies the identity of the Web to delete.

The type must be a valid full URL, in the form http://server_name/site_name, or an SPWeb object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPWeb cmdlet completely deletes the Web specified by the Identity parameter.

Important:
Deleting the top level Web site of a site collection causes the entire site collection to be removed.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Remove-SPWeb http://sitename/subsite

The following example completely deletes a subsite.


Remove-SPWebApplication
Example
[image]

Deletes the specified Web application.

Remove-SPWebApplication -Identity <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DeleteIISSite <SwitchParameter>] [-RemoveContentDatabases <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Remove-SPWebApplication -Identity <SPWebApplicationPipeBind> -Zone <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DeleteIISSite <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the URL or name of the Web application to delete.

The type must be a valid URL, in the form http://server_name, or a valid name, in the form WebApplication-1212.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DeleteIISSite

Optional

System.Management.Automation.SwitchParameter

Deletes the associated IIS Web sites. If this parameter is not provided, the IIS site is not removed.

RemoveContentDatabases

Optional

System.Management.Automation.SwitchParameter

Permanently deletes all associated content databases. If this parameter is not provided, no content databases are removed.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the URL or name of the Web application to delete.

The type must be a valid URL, in the form http://server_name, or a valid name, in the form WebApplication-1212.

Zone

Required

System.String

Specifies o ne of the five zones to be removed. If this parameter is not provided, all Web application zones are removed.

The type must be any one of the following values: Default , Intranet , Internet , Extranet , or Custom .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DeleteIISSite

Optional

System.Management.Automation.SwitchParameter

Deletes the associated IIS Web sites. If this parameter is not provided, the IIS site is not removed.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPWebApplication cmdlet deletes the Web application specified by the Identity and Zone parameters. If no zone is provided, the entire Web application and all zones are removed.

Input Types

Return Types

none

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
Get-SPWebApplication http://sitename | Remove-SPWebApplication -Zone "Internet" -Confirm

This example prompts and then removes the Internet zone Web application extension on the Web application at http://sitename. This command does not remove the content databases or the IIS Web site.

------------------EXAMPLE 2-----------------------
Copy Code
Remove-SPWebApplication http://sitename -Confirm -DeleteIISSite -RemoveContentDatabases

This example permanently removes the Web application, all content databases, and the IIS Web site at http://sitename


Rename-SPServer
Example
[image]

Renames a server that is currently connected to the farm.

Rename-SPServer -Identity <SPServerPipeBind> -Name <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServerPipeBind

Specifies the original name of the server.

The type must be a URL, in the form http://server_name, or a GUID, in the form 1234-4567-987gb.

Name

Required

System.String

Specifies the new name of the server.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Rename-SPServer cmdlet changes the name of the server for internal use within SharePoint. The server itself must be manually renamed.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Restore-SPFarm
Example
[image]

This is the introduction.

Restore-SPFarm -Directory <String> -RestoreMethod <String> [-AssignmentCollection <SPAssignmentCollection>] [-BackupId <Guid>] [-ConfigurationOnly <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-FarmCredentials <PSCredential>] [-Force <SwitchParameter>] [-Item <String>] [-NewDatabaseServer <String>] [-Percentage <Int32>] [-PreserveChangeLog <SwitchParameter>] [-RestoreThreads <Int32>] [-WhatIf [<SwitchParameter>]]
Restore-SPFarm -Directory <String> -ShowTree <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>] [-BackupId <Guid>] [-ConfigurationOnly <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Item <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Directory

Optional

Specifies the path where < token of SharePoint 14 > stores the backup package it generates. If you have a computer on which < token of SQL Server 2006 > and an instance of < token of SharePoint 14 > are installed, you can use local drive paths. This includes a basic installation. However, if < token of SQL Server 2006 > and < token of SharePoint 14 > are installed on multiple computers, you must use Universal Naming Convention (UNC) share paths so that the SQL database and search components are written to the same location (for example, \\ computer_name \volume\Backup).

The type must be either of the valid paths:

  • C:\ folder_name

  • \\ server_name \ folder_name

Note:
The spbr* folders are created automatically.

RestoreMethod

Optional

System.String

Specifies the restore method of the backup file. The values are overwrite or new. The overwrite value restores the content and settings to their original location. If the overwrite value is used, a confirmation prompt is displayed.

Specifies a new location to restore the content; for example, a new database server.

The type must be either of the following:

  • Overwrite

  • New

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

BackupId

Optional

System.Guid

Specifies the GUID of the backup package that is to be restored. Each backup package has a unique GUID associated with it. It can be seen by using the stsadm -o backuphistory operation to view the backup history. If this parameter is absent, the most recent full backup package is used.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890abcdef.

ConfigurationOnly

Optional

System.Management.Automation.SwitchParameter

Permits custom settings to be backed up.

FarmCredentials

Optional

System.Management.Automation.PSCredential

Force

Optional

System.Management.Automation.SwitchParameter

Forces a backup operation.

Item

Optional

System.String

Indicates the part of the farm that is to be backed up. You can use the full farm path notation as displayed by the ShowTree parameter or the name of the target component in the path if it has a unique name. If there are multiple items within the same match, the full path must be provided. By default, the top node is selected. Surround the item or path in double quotation marks if it contains a space. If this parameter is absent, the entire farm is backed up.

The type must be a valid item, such as:

Web Application\SharePoint-80

NewDatabaseServer

Optional

System.String

Percentage

Optional

System.Int32

Requests that progress updates about the restore operation be displayed in increments of that percentage. For example, a value of 5 displays restore progress updates at 5 percent completed, and a value of 10 displays restore progress updates at 10 percent completed.

Note:
This percentage is not precise and the actual progress updates might be lower or higher than requested.

For a very large database, 1 is the optimal value to use to see some updates displayed.

The default value is 5.

The type must be an integer value between 1 and 100.

The default value is 5.

PreserveChangeLog

Optional

System.Management.Automation.SwitchParameter

Preserves the change log so that the next crawl of this content database is not a full crawl.

RestoreThreads

Optional

System.Int32

Restores threads.

The type must be a valid number between ? and ??

Parameter Set 2

Parameter

Required

Type

Description

Directory

Optional

Specifies the path where < token of SharePoint 14 > stores the backup package it generates. If you have a computer on which < token of SQL Server 2006 > and an instance of < token of SharePoint 14 > are installed, you can use local drive paths. This includes a basic installation. However, if < token of SQL Server 2006 > and < token of SharePoint 14 > are installed on multiple computers, you must use Universal Naming Convention (UNC) share paths so that the SQL database and search components are written to the same location (for example, \\ computer_name \volume\Backup).

The type must be either of the valid paths:

  • C:\ folder_name

  • \\ server_name \ folder_name

Note:
The spbr* folders are created automatically.

ShowTree

Optional

System.Management.Automation.SwitchParameter

Displays the objects in the farm that are to be backed up, based on the other parameters passed to the Backup operation, namely the Item parameter. Items thatare to be excluded from the backup, based on the other parameters passed to the Backup operation, are preceded with an asterisk character (*). Items that cannot be backed up are enclosed in brackets ([ ]). A backup is not performed if the ShowTree parameter is present.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

BackupId

Optional

System.Guid

Specifies the GUID of the backup package that is to be restored. Each backup package has a unique GUID associated with it. It can be seen by using the stsadm -o backuphistory operation to view the backup history. If this parameter is absent, the most recent full backup package is used.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890abcdef.

ConfigurationOnly

Optional

System.Management.Automation.SwitchParameter

Permits custom settings to be backed up.

Item

Optional

System.String

Indicates the part of the farm that is to be backed up. You can use the full farm path notation as displayed by the ShowTree parameter or the name of the target component in the path if it has a unique name. If there are multiple items within the same match, the full path must be provided. By default, the top node is selected. Surround the item or path in double quotation marks if it contains a space. If this parameter is absent, the entire farm is backed up.

The type must be a valid item, such as:

Web Application\SharePoint-80

Detailed Description

Enter detail description

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Restore-SPSite
Example
[image]

Restores a site collection.

Restore-SPSite -Identity <String> -Path <String> [-AssignmentCollection <SPAssignmentCollection>] [-DatabaseName <String>] [-DatabaseServer <String>] [-Force <SwitchParameter>] [-GradualDelete <SwitchParameter>] [-HostHeader <String>]

Parameters

Parameter Required Type Description

Identity

Required

System.String

Specifies the name or GUID of the site collection to restore.

The type must be a valid URL, in the form http://server_name.

Path

Required

System.String

Specifies a valid path to the location of the backup . For example, C:\????

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

DatabaseName

Optional

System.String

Specifies the name of the SQL Server database to be used when any database is restored

The type must be a valid database name, in the form SQLDB1.

DatabaseServer

Optional

System.String

Specifies the name of the SQL Server database to be used when any database is restored.

The type must be a valid database server name, in the form SQLBE1.

Force

Optional

System.Management.Automation.SwitchParameter

Forces a backup operation .

GradualDelete

Optional

System.Management.Automation.SwitchParameter

HostHeader

Optional

valid URL assigned to the Web application by using Alternate Access Mapping (AAM), such as "http:// server_name "

Restores a site collection as a host-named site collection rather than a path-based site collection. When the HostHeader parameter is present, the value of the Identity parameter is the URL of the host-named site collection and value of the HostHeader parameter is the URL of the Web application that will hold the host-named site collection.

Detailed Description

The Restore-SPSite cmdlet performs a restoration of the site collection, when the Identity parameter is used.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Revoke-SPServiceApplication
Example
[image]

Revokes a user's access to a service application.

Revoke-SPServiceApplication -Identity <SPServiceApplicationPipeBind> -UserPrincipal <String> -Type <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the GUID of the service application to which to revoke access.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.

UserPrincipal

Required

System.String

Specifies the identity to revoke access to the service application.

The type must be a valid user principal name, in the form DOMAIN\user, or a claim, in the form CA:NTLM:Identity-username:domain\user.

Type

Required

System.String

Specifies the type of rights to revoke.

The type must be either Admin or Access .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Revoke-SPServiceApplication cmdlet revokes the specified user's access to the specified service application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Revoke-SPServiceAppliaion 053c34be-d251-488c-8e94-644eae94da26 -UserPrincipal testdomin\tester1 -Type Admin

This example revokes the administrative access given to the specified user for the selected service application.

The service application GUID is unique to every farm. You can run the Get-SPServiceApplication cmdlet to see the GUID of the service applications, and then use the result from the Get-SPServiceApplication cmdlet for other SPServiceApplication cmdelts (for example, Grant-SPServiceApplication or Publish-SPServiceApplication).


Set-SPAlternateUrl
See Also Example
[image]

Configures the specified alternate URL.

Set-SPAlternateUrl -Identity <SPAlternateUrlPipeBind> -Url <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]] [-Zone <String>]
Set-SPAlternateUrl -Identity <SPAlternateUrlPipeBind> -Zone <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Url <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPAlternateUrlPipeBind

Specifies the URL or GUID of the alternate URL to change.

The type must be a valid URL, in the form http://server_name/WebApplication/site, or a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.

Url

Required

System.String

Specifies the new alternate URL.

Zone

Required

System.String

Sets the supplied alternate URL as one of the five zones.

The type must be any one of the following values: Default , Intranet , Internet , Extranet , or Custom .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPAlternateUrlPipeBind

Specifies the URL or GUID of the alternate URL to change.

The type must be a valid URL, in the form http://server_name/WebApplication/site, or a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.

Url

Required

System.String

Specifies the new alternate URL.

Zone

Required

System.String

Sets the supplied alternate URL as one of the five zones.

The type must be any one of the following values: Default , Intranet , Internet , Extranet , or Custom .

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPAlternateUrl cmdlet changes the URL or zone of the alternate URL specified by the Identity parameter.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

  See Also
Reference
Get-SPAlternateURL
New-SPAlternateUrl
Remove-SPAlternateUrl

            Click here to

      submit feedback
             on this topic.


Set-SPDiagnosticConfig
Example
[image]

Sets diagnostic configuration settings on the farm.

Set-SPDiagnosticConfig [-AssignmentCollection <SPAssignmentCollection>] [-CustomerExperienceImprovementProgramEnabled <SwitchParameter>] [-DaysToKeepLogs <Int32>] [-DownloadErrorReportingUpdatesEnabled <SwitchParameter>] [-ErrorReportingAutomaticUploadEnabled <SwitchParameter>] [-ErrorReportingEnabled <SwitchParameter>] [-EventLogFloodProtectionEnabled <SwitchParameter>] [-InputObject <PSObject>] [-LogCutInterval <Int32>] [-LogDiskSpaceUsageGB <Int32>] [-LogLocation <String>] [-LogMaxDiskSpaceUsageEnabled <SwitchParameter>] [-ScriptErrorReportingDelay <Int32>] [-ScriptErrorReportingEnabled <SwitchParameter>] [-ScriptErrorReportingRequireAuth <SwitchParameter>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

CustomerExperienceImprovementProgramEnabled

Optional

System.Management.Automation.SwitchParameter

Specifies whether participation in the Customer Experience Improvement Program (CEIP) is enabled.

The CEIP is designed to improve the quality, reliability, and performance of Microsoft® products and technologies. With your permission, anonymous information about your server is sent to Microsoft to help improve SharePoint® Products and Technologies.

The type must be either of the following values:

  • $True

  • $False

The default value is $True .

DaysToKeepLogs

Optional

System.Int32

Specifies the number of days to keep trace log files. The type must be a valid number between 1 and 366 .

DownloadErrorReportingUpdatesEnabled

Optional

System.Management.Automation.SwitchParameter

Specifies whether the error reporting remote control file is downloaded.

Need additional information on this parameter .

The type must be either of the following values:

  • $True

  • $False

The default value is $True .

ErrorReportingAutomaticUploadEnabled

Optional

System.Management.Automation.SwitchParameter

Specifies whether error reports are uploaded to Microsoft automatically.

Error reports include the following: information regarding the condition of the server when a problem occurs; the operating system version and computer hardware in use; and the digital product ID, which can be used to identify your license. The IP address of your computer is also sent because you are connecting to an online service to send error reports; however, the IP address is used only to generate aggregate statistics.

The type must be either of the following values:

  • $True

  • $False

The default value is $True .

ErrorReportingEnabled

Optional

System.Management.Automation.SwitchParameter

Specifies whether collection of error reports is enabled.

Error reports are created when your system encounters hardware or software problems. Microsoft and its partners actively use these reports to improve the reliability of your software. Error reports include the following: information regarding the condition of the server when the problem occurs; the operating system version and computer hardware in use; and the digital product ID, which can be used to identify your license. The IP address of your computer is also sent because you are connecting to an online service to send error reports; however, the IP address is used only to generate aggregate statistics .

The type must be either of the following values:

  • $True

  • $False

The default value is $True .

EventLogFloodProtectionEnabled

Optional

System.Management.Automation.SwitchParameter

Specifies whether the Event log flood protection feature is enabled.

If multiple similar events are written to the event log, Microsoft SharePoint Foundation 2010 suppresses some duplicate messages, and then after a period of time a summary message is written that shows how many events were suppressed.

The type must be either of the following values:

  • $True

  • $False

The default value is $True .

InputObject

Optional

System.Management.Automation.PSObject

Specifies either a string or a category. You can get the result from the Get-SPDiagnosticConfig cmdlet, make modifications, and then pipeline the object into Set-SPDiagnosticConfig cmdlet to update the Windows SharePoint Services database.

LogCutInterval

Optional

System.Int32

Specifies a time period to roll over to the next log file.

The type must be a valid number between 0 and 1440.

LogDiskSpaceUsageGB

Optional

System.Int32

Specifies the maximum amount of storage to use for trace log files, in gigabytes (GB). The type must be a valid number between 1 and 1000.

LogLocation

Optional

System.String

Specifies the path of where to log files will reside.

The type must be a valid path, in the form C:\Logs.

LogMaxDiskSpaceUsageEnabled

Optional

System.Management.Automation.SwitchParameter

Specifies whether to restrict the maximum space to use for trace log files.

The type must be either of the following values:

  • $True

  • $False

The default value is $False .

ScriptErrorReportingDelay

No

System.Int32

Specifies the time (in minutes) between script error reports.

The type must be a valid integer between 0 and 1440. The value is specified in minutes.

For example, a value of 30 would represent 30 minutes .

ScriptErrorReportingEnabled

Optional

System.Management.Automation.SwitchParameter

Specifies whether error reporting is enabled for client script errors.

The type must be either of the following values:

  • Yes

  • No

The default value is Yes .

ScriptErrorReportingRequireAuth

Optional

System.Management.Automation.SwitchParameter

Specifies whether script error reporting requires authentication.

The type must be either of the following values:

  • Yes

  • No

The default value is Yes .

Detailed Description

The Set-SPDiagnosticConfig cmdlet sets diagnostic configuration settings on the entire farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Set-SPDiagnosticConfig -LogLocation C:\Temp

This example changes the log file location to C:\Temp.


Set-SPFarmConfig
Example
[image]

Sets a global property or a collection of global properties for the local farm.

Set-SPFarmConfig [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DataFormWebPartAutoRefreshEnabled <$true | $false>] [-Force <SwitchParameter>] [-InstalledProductsRefresh <SwitchParameter>] [-ServiceConnectionPointBindingInformation <String>] [-ServiceConnectionPointDelete <SwitchParameter>] [-WhatIf [<SwitchParameter>]] [-WorkflowBatchSize <Int32>] [-WorkflowEventDeliveryTimeout <Int32>] [-WorkflowPostponeThreshold <Int32>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DataFormWebPartAutoRefreshEnabled

Optional

System.Boolean

Force

Optional

System.Management.Automation.SwitchParameter

InstalledProductsRefresh

Optional

System.Management.Automation.SwitchParameter

ServiceConnectionPointBindingInformation

Optional

System.String

ServiceConnectionPointDelete

Optional

System.Management.Automation.SwitchParameter

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

WorkflowBatchSize

Optional

System.Int32

Specifies the paging size for events delivered to a single workflow instance. For each request, the events are streamed out 100 at a time.

Batch size is the number of events processed for a single workflow instance, which can have many events queued at the same time. Throttle will override batch size; if the workflow instance cannot be started or restarted because there are too many instances running across all front-end Web servers, none of the events will be fetched, regardless of the batch size.

WorkflowEventDeliveryTimeout

Optional

System.Int32

Specifies the time as an integer in which a workflow job must run without the job timing out. If the workflow job does time out, it gets put back in the queue to be run again.

For example, if the value is set to 5, the workflow job must run within 5 minutes are the workflow job will time out. Any workflow job that does time out is placed back in the queue to run again. The default value is 5.

WorkflowPostponeThreshold

Optional

System.Int32

Detailed Description

The Set-SPFarmConfig cmdlet updates a collection of global settings for the local farm that are not members of the SPFarm object. Use the Get-SPFarmConfig cmdlet to read global settings for the local farm and to create a new PSCustomObject object from the collection of properties returned from the local farm, and then add this object to the pipeline. Modify the PSCustomObject object and pass it to the Set-SPFarmConfig cmdlet to change the parameter values.

The properties collected in the PSCustomObject object must be farm-wide settings, and must be configurable only once for the entire farm. The parameter name added to the PSCustomObject object must match exactly the input parameter name for the Set-the SPFarmConfig cmdlet.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

---------------------EXAMPLE--------------------------
Copy Code
$a = Get-SPFarmConfig
PS> $a.AjaxTimeout = 200
PS> $a | Set-SPFarmConfig

This example uses the Get-SPFarmConfig cmdlet to add the Ajax Timeout setting to the PSCustomObject object, sets the value for Ajax Timeout, and then passes PSCustomObject to the Set-SPFarmConfig cmdlet to change the Ajax Timeout setting. Ajax Timeout, a farm-wide setting, is a member of the SPWebService object and cannot accessed with a PowerShell cmdlet.

You can perform the same operations with either of the following commands.

Copy Code
Set-SPFarmConfig -AjaxTimeout 200
Click here to submit feedback on this topic.


Set-SPIisWebServiceApplicationPool
Example
[image]

Changes the account used for the Identity of the specified application pool.

Set-SPIisWebServiceApplicationPool -Identity <SPIisWebServiceApplicationPoolPipeBind> [-Account <SPProcessAccountPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPIisWebServiceApplicationPoolPipeBind

Specifies the identity of the Web service application pool to configure.

Account

Optional

Microsoft.SharePoint.PowerShell.SPProcessAccountPipeBind

Specifies the credentials that will be the new Identity of the application pool.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPIisWebServiceApplicationPool cmdlet changes the account used for the Identity of the specified application pool.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Set-SPIisWebServiceApplicationPool  TestServiceWebApplicationPool -Account testdomain\testuser1

This example changes the identity of the selected service application pool.

For the Account parameter, the name of a managed account in the farm can be given. Use the Get-SPManagedAccount cmdlet to view the existing managed account in the farm. Also, a process account from the output of the Get-SPProcessAccount cmdlet can be used.


Set-SPLogLevel
Example
[image]

Sets trace logging and event logging levels to a category.

Set-SPLogLevel [-AssignmentCollection <SPAssignmentCollection>] [-EventSeverity <String>] [-Identity <String[]>] [-InputObject <PSObject>] [-TraceSeverity <String>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

EventSeverity

Optional

System.String

Identity

Optional

System.String[]

Specifies the category name to be set; for example, SPDiagnosticsService. If the Identity parameter is not specified, the event-throttling setting is applied to all categories in the farm.

InputObject

Optional

System.Management.Automation.PSObject

The InputObject is pipelined to the cmdlet and can be a string in a format identical to the Identity parameter, or can be an SPDiagnosticsCategory . The user can retrieve one or more categories from the Get-SPLogLevel cmdlet, modify the category values, and then pipeline them into the Set-SPLogLevel cmdlet.

TraceSeverity

Optional

System.String

This setting throttles which entries will be recorded in the trace logs . The trace log files are text files that are written to the trace log path that is defined on the Diagnostic Logging page on the SharePoint Central Administration site. The type must be any one of the following values:

  • None (no traces are written to the trace log)

  • Unexpected

  • Monitorable

  • High

  • Medium

  • Verbose

  • VerboseEx

Detailed Description

The Set-SPLogLevel cmdlet sets the Windows event logging and trace logging levels for one or more diagnostic logging categories registered in the farm. If an event or trace associated with a category occurs, but is less severe than that category's logging level, the event or trace is not written to the event log or the trace log. If an event or trace associated with a category occurs and is equally severe or more severe than that category's logging level, the event or trace is written to the event log or the trace log.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
Set-SPLogLevel -TraceLevel High -EventLevel Warning -Identity "Cat1"

This example sets the EventLevel and TraceLevel values for a single category.

------------------EXAMPLE 2-----------------------
Copy Code
"Cat1", "Cat2", "Cat3" | Set-SPLogLevel -EventLevel Error

This example sets the EventLevel values for multiple categories.

------------------EXAMPLE 3-----------------------
Copy Code
Set-SPLogLevel -TraceLevel Monitorable

Thisexample sets the TraceLevel value for all categories to Monitorable.


Set-SPManagedAccount
Example
[image]

Configures the managed account.

Set-SPManagedAccount -Identity <SPManagedAccountPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-EmailNotification <Int32>] [-PreExpireDays <Int32>] [-Schedule <String>] [-WhatIf [<SwitchParameter>]]
Set-SPManagedAccount -Identity <SPManagedAccountPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-AutoGeneratePassword <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-EmailNotification <Int32>] [-PreExpireDays <Int32>] [-Schedule <String>] [-WhatIf [<SwitchParameter>]]
Set-SPManagedAccount -Identity <SPManagedAccountPipeBind> -ConfirmPassword <SecureString> -NewPassword <SecureString> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-EmailNotification <Int32>] [-PreExpireDays <Int32>] [-Schedule <String>] [-SetNewPassword <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Set-SPManagedAccount -Identity <SPManagedAccountPipeBind> -ExistingPassword <SecureString> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-EmailNotification <Int32>] [-PreExpireDays <Int32>] [-Schedule <String>] [-UseExistingPassword <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPManagedAccountPipeBind

Specifies the full name or partial name of the managed accounts to retrieve.

The type must be a valid account name, in the form Domain\User, or a GUID, in the form 1234-3456-09876.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

EmailNotification

No

Specifies the number of days before password change to begin e-mail notifications.

The default value is 5 .

PreExpireDays

No

Specifies the number of days before expiration to schedule password change.

The default value is 2 .

Schedule

No

Specifies the new schedule on which the password change job is to run.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPManagedAccountPipeBind

Specifies the full name or partial name of the managed accounts to retrieve.

The type must be a valid account name, in the form Domain\User, or a GUID, in the form 1234-3456-09876.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

AutoGeneratePassword

Optional

System.Management.Automation.SwitchParameter

Automatically generates a new password.

The type must be either of the following values:

  • True

  • False

The default value is False .

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

EmailNotification

No

Specifies the number of days before password change to begin e-mail notifications.

The default value is 5 .

PreExpireDays

No

Specifies the number of days before expiration to schedule password change.

The default value is 2 .

Schedule

No

Specifies the new schedule on which the password change job is to run.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 3

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPManagedAccountPipeBind

Specifies the full name or partial name of the managed accounts to retrieve.

The type must be a valid account name, in the form Domain\User, or a GUID, in the form 1234-3456-09876.

ConfirmPassword

Yes

System.Security.SecureString

Confirms the new password for this managed account.

NewPassword

Yes

System.Security.SecureString

Sets a new password for this managed account

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

EmailNotification

No

Specifies the number of days before password change to begin e-mail notifications.

The default value is 5 .

PreExpireDays

No

Specifies the number of days before expiration to schedule password change.

The default value is 2 .

Schedule

No

Specifies the new schedule on which the password change job is to run.

SetNewPassword

No

System.Management.Automation.SwitchParameter

Sets the password to the new value that is passed in, and changes it in Active Directory .

  • The type must be either of the following values:

  • True

  • False

The default value is False .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 4

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPManagedAccountPipeBind

Specifies the full name or partial name of the managed accounts to retrieve.

The type must be a valid account name, in the form Domain\User, or a GUID, in the form 1234-3456-09876.

ExistingPassword

Yes

System.Security.SecureString

Sets the password for this managed account to an existing value that has already been changed in Active Directory.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

EmailNotification

No

Specifies the number of days before password change to begin e-mail notifications.

The default value is 5 .

PreExpireDays

No

Specifies the number of days before expiration to schedule password change.

The default value is 2 .

Schedule

No

Specifies the new schedule on which the password change job is to run.

UseExistingPassword

No

System.Management.Automation.SwitchParameter

Sets the password to a new value passed in where the value is already changed in Active Directory.

  • The type must be either of the following values:

  • True

  • False

The default value is False .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPManagedAccount cmdlet sets the properties on the given managed account.

You can use this cmdlet to change the password expiration and notification settings for the managed account: Use the default parameter set. Additionally, you can use this cmdlet to change the password for the managed account to automatically generated passwords on a set schedule: Use the parameter set that includes the AutoGeneratePassword parameter. You can also use this cmdlet to change the password for the managed account to a new value, known to the administrator: Use the parameter set that includes the SetNewPassword parameter. Finally, you can use this cmdlet to change the password for the managed account to an existing value that has been already been changed in Active Directory: Use the parameter set that includes the UseExistingPassword parameter.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
$m = Get-SPManagedAccount -Identity "DOMAINx\UserY"
Copy Code
Set-SPManagedAccount -Identity $m -AutoGeneratePassword true

This example displays an explicit managed account if it exists, and then attempts to update it to use automatically generated passwords.


Set-SPMobileMessagingAccount
See Also Example
[image]

Configures the specified mobile messaging account.

Set-SPMobileMessagingAccount -Identity <SPMobileMessagingAccountPipeBind> -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Password <String>] [-ServiceName <String>] [-ServiceUrl <String>] [-UserId <String>]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPMobileMessagingAccountPipeBind

Specifies whether to return either Short Message Service (SMS) or Multimedia Messaging Service (MMS) account information. Valid values are SMS and MMS . If you do not specify this parameter account, information is returned for both SMS and MMS.

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the identity of the Web application that hosts the managed path to delete . The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid Web application name (for example, WebApplication1212); or a valid name (for example, WebApp2423).

You either must specify WebApplication or must use the HostHeader switch and specify the full URL in the Identity parameter.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Password

Optional

System.String

Specifies the password, if credentials are required for the account.

ServiceName

Optional

System.String

Specifies the name of the SMS service.

ServiceUrl

Optional

System.String

Specifies the URL of the SMS service.

UserId

Optional

System.String

Specifies the user name, if credentials are required for the account.

Detailed Description

The Set-SPMobileMessagingAccount cmdlet configures the specified mobile messaging account.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Set-SPMobileMessagingAccount -WebApplication http://localhost -Identity SMS -ServiceName SMSLink -ServiceUrl https://www.adatum.com/Service/MessagingService.asmx-UserId someone@example.com -Password password1

This example changes the SMS mobile account settings of the Web application, http://localhost, to the following values: service name: SMSLink; service URL: https://www.adatum.com/Service/MessagingService.asmx; user ID: someone@example.com; password: password1.

See Also

Reference

Get-SPMobileMessagingAccount

Click here to submit feedback on this topic.


Set-SPPassPhrase
Example
[image]

Sets the Passphrase to a new value.

Set-SPPassPhrase -ConfirmPassPhrase <SecureString> -PassPhrase <SecureString> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]
Set-SPPassPhrase -PassPhrase <SecureString> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-LocalServerOnly <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

LocalServerOnly

Yes

System.Management.Automation.SwitchParameter

Scopes the Passphrase change to the local server only. If this parameter is not used, the Passphrase change is performed farm-wide.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPPassPhrase cmdlet sets the Passphrase to a new Passphrase value. If the LocalServerOnly parameter is not used, the farm encryption key is re-encrypted with the new value and attempts to propagate this value to all other servers in the farm. If the LocalServerOnly parameter is used, this is updated on the local machine only, and the farm encryption key is not changed. The Passphrase value must be the same on all servers in the farm if the farm is to function correctly. So if the Passphrase fails to propagate to all servers, the LocalServerOnly parameter can be used to set the remaining servers to the new Passphrase value manually.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
$passphrase = ConvertTo-SecureString -asPlainText -Force
Copy Code
Set-SPPassPhrase -PassPhrase $passphrase -Confirm

This example queries for a string to use as a passphrase, and sets the farm passphrase to a new value.


Set-SPSite
Example
[image]

Configures the specified sites.

Set-SPSite -Identity <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-LockState <String>] [-MaxSize <Int32>] [-OwnerAlias <String>] [-QuotaTemplate <SPQuotaTemplatePipeBind>] [-SecondaryOwnerAlias <String>] [-SiteSubscription <SPSiteSubscriptionPipeBind>] [-Template <SPWebTemplatePipeBind>] [-Url <String>] [-UserAccountDirectoryPath <String>] [-WarningSize <Int32>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Specifies the URL or GUID of the site collection to configure, or refers to an SPSite object that contains sites to configure.

The type must be a valid URL, in the form http://server_name; a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or an SPSite object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

LockState

Optional

System.String

Sets the lock state of this site collection. The valid lock states are Unlock, Content, ReadOnly, or NoAccess.

MaxSize

Optional

System.Int32

Sets the maximum storage size for the site collection in megabytes.

The integer value must be larger than the WarningSize value. You cannot use this parameter if the site collection is using a quota template.

OwnerAlias

Optional

System.String

QuotaTemplate

Optional

Microsoft.SharePoint.PowerShell.SPQuotaTemplatePipeBind

Specifies the new quota template for this site collection.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890abcdef.

SecondaryOwnerAlias

Optional

System.String

Sets the secondary owner.

The type must be a valid e-mail alias, in the form domain\username.

Template

Optional

Microsoft.SharePoint.PowerShell.SPWebTemplatePipeBind

Specifies the template for this site collection.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890abcdef.

Url

Optional

System.String

UserAccountDirectoryPath

Optional

String

Sets an organization unit to which to scope user accounts.

WarningSize

Optional

System.Int32

Sets the storage warning level for the site collection.

The integer value must be between 0 and the MaxSize value. You cannot use this parameter if the site collection is using a quota template.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPSite cmdlet configures the site collection that is specified by the Identity parameter. If a parameter is not used, the value is not changed.

Note:
The QuotaTemplate parameter is mutually exclusive to the MaxSize parameter and WarningSize parameter.

Input Types

Return Types

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPSiteAdministration
Example
[image]

Allows farm administrators to configure any site collection.

Set-SPSiteAdministration -Identity <SPSiteAdministrationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-LockState <String>] [-MaxSize <Int32>] [-OwnerAlias <String>] [-SecondaryOwnerAlias <String>] [-SiteSubscription <SPSiteSubscriptionPipeBind>] [-Template <SPWebTemplatePipeBind>] [-WarningSize <Int32>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSiteAdministrationPipeBind

Specifies the URL (full or partial) or GUID of the site collection to set .

The type must be a valid URL, in the form http://server_name, or a GUID, in the form 1234-456-987fg.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

LockState

Optional

System.String

Specifies the lock state for the given site collection.

The type must be any of the following values:

  • Unlock : Sets the site collection to unlock.

  • Content : No new content can be added. Updates and deletions are allowed.

  • Readonly : Sets the site collection to read-only.

  • Noaccess : Sets the site collection to unavailable to all users.

MaxSize

Optional

System.Int32

Sets the maximum storage size of the site collection.

The type must be a valid number greater than or equal to 0. Set to 0 for unlimited .

OwnerAlias

Optional

System.String

Sets the owner of this site collection. The type must be a valid user alias.

SecondaryOwnerAlias

Optional

System.String

Sets the secondary owner of this site collection. The type must be a valid user alias.

Template

Optional

Microsoft.SharePoint.PowerShell.SPWebTemplatePipeBind

Specifies the Web template for the root web of this site collection. This can only be given if the template has not already been configured.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890abcdef, or an SPWebTemplate object.

WarningSize

Optional

Specifies the site collection warning size limit .

The type must be a valid number greater than or equal to 0. Set to 0 for unlimited .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPSiteAdministration cmdlet allows a farm administrator to configure particular settings on a site collection even if the farm administrator is not granted explicit permissions. Any parameter that is not provided is not changed.

Input Types

Return Types

none

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Set-SPSiteAdministration http://sitename -OwnerAlias "DOMAIN\NewOwner"

This example allows farm administrators to change the ownership of a site collection to which they do not have access.


Set-SPSubscriptionSettingsServiceApplication
Example
[image]

Sets properties of a subscription settings service application.

Set-SPSubscriptionSettingsServiceApplication -Identity <SPServiceApplicationPipeBind> [-ApplicationPool <SPIisWebServiceApplicationPoolPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DatabaseCredentials <PSCredential>] [-DatabaseName <String>] [-DatabaseServer <String>] [-FailoverDatabaseServer <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the settings service application to update.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a subscription settings service application (for example, SubscriptionSettingsApp1); or an instance of a valid SPSubscriptionSettingsServiceApplication object.

ApplicationPool

Optional

Microsoft.SharePoint.PowerShell.SPIisWebServiceApplicationPoolPipeBind

Specifies the Internet Information Services (IIS) application pool to use for the new subscription settings application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of an application pool (for example, AppPoolName1); or an instance of a valid IISWebServiceApplicationPool object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DatabaseCredentials

Optional

System.Management.Automation.PSCredential

Specifies the PSCredential object that contains the user name and password to be used for database SQL authentication .

The type must be a valid PSCredential object.

DatabaseName

Optional

System.String

Specifies the name of the subscription settings database.

The type must be a valid name of a SQL Server database; for example, SubscriptionSettingsAppDB1.

DatabaseServer

Optional

Microsoft.SharePoint.PowerShell.SPServerPipeBind

Specifies the name of the host SQL instance for the database specified in DatabaseName parameter.

The type must be a valid SQL Server instance name; for example, SQLServerHost1.

FailoverDatabaseServer

Optional

System.String

Specifies the name of the host SQL instance for the failover database server.

The type must be a valid SQL Server instance name; for example, SQLServerHost1.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Set-SPSubscriptionSettingsServiceApplication cmdlet to set properties on a subscription settings service application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

---------------------EXAMPLE--------------------------
Copy Code
$applicationPool = GetSPIisWebServiceApplicationPool SettingsApplicationPool
Copy Code
Get-SPServiceApplication -Name SettingsServiceApp | Set-SPSubscriptionSettingsServiceApplication -ApplicationPool $applicationPool

This example changes the application pool of the subscription settings service application. This command assumes that a subscription settings service application named SettingsServiceApp exists and that an application pool named SettingsApplicationPool exists


Set-SPUsageApplication
Example
[image]

Sets properties of a usage application.

Set-SPUsageApplication -Identity <SPUsageApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DatabaseName <String>] [-DatabasePassword <SecureString>] [-DatabaseServer <String>] [-DatabaseUsername <String>] [-EnableLogging <SwitchParameter>] [-UsageService <SPUsageServicePipeBind>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPUsageApplicationPipeBind

Specifies the usage application to update.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh, a valid name of a usage application (for example; UsageApp1); or an instance of a valid SPServiceApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DatabaseName

Optional

System.String

Specifies the name of the logging database.

The type must be a valid name of a SQL Server database; for example, UsageLogDB1.

DatabasePassword

Optional

System.Security.SecureString

Specifies the password for the user specified in DatabaseUserName . Use this parameter only if SQL authentication is used to access the logging database.

The type must be a valid password.

DatabaseServer

Optional

System.String

Specifies the name of the host server for the database specified in DatabaseName .

The type must be a valid SQL Server host name; for example, SQLServerHost1.

DatabaseUsername

Optional

System.String

Specifies the user name to use for connecting to the logging database. Use this parameter only if SQL authentication is used to access the logging database.

The type must be a valid user name; for example, UserName1.

EnableLogging

Optional

System.Management.Automation.SwitchParameter

Specifies that this usage application collects usage data.

UsageService

Optional

Microsoft.SharePoint.PowerShell.SPUsageServicePipeBind

Specifies the SPUsageService object that is the parent of the usage application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a usage service (for example, UsageService1); or an instance of a valid SPUsageService object.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPUsageApplication cmdlet sets properties of a usage application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPUsageService
Example
[image]

Sets the properties of a usage service.

Set-SPUsageService [-Identity <SPUsageServicePipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-LoggingEnabled <Nullable>] [-UsageLogCutTime <UInt32>] [-UsageLogLocation <String>] [-UsageLogMaxSpaceGB <UInt32>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPUsageServicePipeBind

Specifies the usage service to update.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a usage service (for example, UsageService1); or an instance of a valid SPUsageService object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

LoggingEnabled

Optional

System.Nullable

Specifies that usage data is logged to usage files.

UsageLogCutTime

Optional

System.UInt32

Specifies the time, in minutes, of usage data collected per usage log file. The default time is 30 minutes.

The type must be an integer in the range of 1 to 1440 .

UsageLogLocation

Optional

System.String

Specifies the path on every computer in the farm where usage log files are created.

The type must be a valid path in either of the following forms:

  • C:\folder_name

  • \\server_name\folder_name

UsageLogMaxSpaceGB

Optional

System.UInt32

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPUsageService cmdlet updates the properties of a usage service. If the Identity parameter is not specified, the cmdlet applies the changes to the local usage service.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPUser
Example
[image]

Configures properties on an existing user.

Set-SPUser -Identity <SPUserPipeBind> [-AddPermissionLevel <String[]>] [-AssignmentCollection <SPAssignmentCollection>] [-ClearPermissions <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DisplayName <String>] [-Email <String>] [-Group <SPGroupPipeBind>] [-IsSiteCollectionAdmin <SwitchParameter>] [-MobileNumber <String>] [-PassThru <SwitchParameter>] [-RemovePermissionLevel <String[]>] [-SyncFromAD <SwitchParameter>] [-Web <SPWebPipeBind>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPUserPipeBind

Specifies the GUID, login name, or SPUser object of the user to be returned.

The type must be a valid GUID of the user, in the form 1234-5678-9876-0987.

AddPermissionLevel

Optional

System.String[]

Specifies the permission level to add to the user.

The type must be any one of the following types: < >

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

ClearPermissions

Optional

System.Management.Automation.SwitchParameter

Clears all given permissions from the user. If Clear and Add are given, the permissions are first cleared, then the new permissions are given .

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DisplayName

Optional

System.String

Specifies the new display name of the user.

The type must be a valid name.

Email

Optional

System.String

Specifies the new e-mail address of the user.

Group

Optional

Microsoft.SharePoint.PowerShell.SPGroupPipeBind

IsSiteCollectionAdmin

Optional

none

Specifies whether to set the user as a site collection administrator.

MobileNumber

Optional

System.String

Sets the new mobile number for the user.

PassThru

Optional

none

If not provided, indicates that this cmdlet has no output. If provided, this parameter indicates that the SPUser object for this user is to be returned.

RemovePermissionLevel

Optional

System.String[]

Removes the permission level from the user.

The type must be any one of the following types: < >

SyncFromAD

Optional

System.Management.Automation.SwitchParameter

If provided, specifies that user information will be synchronized from the user directory store .

Web

Optional

Microsoft.SharePoint.PowerShell.SPWebPipeBind

Specifies the name of the URL or GUID to be used as a scope. This parameter is not needed if the SPUser object is provided as the identity.

The type must be a valid URL, in the form http://server_name, or GUID, in the form 1234-5678-9807.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPUser cmdlet configures properties on an existing user.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Set-SPUser -identity 'Contoso\jdoe' -Web http://test -permissions "Contributor"

This example sets a user (Contoso\jdoe) to be a contributor on http://test


Set-SPWeb
Example
[image]

Configures the specified subsite.

Set-SPWeb -Identity <SPWebPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Description <String>] [-RelativeUrl <String>] [-Template <SPWebTemplatePipeBind>] [-Theme <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebPipeBind

The URL of the Web or SPWeb object that represents the Web.

The type must be a valid URL, in the form http://server_name, or an SPWeb object.

Name

Optional

String

Specifies the new name of the Web.

Description

Optional

System.String

Specifies the new description of the Web.

RelativeUrl

Optional

System.String

Specifies the new relative URL for the Web. This is the URL path after the site collection URL.

Theme

Optional

System.String

Specifies the new theme to apply to the Web.

Template

Optional

Microsoft.SharePoint.PowerShell.SPWebTemplatePipeBind

Specifies the new template to apply to the Web. This cannot be done if the template is already applied.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPWeb cmdlet configures the subsite specified by the Identity parameter. Settings for any parameters that are not provided are not changed.

Input Types

Return Types

none

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Get-SPWeb http://sitename/subweb | Set-SPWeb -Title "My Site Title"

This example sets the title of an existing subsite.


Set-SPWebApplication
Example
[image]

Configures the specified Web application.

Set-SPWebApplication -Identity <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DefaultQuotaTemplate <String>] [-DefaultTimeZone <Int32>] [-ServiceApplicationProxyGroup <SPServiceApplicationProxyGroupPipeBind>] [-UseClaimsAuthentication <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Set-SPWebApplication -Identity <SPWebApplicationPipeBind> -Zone <String> [-AllowAnonymousAccess <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-HostHeader <String>] [-IdentityProvider <SPIdentityProviderPipeBind[]>] [-Port <Int32>] [-SecureSocketsLayer <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Set-SPWebApplication -Identity <SPWebApplicationPipeBind> -SMTPServer <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-OutgoingEmailAddress <String>] [-ReplyToEmailAddress <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the name or URL of the Web application.

The type must be a valid name, in the form WebApplication-1212, or URL, in the form http://server_name/WebApplicaiton-1212.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DefaultQuotaTemplate

No

System.String

Specifies the new default site quota template for this Web application.

DefaultTimeZone

No

System.Int32

Specifies the default time zone for new site collections in this Web application.

ServiceApplicationProxyGroup

Optional

Microsoft.SharePoint.PowerShell.SPServiceApplicationProxyGroupPipeBind

UseClaimsAuthentication

Optional

System.Management.Automation.SwitchParameter

Converts this Web application to use claims authentication for internal communications. This conversion cannot be undone.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the name or URL of the Web application.

The type must be a valid name, in the form WebApplication-1212, or URL, in the form http://server_name/WebApplicaiton-1212.

Zone

Yes

When configuring zone-specific settings, the zone to configure must be supplied . This zone must already exist.

The type must be any one of the following values: Default , Intranet , Internet , Extranet , or Custom .

AllowAnonymousAccess

No

System.Management.Automation.SwitchParameter

Sets the Web application to accept anonymous users.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

HostHeader

No

System.String

Specifies a valid URL assigned to the Web application that must correlate to the alternate access mapping configuration; for example, http://server_name. When the HostHeader parameter is present, the value of this field is the internal URL for the Web application. The Url parameter is used to specify the public URL.

Port

No

System.Int32

Specifies the new port number for the Web application. If no port is specified, a nonconflicting port number is auto-generated.

Important:
If you specify a port number that has already been assigned, IIS does not start the new site until you change either the port number of the new site or the port number of the old site.

SecureSocketsLayer

No

System.Management.Automation.SwitchParameter

Enables Secure Sockets Layer (SSL) encryption for this Web application. If you use SSL, you must add the certificate on each server by using the IIS administration tools. Until you add the certificates, the Web application is inaccessible from this IIS Web site.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 3

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the name or URL of the Web application.

The type must be a valid name, in the form WebApplication-1212, or URL, in the form http://server_name/WebApplicaiton-1212.

OutgoingEmailAddress

Required

System.String

Specifies the new outgoing e-mail address for e-mail messages sent from this Web application. The type must be a valid address; for example, someone@example.com.

ReplyToEmailAddress

Required

System.String

Configures the reply e-mail address. The type must be a valid address; for example, someone@example.com.

SMTPServer

Required

System.String

Specifies the new outbound SMTP server that this Web application will use.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPWebApplication cmdlet configures the Web application specified by the Identity parameter. For any settings that are zone-specific (for the Zone parameter set), the zone to configure must be provided. The provided zone must already exist.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Get-SPWebApplication http://somesite | Set-SPWebApplication -Zone "Extranet" -HostHeader "http://www.contoso.com" - AllowAnonymousAccess

This example sets the HostHeader URL for the Extranet zone of the given Web application as http://www.contoso.com and enables anonymous access.


Set-SPWebTemplate
Example
[image]

Changes the title and description of an installed site template.

Set-SPWebTemplate -Identity <SPWebTemplatePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Description <String>] [-Name <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebTemplatePipeBind

Specifies the name of the Web template to be changed.

The type must the ID or full name of the Web template.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Description

Optional

System.String

Specifies the new description.

The type must be a valid description; for example, This is template.

Name

Optional

System.String

Specifies the new name for the template.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPWebTemplate cmdlet changes the title and description of an installed site template.

Input Types

Return Types

none

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Get-SPSiteTemplate "ATH#0" | Set-SPSiteTemplate -name "Athletics Site"
Copy Code
Set-SPSiteTemplate "ATH#0" -name "Athletics Site"

This examples change the ATH#0 template title to Athletics Site.


Set-SPWorkflowConfig
See Also Example
[image]

Configures the workflow settings for the specified Web application.

Set-SPWorkflowConfig -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DeclarativeWorkflowsEnabled <$true | $false>] [-EmailNoPermissionParticipantsEnabled <$true | $false>] [-SendDocumentToExternalParticipants <$true | $false>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter | Required | Type | Description
WebApplication | Required | Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind | Specifies the name or URL of the Web application. The type must be a valid name or GUID, in the form WebApplication-1212, or a URL, in the form http://server_name/WebApplication-1212.
AssignmentCollection | Optional | Microsoft.SharePoint.PowerShell.SPAssignmentCollection |
Confirm | Optional | System.Management.Automation.SwitchParameter | Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters
DeclarativeWorkflowsEnabled | Optional | System.Boolean | Sets whether declarative workflows are allowed to run in the Web application. The type must be either 1 for True or 0 for False .
EmailNoPermissionParticipantsEnabled | Optional | System.Boolean | Sets whether workflows send task e-mail messages to users who do not have permissions to the site in which the workflows are running. The type must be either 1 for True or 0 for False .
SendDocumentToExternalParticipants | Optional | System.Boolean | Sets whether workflows automatically send a copy of the document as an e-mail attachment to participants who do not have access to the site or who are not in any linked directory other than Active Directory. The type must be either 1 for True or 0 for False .
WhatIf | Optional | System.Management.Automation.SwitchParameter | Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Set-SPWorkflowConfig cmdlet to configure the workflow settings for the specified Web application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Set-SPWorkflowConfig -webapplication http://localhost DeclarativeWorkflowsEnabled $true -EmailNoPermissionParticipantsEnabled $true -SendDocumentToExternalParticipants $false

This example sets the workflow settings for the specified Web application to turn on declarative workflows, turns on e-mail to participants who do not have permissions to the site, and turns off the functionality to send e-mail messages as attachments to external participants.

No return values. Use the Get-SPWorkflowConfig cmdlet to see values. To set farm-level workflow settings for event-delivery time-out and to postpone threshold and batch size, use Set-SPFarmConfig.

See Also

Reference

Get-SPWorkflowConfig

Click here to submit feedback on this topic.


Start-SPAdminJob
Example
[image]

Immediately starts any waiting administrative job on the local computer.

Start-SPAdminJob [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Start-SPAdminJob cmdlet to execute all administrative timer jobs immediately rather than waiting for the timer job to run.

When the process account for the Windows SharePoint Services Timer service (SPAdmin) is disabled (necessary in some installations for security reasons), the Start-SPAdminJob cmdlet must be run on all computers to perform provisioning and other administrative tasks that SPAdmin ordinarily handles.

When you run this cmdlet in person (not in script), use the Verbose parameter to see the individual administrative operations that are run.

Input Types

Return Types

none

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Start-SPAdminJob -Verbose

This example runs all waiting administrative jobs and shows verbose output to the administrator.


Start-SPAssignment
Example
[image]

Initiates a new assignment store.

Start-SPAssignment [-AssignmentCollection <SPAssignmentCollection>] [-Global <SwitchParameter>]

Parameters

Parameter Required Type Description

Global

Optional

System.Management.Automation.SwitchParameter

If you use this parameter, all objects are assigned to the lifetime of the script and are disposed of when the Stop-SPAssignment cmdlet is called.

If you do not use this parameter, you must assign the output of this cmdlet to a variable and then dispose of objects by using the Identity parameter of the Stop-SPAssignment cmdlet.

Detailed Description

The Start-SPAssignment cmdlet properly disposes of objects used with variable assignments.

Large amounts of memory are often required when SPWeb, SPSite, or SPSiteAdminsitration objects are used. So the use of these objects, or lists of these objects, in Windows PowerShell scripts requires proper memory management. By default, all Get commands dispose of these objects immediately after the pipeline finishes, but by using SPAssignment, you can assign the list of objects to a variable and dispose of the objects after they are no longer needed. You can also ensure that the objects remain as long as you need them, even throughout multiple iterations of commands.

There are three levels of assignment:

  • No assignment — The object is not assigned to a variable and is disposed of after each iteration of the command.

  • Simple assignment — All objects are assigned to the global assignment store. This is done by using the Global parameter. When using this level, all objects are assigned to a global store and are disposed of when the Stop-SPAssignment cmdlet is called.

  • Advanced assignment — Objects are assigned to named stores for disposal. You can dispose of objects by using the Identity parameter with the Stop-SPAssignment cmdlet.

Note:
Regardless of the assignment level used, all objects are disposed of when the PowerShell runspace is closed.

Input Types

Return Types

SPAssignmentCollection

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
Start-SPAssignment -global
Copy Code
$w = Get-SPWeb http://MyWeb
Copy Code
$w | Set-SPWeb -title "Accounting"
Copy Code
Stop-SPAssignment -global

This example uses simple assignment. While easier to use, running commands that iterate through multiple SPSite or SPWeb objects while simple assignment is enabled is not recommended. Ensure that Stop-SPAssignment is run before attempting any interations of multiple objects.

------------------EXAMPLE 2-----------------------
Copy Code
$gc = Start-SPAssignment
Copy Code
$web = $gc | Get-SPWeb http://MyWeb
Copy Code
$web | Set-SPWeb -title "Accounting"
Copy Code
Stop-SPAssignment -Identity $gc

This example sets the title of the SPWeb object in multiple lines and controls the rate of disposal. This is an advanced example. Only developers are advised to use it.


Start-SPServiceInstance
Example
[image]

Starts the service instance for a service on a specific server or the farm.

Start-SPServiceInstance -Identity <SPServiceInstancePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceInstancePipeBind

Specifies the GUID of the service instance to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Start-SPServiceInstance cmdlet to start the service instance for a service on a specific server or on the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Start-SPServiceInstance 67877d63-bff4-4521-867a-ef4979ba07ce

This example starts the given service instance on the server.

The service instance GUID is unique to every farm. You can run the Get-SPServiceInstance cmdlet to see the GUID of the service instances, and then use the result from the SPServiceInstance cmdlet for other cmdlets.


Stop-SPAssignment
Example
[image]

Disposes of objects in the provided Assignment Collection.

Stop-SPAssignment [-SemiGlobal <SPAssignmentCollection>] [-AssignmentCollection <SPAssignmentCollection>] [-Global <SwitchParameter>]

Parameters

Parameter | Required | Type | Description
SemiGlobal | Optional | Microsoft.SharePoint.PowerShell.SPAssignmentColletion | Provides the assignment collector from which to dispose of objects.
Global | Optional | System.Management.Automation.SwitchParameter | If provided, the global assignment collector stops storing objects and disposes of any contained .

Detailed Description

The Stop-SPAssignment cmdlet disposes of objects in the provided Assignment Collection. Use the Global parameter to dispose of all objects in the global assignment collector and to stop the global store from collecting additional objects. Provide a SemiGlobal assignment collector to dispose of all contained objects.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example

Copy Code

            Click here to

      submit feedback
             on this topic.


Stop-SPServiceInstance
Example
[image]

Stops the service instance for a service.

Stop-SPServiceInstance -Identity <SPServiceInstancePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceInstancePipeBind

Specifies the GUID of the service instance to get.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Stops the service instance for a service on the specified server or for the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Stop-SPServiceInstance 67877d63-bff4-4521-867a-ef4979ba07ce

This example stops the service instance in the given server.

The service instance GUID is unique to every farm. You can run the Get-SPServiceInstance cmdlet to see the GUID of the service instances, and then use the result from the SPServiceInstance cmdlet for other cmdlets.


Uninstall-SPFeature
Example
[image]

Uninstalls an installed feature definition.

Uninstall-SPFeature -Identity <SPFeatureDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Parameter

Microsoft.SharePoint.PowerShell.SPFeatureDefinitionPipeBind

Specifies the name of the feature or GUID to uninstall.

The type must be the name of the feature folder located in the 14\Template\Features folder, or must be a GUID, in the form 21d186e1-7036-4092-a825-0eb6709e9281.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

No

System.Management.Automation.SwitchParameter

Forces the uninstallation of a feature that is already installed.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Uninstall-SPFeature cmdlet removes the specified feature definition from the collection of feature definitions in the farm.

Input Types

Return Types

none

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Uninstall-SPFeature -path "MyCustomFeature"

This example uninstalls the feature at $env:ProgramFiles\Common Files\Microsoft Shared Debug\Web Server Extensions\14\TEMPLATE\FEATURES\MyCustomFeature/feature.xml.


Uninstall-SPWebPartPack
Example
[image]

Uninstalls the specified Web Part package.

Uninstall-SPWebPartPack -Identity <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Language <UInt32>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

System.String

Specifies the Web Part package in the farm's configuration database.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Language

Optional

System.Int32

Specifies the language ID of the Web Part package to delete. If no language is specified, the Web Part package is uninstalled for all languages.

The type must be a valid language identifier, in the form 1033.

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the Web application from which to uninstall the Web Part package. If no Web application is specified, the Web Part package is uninstalled from all Web applications.

The type must be a valid name, in the form WebApplication-1212, or a URL, in the form http://server_name/WebApplication-1212.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Uninstall-SPWebPartPack cmdlet to uninstall the Web Part package specified by the Identity parameter.

Input Types

Return Types

None

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Uninstall-SPWebTemplate
Example
[image]

Uninstalls the given site template.

Uninstall-SPWebTemplate -Identity <SPWebTemplatePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Language <UInt32>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebTemplatePipeBind

Specifies the ID or full name of the site template to remove.

A valid site template; for example, MYTEMP#0.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Language

No

System.Int32

Specifies the language of the file to remove. If this parameter is not provided, all the languages of given template are removed . The default value is ALL.

The type must be a valid language locale ID. For English, use 1033 .

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Uninstall-SPWebTemplate cmdlet uninstalls the given site template by providing a full identity.

Input Types

Return Types

None.

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Uninstall-SPSiteTemplate "mytemplate"
Copy Code
Get-SPSiteTemplate "mytemplate" | Uninstall-SPSiteTemplate

This example removes a site template named mytemplate.


Unpublish-SPServiceApplication
Example
[image]

Stops sharing the specified service application outside the farm.

Unpublish-SPServiceApplication -Identity <SPServiceApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the GUID of the service application to stop sharing outside the farm.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Unpublish-SPServiceApplication cmdlet to stop publishing the service application, specified by the Identity parameter, outside the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
UnPublish-SPServiceApplication 053c34be-d251-488c-8e94-644eae94da26

This example stops publishing the specified service application outside the farm.

The service application GUID is unique to every farm. You can run the Get-SPServiceApplication cmdlet to see the GUID of the service applications, and then use the result from the Get-SPServiceApplication cmdlet for other SPServiceApplication cmdelts (for example, Grant-SPServiceApplication or Publish-SPServiceApplication.


Update-SPFarmEncryptionKey
Example
[image]

Changes the value of the farm encryption key and, using the new key, re-encrypts all the data.

Update-SPFarmEncryptionKey [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Resume <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Resume

Optional

System.Management.Automation.SwitchParameter

Resumes re-encryption of data with the new farm encryption key if a previous attempt failed.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Update-SPFarmEncryptionKey cmdlet to change the farm encryption key to a new randomly generated value. By using the new key, all the data is re-encrypted.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Update-SPFarmEncryptionKey -confirm

This example changes the farm encryption key to a new value and re-encrypts all the data.


Add-SPSolution
Example
[image]

Uploads a SharePoint solution package to the farm.

Add-SPSolution -LiteralPath <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Language <UInt32>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

LiteralPath

Required

System.String

Specifies the path to the solution package.

The type must be a valid path in either of the following forms:

  • C:\folder_name

  • \\server_name\folder_name

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Language

Optional

System.UInt32

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Add-SPSolution cmdlet adds a SharePoint solution package to the farm. This cmdlet does not activate the uploaded SharePoint solution. Use the Install-SPSolution cmdlet to deploy the SharePoint solution on the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Add-SPUserSolution
Example
[image]

Uploads a new user solution package to the solution gallery.

Add-SPUserSolution -LiteralPath <String> -Site <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

LiteralPath

Required

System.String

Specifies the path to the user solution package.

The type must be a valid path in either of the following forms:

  • C:\folder_name

  • \\server_name\folder_name

Site

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Specifies the site collection where the user Pacific Technical Consulting (PTC) solution to add to the site collection.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Add-SPUserSolution cmdlet uploads a new user solution package to the solution gallery. A user solution is a SharePoint solution provided by Pacific Technical Consulting (PTC). This cmdlet does not activate the uploaded user solution. Use the Install-SPUserSolution cmdlet to activate the user solution in the site collection.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Disable-SPTimerJob
Example
[image]

Disables a timer job.

Disable-SPTimerJob -Identity <SPTimerJobPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPTimerJobPipeBind

Specifies the timer job to disable.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a timer job (for example, TimerJob1); or an instance of a valid SPTimerJob object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Disable-TimerJob cmdlet disables a timer job.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Disconnect-SPConfigurationDatabase
Example
[image]

Disconnects the active server computer from the configuration database.

Disconnect-SPConfigurationDatabase [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Disconnect-SPConfigurationDatabase cmdlet disconnects the active server computer from the SharePoint configuration database. This operation removes the server computer from the farm. A configuration database must be disconnected before the database can be removed.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Dismount-SPContentDatabase
Example
[image]

Detaches a content database from its currently associated Web application.

Dismount-SPContentDatabase -Identity <SPContentDatabasePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPContentDatabasePipeBind

Specifies the content database to detach.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint content database (for example, SPContentDB1); or an instance of a valid SPContentDatabase object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Dismount-SPContentDatabase cmdlet to detatch the given content database from its currently associated Web application. This cmdlet will not delete the content database. Use the Remove-SPContentDatabase cmdlet to delete a content database.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE 1------------
Copy Code
Dismount-SPContentDatabase 12345678-90ab-cdef-1234-567890abcdef

This example detaches the content database with the GUID 12345678-90ab-cdef-1234-567890abcdef from its current parent Web application.

--------------EXAMPLE 2------------
Copy Code
Get-SPContentDatabase -WebApplication http://localhost | Dismount-SPContentDatabase -WhatIf

This example detaches all content databases from the Web application on port 80 of the local machine. Remove the WhatIf parameter to perform the operation.


Enable-SPTimerJob
Example
[image]

Enables a timer job.

Enable-SPTimerJob -Identity <SPTimerJobPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPTimerJobPipeBind

Enables the specified timer job.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a timer job (for example, TimerJob1); or an instance of a valid SPTimerJob object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Enable-TimerJob cmdlet to enable a timer job. A timer job must be enabled before it can be started.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.
Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPBackupHistory
Example
[image]

Returns a history of backup and restore operations.

Get-SPBackupHistory -Directory <String> [-AssignmentCollection <SPAssignmentCollection>] [-ShowBackup <SwitchParameter>] [-ShowRestore <SwitchParameter>]

Parameters

Parameter Required Type Description

Directory

Required

System.String

Specifies the path where Microsoft SharePoint Server 2010 backup packages generated from a catastrophic backup have been stored.

The type must be a valid path in either of the following forms:

  • C:\folder_name

  • \\server_name\folder_name

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

ShowBackup

Optional

System.Management.Automation.SwitchParameter

Filters the output so that the history of backup operations only is displayed. If both the ShowBackup and the ShowRestore parameters are absent, the history of both backup and restore operations is displayed.

ShowRestore

Optional

System.Management.Automation.SwitchParameter

Filters the output so that the history of restore operations only is displayed. If both the ShowBackup and the ShowRestore parameters are absent, the history of both backup and restore operations is displayed.

Detailed Description

The Get-SPBackupHistory cmdlet reads a history of backup and restore operations that have been run. Specifies whether you want to display only the backup history, only the restore history, or all of the history.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPContentDatabase
Example
[image]

Returns one or more content databases.

Get-SPContentDatabase [-Identity <SPContentDatabasePipeBind>] [-AssignmentCollection <SPAssignmentCollection>]
Get-SPContentDatabase -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>]
Get-SPContentDatabase -Site <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>]
Get-SPContentDatabase -ConnectAsUnattachedDatabase <SwitchParameter> -DatabaseName <String> -DatabaseServer <String> [-AssignmentCollection <SPAssignmentCollection>] [-DatabaseCredentials <PSCredential>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPContentDatabasePipeBind

Specifies a specific content database to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint content database (for example, SPContentDB1); or an instance of a valid SPContentDatabase object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 2

Parameter

Required

Type

Description

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Returns the content databases for the specified Web application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 3

Parameter

Required

Type

Description

Site

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Returns the content database for the specified site collection.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 4

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

ConnectAsUnattachedDatabase

Optional

System.Management.Automation.SwitchParameter

Specifies that only unattached databases in the farm are returned.

Detailed Description

Use the Get-SPContentDatabase cmdlet to return the specified content databases.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

----------------EXAMPLE 1------------
Copy Code
Get-SPContentDatabase -webapplication http://localhost

This example returns all content databases used by the localhost Web application.

----------------EXAMPLE 2------------
Copy Code
Get-SPContentDatabase -site http://contoso.com

This example returns the content database that contains the site collection at http://contoso.com.


Get-SPHelpCollection
Example
[image]

Returns Help collection files.

Get-SPHelpCollection [-AssignmentCollection <SPAssignmentCollection>] [-Name <String>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Name

Optional

System.String

Specifies the name of the Help collection files to get.

The type must be a valid name of a Help collection; for example, HelpDocs1.

Detailed Description

The Get-SPHelpCollection cmdlet reads the specified Help collection files. If the Identity parameter is not specified, this cmdlet returns all installed Help collection files.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPProcessAccount
Example
[image]

Returns a system account or a managed account.

Get-SPProcessAccount [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-NetworkService <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Get-SPProcessAccount [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-LocalSystem <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Get-SPProcessAccount [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-LocalService <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

NetworkService

Optional

System.Management.Automation.SwitchParameter

Returns the NetworkService account.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

LocalSystem

Optional

System.Management.Automation.SwitchParameter

Returns the LocalSystem account.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 3

Parameter

Required

Type

Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

LocalService

Optional

System.Management.Automation.SwitchParameter

Returns the LocalService account.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Get-SPProcessAccount cmdlet returns a system account or a managed account and create the SPProcessAccountPipeBind. All operations that can accept an account can accept the SPProcessAccountPipeBind in place of the SPManagedAccountPipeBind.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
Get-SPProcessAccount -NetworkService

This example creates the SPProcessAccountPipeBind type by using the NetworkService account.

------------------EXAMPLE 2-----------------------
Copy Code
Get-SPProcessAccount -NetworkService | New-SPIisWebServiceApplicationPool -Account $_

This example creates an SPIisWebServiceApplicationPool account by using the NetworkService account returned by the Get-SPProcessAccount cmdlet.


Get-SPSolution
Example
[image]

Returns a specified SharePoint solution.

Get-SPSolution [-Identity <SPSolutionPipeBind>] [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPSolutionPipeBind

Specifies the SharePoint solution to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint solution (for example, SPSolution1); or an instance of a valid SPSolution object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPSolution cmdlet reads a specified SharePoint solution. If the Identity parameter is not specified, this cmdlet returns the collection of all installed SharePoint solutions in the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPTimerJob
Example
[image]

Returns timer jobs.

Get-SPTimerJob [-Identity <SPTimerJobPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Type <String>] [-WebApplication <SPWebApplicationPipeBind>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPTimerJobPipeBind

Specifies the timer job to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a timer job (for example, TimerJob1); or an instance of a valid SPTimerJob object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Type

Optional

System.String

Filters to return timer jobs of a specified type.

The type must be a name of a valid timer job type; for example, TimerJob1.

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Filters to return timer jobs defined for the scope of a specified SharePoint Web application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

Detailed Description

The Get-TimerJob cmdlet reads a specified timer job, timer jobs of a specified type, or timer jobs defined for a specified scope. If no parameters are specified, this cmdlet returns all timer job definitions for the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPUserSolution
Example
[image]

Returns a specified user solution.

Get-SPUserSolution [-Identity <SPUserSolutionPipeBind>] -Site <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPUserSolutionPipeBind

Specifies the user solution to get.

The type must be a valid name of a user solution (for example, UserSolution1); a valid URL of a site collection, in the form http://server_name; or an instance of a valid SPUserSolution object.

Site

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Specifes the site collection that contains the specified user solution.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPUserSolution cmdlet reads a specified user solution. If the Identity parameter is not specified, this cmdlet returns the collection of SharePoint solutions in the farm. A user solution is a SharePoint solution provided by Pacific Technical Consulting (PTC).

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Install-SPSolution
Example
[image]

Deploys an installed SharePoint solution in the farm.

Install-SPSolution -Identity <SPSolutionPipeBind> [-AllWebApplications <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>] [-CASPolicies <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-GACDeployment <SwitchParameter>] [-Local <SwitchParameter>] [-Time <String>] [-WebApplication <SPWebApplicationPipeBind>] [-WhatIf [<SwitchParameter>]]

Install-SPSolution [-Identity <SPSolutionPipeBind>] -Synchronize <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSolutionPipeBind

Specifies the SharePoint solution to deploy.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint solution (for example, SPSolution1); or an instance of a valid SPSolution object.

AllWebApplications

Optional

System.Management.Automation.SwitchParameter

Specifies that the new SharePoint solution is deployed for all SharePoint Web applications in the farm.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

CASPolicies

Optional

System.Management.Automation.SwitchParameter

Specifies that Code Access Security (CAS) policies can be deployed for the new SharePoint solution.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Forces the deployment of the new SharePoint solution.

GACDeployment

Optional

System.Management.Automation.SwitchParameter

Specifies that Global Assembly Cache (GAC) can be deployed for the new SharePoint solution.

Local

Optional

System.Management.Automation.SwitchParameter

Deploys the solution package on the active server computer.

Time

Optional

System.String

Specifies when the solution will be deployed. The default value is immediate deployment.

The type must be a valid DateTime value, in the form 2010, 5, 1.

WebApplication

Optional

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Deploys the SharePoint solution for the specified SharePoint Web application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSolutionPipeBind

Specifies the SharePoint solution to deploy.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint solution (for example, SPSolution1); or an instance of a valid SPSolution object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Synchronize

Optional

System.Management.Automation.SwitchParameter

Synchronizes all solutions or the specified solution in the local farm.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Install-SPSolution cmdlet deploys an installed SharePoint solution package in the farm. Use the Add-SPSolution cmdlet to add a SharePoint solution package to the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Install-SPUserSolution
Example
[image]

Activates a user solution in a site collection.

Install-SPUserSolution -Identity <SPUserSolutionPipeBind> -Site <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPUserSolutionPipeBind

Specifies the user solution to activate.

The type must be a valid a valid name of a user solution (for example, UserSolution1); a valid URL of a site collection, in the form http://server_name; or an instance of a valid SPUserSolution object.

Site

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Activates the user solution for the specified site collection.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

System.Management.Automation.SwitchParameter

Detailed Description

The Install-SPUserSolution cmdlet activates a user solution in a site collection. A user solution is a SharePoint solution provided by Pacific Technical Consulting (PTC).

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Mount-SPContentDatabase
Example
[image]

Attaches an existing content database to the farm.

Mount-SPContentDatabase -Name <String> -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-AssignNewDatabaseId <SwitchParameter>] [-ClearChangeLog <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DatabaseCredentials <PSCredential>] [-DatabaseServer <String>] [-MaxSiteCount <Int32>] [-WarningSiteCount <Int32>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Name

Required

System.String

Specifies the existing content database to attach to the farm.

The type must be a valid name of a SharePoint content database; for example, SPContentDB1.

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Attaches the content database to the specified SharePoint Web application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

AssignNewDatabaseId

Optional

System.Management.Automation.SwitchParameter

Creates a new database ID automatically when the content database is attached.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

ClearChangeLog

Optional

System.Management.Automation.SwitchParameter

Clears any pending changes from the change log in the content database.

DatabaseCredentials

Optional

System.Management.Automation.PSCredential

Specifies the PSCredential object that contains the user name and password to be used for database SQL authentication.

The type must be a valid PSCredential object.

DatabaseServer

Optional

Microsoft.SharePoint.PowerShell.SPServerPipeBind

Specifies the name of the host server for the content database specified in Name.

The type must be a valid SQL Server host name; for example, SQLServerHost1.

MaxSiteCount

Optional

System.Int32

Specifies the maximum number of Web sites that can use the content database.

The type must be a positive integer.

WarningSiteCount

Optional

System.Int32

Specifies the number of sites that can be created before a warning event is generated and the owner of the site collection is notified.

The type must be a positive integer.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Mount-SPContentDatabase cmdlet to attach an existing content database to the farm. If a database is mounted to an upgraded farm will cause the database to be upgraded as well.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

-----------------EXAMPLE---------------------
Copy Code
Mount-SPContentDatabase "MyDatabase" -DatabaseServer "MyServer" -WebApplication http://localhost

This example mounts an already existing database to the localhost Web application.


New-SPBusinessDataCatalogServiceApplication
Example
[image]

Creates a new Business Data Catalog service application in the farm.

New-SPBusinessDataCatalogServiceApplication -ApplicationPool <SPIisWebServiceApplicationPool> -DatabaseName <String> -DatabaseServer <String> -Name <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DatabaseCredentials <PSCredential>] [-DatabasePassword <SecureString>] [-DatabaseUsername <String>] [-FailoverDatabaseServer <String>] [-PartitionMode <SwitchParameter>] [-Sharing <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

ApplicationPool

Required

Microsoft.SharePoint.Administration.SPIisWebServiceApplicationPool

Specifies the IIS application pool to use for the new Business Data Catalog service application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of an application pool (for example, AppPoolName1); or an instance of a valid IISWebServiceApplicationPool object.

DatabaseName

Required

System.String

Specifies the name of the Business Data Catalog database.

The type must be a valid name of a SQL Server database; for example, UsageLogDB1.

DatabaseServer

Required

System.String

Specifies the name of the host server for the database specified in DatabaseName .

The type must be a valid SQL Server host name; for example, SQLServerHost1.

Name

Required

System.String

Specifies a display name for the new Business Data Catalog service application. The string that specifies the URL can contain a maximum of 1024 characters.

The type must be a valid name of a Business Data Catalog service application; for example, BDCApp1.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DatabaseCredentials

Optional

System.Management.Automation.PSCredential

Specifies the PSCredential object that contains the user name and password to be used for database SQL authentication.

The type must be a valid PSCredential object.

DatabasePassword

Optional

System.Security.SecureString

Specifies the password for the user specified in DatabaseUserName . Use this parameter only if SQL authentication is used to access the Business Data Catalog database.

The type must be a valid password.

DatabaseUsername

Optional

System.String

Specifies the user name to use for connecting to the catalog database. Use this parameter only if SQL authentication is used to access the catalog database.

The type must be a valid user name; for example, UserName1.

FailoverDatabaseServer

Optional

System.String

Specifies the name of the host server for the failover database server.

The type must be a valid SQL Server host name; for example, SQLServerHost1.

PartitionMode

Required

System.Management.Automation.SwitchParameter

Specifies that the service application restricts data by subscription ID. This property cannot be changed after the service application is created.

Sharing

Required

System.Management.Automation.SwitchParameter

Specifies that the Business Data Catalog service application is published and shared across the farm.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPBusinessDataCatalogServiceApplication cmdlet creates a new Business Data Catalog service application in the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


New-SPBusinessDataCatalogServiceApplicationProxy
Example
[image]

Creates a proxy for a Business Data Catalog service application in the farm.

New-SPBusinessDataCatalogServiceApplicationProxy -Name <String> -Uri <Uri> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DefaultProxyGroup <SwitchParameter>] [-PartitionMode <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
New-SPBusinessDataCatalogServiceApplicationProxy -Name <String> -ServiceApplication <SPServiceApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DefaultProxyGroup <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Name

Required

System.String

Specifies a display name for the new Business Data Catalog service application proxy. The string that specifies the URL can contain a maximum of 128 characters.

The type must be a valid name of a Business Data Catalog service application proxy; for example, BDCAppProxy1.

Uri

Required

System.Uri

Specifies the URI of a remote service application to which to connect.

The type must be a valid URI, in the form file:\\server_name\sitedocs.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DefaultProxyGroup

Required

System.Management.Automation.SwitchParameter

Specifies that the service application proxy is added to the default proxy group for the farm.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Name

Required

System.String

Specifies a display name for the new Business Data Catalog service application proxy. The string that specifies the URL can contain a maximum of 128 characters.

The type must be a valid name of a Business Data Catalog service application proxy; for example, BDCAppProxy1.

ServiceApplication

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the Business Data Catalog service application associated with the new proxy.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a subscription settings service application (for example, SubscriptionSettingsApp1); or an instance of a valid SPServiceApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DefaultProxyGroup

Required

System.Management.Automation.SwitchParameter

Specifies that the service application proxy is added to the default proxy group for the farm.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPBusinessDataCatalogServiceApplicationProxy cmdlet creates a new Business Data Catalog service application proxy in the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


New-SPContentDatabase
Example
[image]

Creates a new content database and attaches it to the specified Web application.

New-SPContentDatabase -Name <String> -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-AssignNewDatabaseId <SwitchParameter>] [-ClearChangeLog <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DatabaseCredentials <PSCredential>] [-DatabaseServer <String>] [-MaxSiteCount <Int32>] [-WarningSiteCount <Int32>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Name

Required

System.String

Specifies the new content database to create within the farm.

The type must be a valid name of a SharePoint content database; for example, SPContentDB1.

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Attaches the content database to the specified SharePoint Web application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

AssignNewDatabaseId

Optional

System.Management.Automation.SwitchParameter

Creates a new database ID automatically when the content database is attached.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

ClearChangeLog

Optional

System.Management.Automation.SwitchParameter

Clears any pending changes from the change log in the content database.

DatabaseCredentials

Optional

System.Management.Automation.PSCredential

Specifies the PSCredential object that contains the user name and password to be used for database SQL authentication.

The type must be a valid PSCredential object.

DatabaseServer

Optional

Microsoft.SharePoint.PowerShell.SPServerPipeBind

Specifies the name of the host server for the content database specified in the Name parameter.

The type must be a valid SQL Server host name; for example, SQLServerHost1.

MaxSiteCount

Optional

System.Int32

Specifies the maximum number of Web sites that can use the content database.

The type must be a positive integer.

WarningSiteCount

Optional

System.Int32

Specifies the number of sites that can be created before a warning event is generated and the owner of the site collection is notified.

The type must be a positive integer.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The New-SPContentDatabase cmdlet creates a new content database and attaches it to the specified Web application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

--------------EXAMPLE--------------------
Copy Code
New-SPContentDatabase "MyDatabase" -Server "MyServer" -WebApplication http://localhost

This example creates a new content database for the localhost Web application.


Remove-SPContentDatabase
Example
[image]

Deletes a content database.

Remove-SPContentDatabase -Identity <SPContentDatabasePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPContentDatabasePipeBind

Specifies the content database to delete.

The type must be a valid GUID, such as 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint content database (for example, SPContentDB1); or an instance of a valid SPContentDatabase object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPContentDatabase cmdlet deletes a content database. A content database must be dismounted before it can be deleted. Use the Dismount-SPContentDatabase cmdlet to detach a content database from a SharePoint Web application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

-----------------EXAMPLE---------------------
Copy Code
Get-SPContentDatabase 12345678-90ab-cdef-1234-567890abcdef | Remove-SPContentDatabase

This example deletes the specified content database.


Remove-SPSiteSubscriptionSettings
Example
[image]

Removes the settings service data for a specified site subscription, or finds and removes orphaned data.

Remove-SPSiteSubscriptionSettings -Identity <SPServiceApplicationPipeBind> -SiteSubscriptions <Guid[]> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]
Remove-SPSiteSubscriptionSettings -Identity <SPServiceApplicationPipeBind> -FindAllOrphans <SwitchParameter> [-AlternativeSiteSubscriptions <Guid[]>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the site subscription settings service application that contains the service data to delete.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a subscription settings service application (for example, SubscriptionSettingsApp1); or an instance of a valid SPSubscriptionSettingsServiceApplication object.

SiteSubscriptions

Required

System.Guid[]

Specifies the site subscriptions with the settings service data to delete.

The type must be an array of valid GUIDs.

The type must be an array of valid GUIDs.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the site subscription settings service application that contains the service data to delete.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a subscription settings service application (for example, SubscriptionSettingsApp1); or an instance of a valid SPSubscriptionSettingsServiceApplication object.

FindAllOrphans

Required

System.Management.Automation.SwitchParameter

Specifies that orphaned settings stores in the service application are deleted.

AlternativeSiteSubscriptions

Optional

System.Guid[]

Specifies the complete collection or comma-separated list of site subscriptions that should exist in the settings service application. Any data not matching the items in this list will be removed.

This parameter is important when the FindAllOrphans parameter is used. The value specified for AlternativeSiteSubscriptions parameter is stating that any site subscriptions not on the local farm will be deleted, unless an alternate list of site subscriptions is given.

The type must be an array of valid GUIDs.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Automatically bypasses the secondary warning provided by the cmdlet prior to the operation.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPSiteSubscriptionSettings cmdlet to delete site subscription stored data for the specified site subscription. If the FindAllOrphans parameter is specified, this cmdlet locates any data in the service application that does not exist in the list of local site subscriptions or the alternate list of subscriptions.

The set of site subscriptions can be specified directly, or discovered by comparing data in the service application to the set of existing site subscriptions which finds the data set that corresponds to nonexistent site subscriptions.

Important:
If this cmdlet is run on a federated service application without specifying the complete list of site subscription IDs for the AlternativeSiteSubscriptions parameter, data loss can result.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------EXAMPLE 1--------------
Copy Code
Remove-SPSiteSubscriptionSettings -FindAllOrphans -Whatif

This example finds all orphans and displays them on the screen. Remove the WhatIf parameter to remove these extra settings.

------------EXAMPLE 2--------------
Copy Code
Remove-SPSubscriptionSettingsServiceApplication -FindAllOrphans -AlternativeSiteSubscriptions $SubscriptionList

Use this example if the service application is consumed by a remote farm and you want the clean orphaned site subscription settings data (an array of all site subscriptions whose data must remain in the service application is assigned to the $SubscriptionList variable.


Remove-SPSolution
Example
[image]

Removes a SharePoint solution from a farm.

Remove-SPSolution -Identity <SPSolutionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-Language <UInt32>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSolutionPipeBind

Specifies the SharePoint solution to remove.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint solution (for example, SPSolution1); or an instance of a valid SPSolution object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Forces the removal of the SharePoint solution.

Language

Optional

System.UInt32

Removes solutions for the specified language only.

The type must be a valid identity of a language type.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPSolution cmdlet deletes a SharePoint solution from a farm. Use the Uninstall-SPSolution cmdlet to remove the solution files from the front-end Web server.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Remove-SPSolutionDeploymentLock
Example
[image]

Removes the solution deployment lock for a server.

Remove-SPSolutionDeploymentLock [-Identity <SPServerPipeBind>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPServerPipeBind

Specifies the server for which the solution deployment lock is to be removed.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; the IP address of a server computer, in the form 208.77.188.166; a valid name of a SQL Server host service (for example, SQLServerHost1); or an instance of a valid SPServer object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPSolutionDeploymentLock cmdlet removes the solution deployment lock for a server. If the Identity parameter is not specified, this cmdlet removes the solution deployment lock for all servers in the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPBusinessDataCatalogServiceApplication
Example
[image]

Sets global properties for a Business Data Catalog service application in the farm.

Set-SPBusinessDataCatalogServiceApplication [-ApplicationPool <SPIisWebServiceApplicationPool>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DatabaseCredentials <PSCredential>] [-DatabaseName <String>] [-DatabasePassword <SecureString>] [-DatabaseServer <String>] [-DatabaseUsername <String>] [-FailoverDatabaseServer <String>] [-Identity <SPServiceApplicationPipeBind>] [-Name <String>] [-Sharing <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

ApplicationPool

Optional

Microsoft.SharePoint.Administration.SPIisWebServiceApplicationPool

Specifies the IIS application pool to use for the new Business Data Catalog service application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of an application pool (for example, AppPoolName1); or an instance of a valid IISWebServiceApplicationPool object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

DatabaseCredentials

Optional

System.Management.Automation.PSCredential

Specifies the PSCredential object that contains the user name and password to be used for database SQL authentication.

The type must be a valid PSCredential object.

DatabaseName

Optional

System.String

Specifies the name of the Business Data Catalog database.

The type must be a valid name of a SQL Server database; for example, UsageLogDB1.

DatabasePassword

Optional

System.Security.SecureString

Specifies the password for the user specified in DatabaseUserName. Use this parameter only if SQL authentication is used to access the Business Data Catalog database.

The type must be a valid password.

DatabaseServer

Optional

System.String

Specifies the name of the Business Data Catalog database.

The type must be a valid name of a SQL Server database; for example, UsageLogDB1.

DatabaseUsername

Optional

System.String

Specifies the user name to use for connecting to the catalog database. Use this parameter only if SQL authentication is used to access the Business Data Catalog database.

The type must be a valid user name; for example, UserName1.

FailoverDatabaseServer

Optional

System.String

Specifies the name of the host server for the failover database server.

The type must be a valid SQL Server host name; for example, SQLServerHost1.

Identity

Optional

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the Business Data Catalog service application associated with the new proxy.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a subscription settings service application (for example, SubscriptionSettingsApp1); or an instance of a valid SPServiceApplication object.

Name

Optional

System.String

Specifies a display name for the new Business Data Catalog service application proxy. The string that specifies the URL can contain a maximum of 128 characters.

The type must be a valid name of a Business Data Catalog service application proxy; for example, BDCAppProxy1.

Sharing

Optional

System.Management.Automation.SwitchParameter

Specifies that the Business Data Catalog service application is published and shared across the farm.

AssignmentColletion

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPBusinessDataCatalogServiceApplication cmdlet sets global properties for a Business Data Catalog service application in the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPContentDatabase
Example
[image]

Sets global properties of a SharePoint content database.

Set-SPContentDatabase -Identity <SPContentDatabasePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-MaxSiteCount <Int32>] [-Status <Online | Disabled | Offline | Unprovisioning | Provisioning | Upgrading>] [-WarningSiteCount <Int32>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPContentDatabasePipeBind

Specifies the content database to update.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint content database (for example, SPContentDB1); or an instance of a valid SPContentDatabase object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

MaxSiteCount

Optional

System.Int32

Specifies the maximum number of site collections that this database can host.

The type must be a positive integer. Set to $null to clear this value.

Status

Optional

Microsoft.SharePoint.Administration.SPObjectStatus

Specifies the status of the SQL Server database. Set this parameter to Ready to make the database available to host new sites. Set this parameter to Offline to make the database unavailable to host new sites.

The type must be either of the following: Ready or Offline

WarningSiteCount

Optional

System.Int32

Specifies the number of site collections that can be created before a warning event is generated and the owner of the site collection is notified.

The type must be a positive integer. Set to $null to clear this value.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPContentDatabase cmdlet sets global properties of a SharePoint content database.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

---------------EXAMPLE 1---------------
Copy Code
Get-SPContentDatabase http://contoso.com | Set-SPContentDatabase -MaxSiteCount 1

This example sets the MaxSiteCount for the content database that contains contoso.com to 1.

---------------EXAMPLE 2---------------
Copy Code
Get-SPContentDatabase -WebApplication http://localhost | Set-SPContentDatabase -WarningSiteCount $null

This example clears the WarningSiteCount for all databases in the localhost Web application.


Set-SPTimerJob
Example
[image]

Sets the schedule for running a timer job.

Set-SPTimerJob -Identity <SPTimerJobPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Schedule <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPTimerJobPipeBind

Specifies the timer job to update.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a timer job (for example, TimerJob1); or an instance of a valid SPTimerJob object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Schedule

Required

System.String

Specifies the schedule for running the time timer job.

The type must be a valid Windows SharePoint Services Timer service (SPTimer) schedule in the form of any one of the following schedules:

  • Every 5 minutes between 0 and 59

  • Hourly between 0 and 59

  • Daily at 15:00:00

  • Weekly between Fri 22:00:00 and Sun 06:00:00

  • Monthly at 15 15:00:00

  • Yearly at Jan 1 15:00:00

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-TimerJob cmdlet sets the schedule for running a specified timer job.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Start-SPTimerJob
Example
[image]

Runs a timer job once.

Start-SPTimerJob -Identity <SPTimerJobPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPTimerJobPipeBind

Specifies the timer job to run.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a timer job (for example, TimerJob1); or an instance of a valid SPTimerJob object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Disable-TimerJob cmdlet runs a timer job once.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Uninstall-SPHelpCollection
Example
[image]

Removes Help collection files.

Uninstall-SPHelpCollection -Name <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Name

Required

System.String

Specifies the name of the Help collection files to uninstall.

The type must be a valid name of a Help collection; for example, HelpDocs1.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Uninstall-SPHelpCollection cmdlet removes the specified Help collection files from the product Help library in the current farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Uninstall-SPSolution
Example
[image]

Retracts a deployed SharePoint solution.

Uninstall-SPSolution -Identity <SPSolutionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Language <UInt32>] [-Local <SwitchParameter>] [-Time <String>] [-WhatIf [<SwitchParameter>]]

Uninstall-SPSolution -Identity <SPSolutionPipeBind> -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Language <UInt32>] [-Local <SwitchParameter>] [-Time <String>] [-WhatIf [<SwitchParameter>]]

Uninstall-SPSolution -Identity <SPSolutionPipeBind> -AllWebApplications <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Language <UInt32>] [-Local <SwitchParameter>] [-Time <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSolutionPipeBind

Specifies the SharePoint solution to uninstall.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint solution (for example, SPSolution1); or an instance of a valid SPSolution object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Language

Optional

System.UInt32

Uninstalls the solution for the specified language only.

The type must be a valid identity of a language type.

Local

Optional

System.Management.Automation.SwitchParameter

Uninstalls the solution package on the active server computer.

Time

Optional

System.String

Specifies when the solution will be uninstalled. The default value is immediate retraction.

The type must be a valid DateTime value, in the form 2010,12,05.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSolutionPipeBind

Specifies the SharePoint solution to uninstall.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint solution (for example, SPSolution1); or an instance of a valid SPSolution object.

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Uninstalls the SharePoint solution for the specified SharePoint Web application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or a valid name of a SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Language

Optional

System.UInt32

Uninstalls the solution for the specified language only.

The type must be a valid identity of a language type.

Local

Optional

System.Management.Automation.SwitchParameter

Uninstalls the solution package on the active server computer.

Time

Optional

System.String

Specifies when the solution will be uninstalled. The default value is immediate retraction.

The type must be a valid DateTime value, in the form 2010,12,05.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 3

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSolutionPipeBind

Specifies the SharePoint solution to uninstall.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint solution (for example, SPSolution1); or an instance of a valid SPSolution object.

AllWebApplications

Required

System.Management.Automation.SwitchParameter

Specifies that the new SharePoint solution is uninstalled for all SharePoint Web applications in the farm.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Language

Optional

System.UInt32

Uninstalls the solution for the specified language only.

The type must be a valid identity of a language type.

Local

Optional

System.Management.Automation.SwitchParameter

Uninstalls the solution package on the active server computer.

Time

Optional

System.String

Specifies when the solution will be uninstalled. The default value is immediate retraction.

The type must be a valid DateTime value, in the form 2010,12,05.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Uninstall-SPSolution cmdlet retracts a deployed SharePoint solution package. This cmdlet removes files from the front-end Web server. Use the Remove-SPSolution operation to delete the solution package in the solution store of the configuration, and call it only after solution packages are retracted.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Uninstall-SPUserSolution
Example
[image]

Deactivates a user solution on a site collection.

Uninstall-SPUserSolution -Identity <SPUserSolutionPipeBind> -Site <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPUserSolutionPipeBind

Specifies the user solution to deactivate.

The type must be a valid a valid name of a user solution (for example, UserSolution1); a valid URL of a site collection, in the form http://server_name; or an instance of a valid SPUserSolution object.

Site

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Deactivates the user solution for the specified site collection.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Uninstall-SPUserSolution cmdlet deactivates a user solution on a site collection. Use the Remove-SPUserSolution cmdlet to delete a user solution from the solutions gallery. A user solution is a SharePoint solution provided by Pacific Technical Consulting (PTC).

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Update-SPSolution
Example
[image]

Upgrades a deployed SharePoint solution.

Update-SPSolution -Identity <SPSolutionPipeBind> -LiteralPath <String> [-AssignmentCollection <SPAssignmentCollection>] [-CASPolicies <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-GACDeployment <SwitchParameter>] [-Local <SwitchParameter>] [-Time <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSolutionPipeBind

Specifies the SharePoint solution to deploy.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint solution (for example, SPSolution1); or an instance of a valid SPSolution object.

LiteralPath

Required

System.String

Specifies the path to the solution package.

The type must be a valid path in either of the following forms:

  • C:\folder_name

  • \\server_name\folder_name

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

CASPolicies

Optional

System.Management.Automation.SwitchParameter

Specifies that Code Access Security (CAS) policies can be deployed for the new SharePoint solution.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Forces the deployment of the new SharePoint solution.

GACDeployment

Optional

System.Management.Automation.SwitchParameter

Specifies that Global Assembly Cache (GAC) can be deployed for the new SharePoint solution.

Local

Optional

System.Management.Automation.SwitchParameter

Deploys the solution package on the local computer only.

Time

Optional

System.String

Specifies when the solution will be deployed. The default value is immediate deployment.

The type must be a valid DateTime value, in the form 2010, 5, 1.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Install-SPSolution cmdlet upgrades a deployed SharePoint solution package in the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Update-SPUserSolution
Example
[image]

Upgrades an activated user solution on a farm.

Update-SPUserSolution -Identity <SPUserSolutionPipeBind> -Site <SPSitePipeBind> -ToSolution <SPUserSolutionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPUserSolutionPipeBind

Specifies the user solution to upgrade.

The type must be a valid a valid name of a user solution (for example, UserSolution1); a valid URL of a site collection, in the form http://server_name; or an instance of a valid SPUserSolution object.

Site

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Upgrade the user solution for the specified site collection.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite object.

ToSolution

Required

Microsoft.SharePoint.PowerShell.SPUserSolutionPipeBind

Specifies the user solution to which to upgrade.

The type must be a valid a valid name of a user solution (for example, UserSolution1); a valid URL of a site collection, in the form http://server_name; or an instance of a valid SPUserSolution object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Update-SPUserSolution cmdlet upgrades an activated user solution on a farm. A user solution is a SharePoint solution provided by Pacific Technical Consulting (PTC). Before you use this cmdlet to upgrade the activated solution, use the SPUserSolution cmdlet to add the upgrade solution into the solution gallery.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Disable-SPWebApplicationHttpThrottling
Example
[image]

This is the introduction.

Disable-SPWebApplicationHttpThrottling -Identity <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Enter detail description

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example

Copy Code

            Click here to

      submit feedback
             on this topic.


Enable-SPWebApplicationHttpThrottling
Example
[image]

Turns on network throttling for a Web application.

Enable-SPWebApplicationHttpThrottling -Identity <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Turns on network throttling on the specified SharePoint Web application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or a valid name of a SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Enable-SPWebApplicationHttpThrottling cmdlet turns on network throttling for a Web application. This operation prompts you to confirm that you want to turn on network throttling.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPWebApplicationHttpThrottlingMonitor
Example
[image]

Sets the minimum and maximum thresholds for an existing network throttling counter.

Set-SPWebApplicationHttpThrottlingMonitor -Identity <SPWebApplicationPipeBind> -Category <String> -Counter <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Instance <String>] [-MaxThreshold <Single>] [-MinThreshold <Single>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the SharePoint Web application to update.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

Category

Required

System.String

Counter

Required

System.String

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Instance

Optional

System.String

MaxThreshold

Optional

System.Single

Specifies the upper limit of the numerical threshold of the specified performance counter.

MinThreshold

Optional

System.Single

Specifies the lower limit of the numerical threshold of the specified performance counter.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPWebApplicationHttpThrottlingMonitor cmdlet sets the minimum and maximum thresholds for an existing network throttling counter.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Connect-SPConfigurationDatabase
See Also Example
[image]

Connects the server computer to an existing configuration database.

Connect-SPConfigurationDatabase [-DatabaseName <String>] [-Passphrase <SecureString>] [-AssignmentCollection <SPAssignmentCollection>] [-DatabaseCredentials <PSCredential>] [-DatabaseServer <String>]

Parameters

Parameter Required Type Description

DatabaseName

Optional

System.String

Specifies the name for the configuration database to which to connect.

The type must be a valid database name; for example, DB1.

Passphrase

Optional

System.Security.SecureString

Specifies the passphrase for the farm being connected to.

The type must be a valid security string, in the form '???"

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

DatabaseCredentials

Optional

System.Management.Automation.PSCredential

Specifies the credentials for the database. If theee credentials are not provided, the current user is used.

DatabaseServer

Optional

A valid database server, such as "DS"

Specifies the server on which to create the configuration database. The default value is the local computer name.

Detailed Description

The Connect-SPConfigurationDatabase cmdlet connects the current server to the given configuration database.

Essentially, this cmdlet connects the server to the farm. The current computer cannot be connected to a farm, otherwise the following error message is displayed:

"This machine is already connected to a SharePoint farm. See: Dismount-SPConfigurationDatabase"

Note:
If no database username or password is provided, Windows authentication is used.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

  See Also
Dismount-SPConfigurationDatabase
Reference
Backup-SPConfigurationDatabase
Disconnect-SPConfigurationDatabase
New-SPConfigurationDatabase
Remove-SPConfigurationDatabase

            Click here to

      submit feedback
             on this topic.


Copy-SPBusinessDataCatalogAclToChildren
Example
[image]

Copies a set of permissions of a Business Data Catalog metadata object to its child objects.

Copy-SPBusinessDataCatalogAclToChildren -MetadataObject <MetadataObject> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

MetadataObject

Required

Microsoft.SharePoint.BusinessData.Administration.MetadataObject

Specifies the BDC metadata object.

The type must be a valid name of a BDC service metadata object; for example, BDCMetadata1.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Copy-SPBusinessDataCatalogAclToChildren cmdlet copies a set of rights of a Business Data Catalog metadata object to its child objects.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Export-SPBusinessDataCatalogModel
Example
[image]

Exports a Business Data Catalog model.

Export-SPBusinessDataCatalogModel -Identity <MetadataObject> -Path <String> [-AssignmentCollection <SPAssignmentCollection>] [-Force <SwitchParameter>] [-LocalizedNamesIncluded <SwitchParameter>] [-ModelsIncluded <SwitchParameter>] [-PermissionsIncluded <SwitchParameter>] [-PropertiesIncluded <SwitchParameter>] [-ProxiesIncluded <SwitchParameter>] [-SettingId <String>]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.BusinessData.Administration.MetadataObject

Specifies the Business Data Catalog metadata object.

The type must be a valid name of a Business Data Catalog service metadata object; for example, BDCMetadata1.

Path

Required

System.String

Specifies the path and name to use to create the export file.

The type must be a valid path in either of the following forms:

  • C:\folder_name

  • \\server_name\folder_name

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Force

Optional

System.Management.Automation.SwitchParameter

Overwrites the output file if the file exists.

LocalizedNamesIncluded

Optional

System.Management.Automation.SwitchParameter

Specifies that names for business data fields in multiple languages are exported.

ModelsIncluded

Optional

System.Management.Automation.SwitchParameter

Specifies that application definition files for models are included in the exported Business Data Catalog model. A model application definition file contains the base XML metadata for a system.

PermissionsIncluded

Optional

System.Management.Automation.SwitchParameter

Specifies that permissions from the application definition are exported.

PropertiesIncluded

Optional

System.Management.Automation.SwitchParameter

Specifies that properties from the application definition are exported.

ProxiesIncluded

Optional

System.Management.Automation.SwitchParameter

Specifies that proxies for Business Data Catalog service applications are exported.

SettingId

Optional

System.String

Specifies the model slice to export.

The type must be a valid string that identifies a model slice; for example, ModelSlice1.

Detailed Description

The Export-SPBusinessDataCatalogModel cmdlet exports a Business Data Catalog model to a specified file.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPBrowserCustomerExperienceImprovementProgram
Example
[image]

Returns the current opt-in state for the browser Customer Experience Improvement Program.

Get-SPBrowserCustomerExperienceImprovementProgram -Farm <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>]
Get-SPBrowserCustomerExperienceImprovementProgram -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>]
Get-SPBrowserCustomerExperienceImprovementProgram -SiteSubscription <SPSiteSubscriptionPipeBind> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Farm

Required

System.Management.Automation.SwitchParameter

Specifies that the opt-in state for the farm is returned by this cmdlet.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 2

Parameter

Required

Type

Description

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Returns the opt-in state for the specified SharePoint Web application.

The type must be a valid URL, in the form http://server_name; a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 3

Parameter

Required

Type

Description

SiteSubscription

Required

Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind

Returns the opt-in state for the specified site subscription.

The type must be a valid URL, in the form http://server_name; a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a site subscription (for example, SiteSubscription1); or an instance of a valid SiteSubscription object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPBrowserCustomerExperienceImprovementProgram cmdlet reads the current opt-in state for the browser Customer Experience Improvement Program.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
Get-SPBrowserCustomerExperienceImprovementProgram -WebApplication http://WebAppexample1

The following example returns the current Customer Experience Improvement Program opt-in state for the Web application, WebAppexample1.

------------------EXAMPLE 2-----------------------
Copy Code
Get-SPSiteSubscription http://SiteSubscription1 | Get- SPBrowserCustomerExperienceImprovementProgram

The following example returns the Customer Experience Improvement Program opt-in state for the site subscription, SiteSubscription1.


Get-SPBusinessDataCatalogMetadataObject
Example
[image]

Returns a Business Data Catalog metadata object.

Get-SPBusinessDataCatalogMetadataObject -BdcObjectType <Catalog | Model | LobSystem | LobSystemInstance | Entity> -ServiceContext <SPServiceContextPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Name <String>] [-Namespace <String>]

Parameters

Parameter Required Type Description

BdcObjectType

Required

Microsoft.SharePoint.BusinessData.SharedService.SPGetSPBusinessDataCatalogMetadataObjectCmdlet+PSBdcObjectType

Specifies the type of the metadata object to return.

The type must be one of the following valid metadata object types: BdcCatalog, Model, LobSystem, LobSystemInstance, or Entity.

ServiceContext

Required

Microsoft.SharePoint.PowerShell.SPServiceContextPipeBind

Specifies the service context of the Business Data Catalog metadata object models to return.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a service context (for example, ServiceContext1); or an instance of a valid SPServiceContext object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Name

Optional

System.String

Filters to return the Entity or Lobsystem metadata object of the Lobsysteminstance object.

The type must be a valid name of a metadata object; for example, EntityMetadata1.

Namespace

Optional

System.String

Specifies the LobSystem object that contains the metadata object to return. This parameter is required to retrieve all object types except LobSystem.

The type must be a valid name of a metadata object namespace; for example, EntityNamespace1.

Detailed Description

The Get-SPBusinessDataCatalogMetadataObject cmdlet reads a Business Data Catalog metadata object from a Business Data Catalog service application. Output for this cmdlet can be a series of objects. For example, you can specify a wildcard character (*) for the BdcObjectType parameter to return all metadata objects except Catalog and LobSystemInstance.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPBusinessDataCatalogThrottleConfig
Example
[image]

Returns the throttling configuration for a Business Data Catalog service application.

Get-SPBusinessDataCatalogThrottleConfig -Scope <Global | Database | WebService | Wcf | Custom> -ServiceApplicationProxy <SPServiceApplicationProxyPipeBind> -ThrottleType <None | Items | Size | Connections> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Scope

Required

Microsoft.BusinessData.SystemSpecific.ThrottleScope

Returns only the throttling configuration for the specified the scope.

The type must be one of the following: WCF, WebService, Database, WSS, or DotNetShim.

ServiceApplicationProxy

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationProxyPipeBind

Specifies the Business Data Catalog service application proxy that contains the throttling configuration to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a Business Data Catalog service application proxy (for example, BDCAppProxy1); or an instance of a valid SPServiceApplicationProxy object.

ThrottleType

Required

Microsoft.BusinessData.SystemSpecific.ThrottleType

Returns only the throttling configuration for the specified throttle type.

The type must be either of the following: Size or Rows.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPBusinessDataCatalogThrottleConfig cmdlet reads the throttling configuration for a Business Data Catalog service application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPCustomLayoutsPage
Example
[image]

Returns a mapping to a custom layout page.

Get-SPCustomLayoutsPage -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Identity <None | AccessDenied | Confirmation | Error | Login | RequestAccess | Signout | WebDeleted>]

Parameters

Parameter Required Type Description

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the SharePoint Web application that contains the custom layout page.

The type must be a valid URL, in the form http://server_name; a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Identity

Optional

Microsoft.SharePoint.Administration.SPWebApplication+SPCustomPage

Specifies the custom layout page to get.

The type must be one of the following: None, AccessDenied, Confirmation, Error, Login, RequestAccess, Signout, or WebDeleted.

Detailed Description

The Get-SPCustomLayoutsPagecmdlet cmdlet returns a mapping to a custom layout page in a Web application. If the Identity parameter is not specified, this cmdlet returns the collection of mappings for all custom layout pages.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Get-SPCustomLayoutsPage -Identity "_layouts/accessdenied.aspx" -WebApplication "http://server_name/mywebapp"

This example returns the mapping of the AccessDenied layout page in the Web application.


Get-SPDiagnosticsProvider
Example
[image]

Returns a diagnostic provider.

Get-SPDiagnosticsProvider [-Identity <SPDiagnosticsProviderPipeBind>] [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPDiagnosticsProviderPipeBind

Specifies the diagnostic provider to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a diagnostic provider (for example, DiagnosticProv1); or an instance of a valid SPDiagnosticsProvider object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPDiagnosticsProvider cmdlet reads the specified diagnostic provider. If the Identity parameter is not specified, this cmdlet returns the collection diagnostic providers in the farm.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Get-SPDiagnosticsProvider

This example returns all the diagnostic providers in the farm.

------------------EXAMPLE 2-----------------------
Copy Code
Get-SPDiagnosticsProvider job-diagnostics-event-log-provider

This example returns the event log diagnostic provider.


Get-SPServiceContext
Example
[image]

Returns a service context.

Get-SPServiceContext -Site <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>]
Get-SPServiceContext -SiteSubscription <SPSiteSubscriptionPipeBind> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Site

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Returns the service context for only the Web application that contains the specified site collection.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 2

Parameter

Required

Type

Description

Site

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Returns the service context for only the Web application that contains the specified site collection.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite object.

SiteSubscription

Required

Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind

Returns all of the service contexts for all Web applications in which the specified site subscription has site collections.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a site subscription (for example, SiteSubscriptionConfig1); or an instance of a valid SiteSubscription object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPServiceContext cmdlet returns a service context or a collection of service contexts. Specify the Site parameter to return a individual service context, or specify the SiteSubscription parameter to return a collection of service contexts.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPSiteSubscriptionConfig
Example
[image]

Returns the configuration properties of a site subscription.

Get-SPSiteSubscriptionConfig -Identity <SPSiteSubscriptionPipeBind> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind

Specifies the site subscription configuration to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; an SPSite (object or URL) of a site collection that is a member of the site subscription; or an instance of a valid SiteSubscription object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPSiteSubscriptionConfig cmdlet returns the configuration properties of a site subscription.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

---------------EXAMPLE---------------
Copy Code
Get-SPSiteSubscriptionConfig http://contoso.com | Select FeatureSet

This example gets the feature set ID for the site subscription that contains the SPSite at http://contoso.com.


Get-SPUsageDefinition
Example
[image]

Returns a usage definition object.

Get-SPUsageDefinition [-Identity <SPUsageDefinitionPipeBind>] [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

Identity

Optional

Microsoft.SharePoint.PowerShell.SPUsageDefinitionPipeBind

Specifies the usage definition object to get.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a usage definition (for example, SiteSubscriptionConfig1); or an instance of a valid SPUsageDefinition object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPUsageDefinition cmdlet reads a usage definition object. If the Identity parameter is not specified, this cmdlet returns the collection of usage definitions in the farm. A usage definition object defines a specific type of usage.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Grant-SPBusinessDataCatalogMetadataObject
Example
[image]

Grants a right to a principal for the specified Business Data Catalog object.

Grant-SPBusinessDataCatalogMetadataObject -Identity <MetadataObject> -Principal <String> -Right <Execute | Edit | SetPermissions | SelectableInClients> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-SettingId <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.BusinessData.Administration.MetadataObject

Specifies the Business Data Catalog metadata object that contains the principal.

The type must be a valid name of a Business Data Catalog service metadata object; for example, BDCMetadata1.

Principal

Required

System.String

Specifies the principal to whom the rights apply.

The type must be a valid name of a user principal name; for example, jeffsmith@fabrikam.com.

Right

Required

Microsoft.SharePoint.BusinessData.SharedService.SPGrantSPBusinessDataCatalogMetadataObjectCmdlet+PSBdcRight

Specifies the right to grant the principal.

The type must be one of the following valid PSBdcRight object types: All, Execute, Edit, SetPermissions, or SelectableInClients.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

SettingId

Optional

System.String

Specifies the model slice for which to grant the right.

The type must be a valid string that identifies a model slice; for example, ModelSlice1.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Grant-SPBusinessDataCatalogMetadataObject cmdlet grants the right to a specified principal (user) for a Business Data Catalog object. This cmdlet checks to verify that the Identity parameter is a valid IndividuallySecurableMetadata object.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Import-SPBusinessDataCatalogModel
Example
[image]

Imports a Business Data Catalog model.

Import-SPBusinessDataCatalogModel -Identity <MetadataObject> -Path <String> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Force <SwitchParameter>] [-LocalizedNamesIncluded <SwitchParameter>] [-ModelsIncluded <SwitchParameter>] [-PermissionsIncluded <SwitchParameter>] [-PropertiesIncluded <SwitchParameter>] [-ProxiesIncluded <SwitchParameter>] [-SettingId <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.BusinessData.Administration.MetadataObject

Specifies the Business Data Catalog metadata object to import.

The type must be a valid name of a Business Data Catalog service metadata object; for example, BDCMetadata1.

Path

Required

System.String

Specifies the path and name to use to create the export file.

The type must be a valid path in either of the following forms:

  • C:\folder_name

  • \\server_name\folder_name

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Force

Optional

System.Management.Automation.SwitchParameter

Overwrites the Business Data Catalog service metadata object, if the file exists.

LocalizedNamesIncluded

Optional

System.Management.Automation.SwitchParameter

Specifies that names for business data fields in multiple languages are imported.

ModelsIncluded

Optional

System.Management.Automation.SwitchParameter

Specifies that application definition files for models are included in the imported data catalog model. A model application definition file contains the base XML metadata for a system.

PermissionsIncluded

Optional

System.Management.Automation.SwitchParameter

Specifies that permissions from the application definition are imported.

PropertiesIncluded

Optional

System.Management.Automation.SwitchParameter

Specifies that properties from the application definition are imported.

ProxiesIncluded

Optional

System.Management.Automation.SwitchParameter

Specifies that proxies for Business Data Catalog service applications are imported.

SettingId

Optional

System.String

Specifies the model slice to import.

The type must be a valid string that identifies a model slice; for example, ModelSlice1.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Import-SPBusinessDataCatalogModel cmdlet imports a Business Data Catalog model to a specified file.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Initialize-SPResourceSecurity
Example
[image]

Enforces resource security on the local server.

Initialize-SPResourceSecurity [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Initialize-SPResourceSecurity cmdlet enforces resource security on the local server. This cmdlet enforces security for all resources, including files, folders, and registry keys.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Install-SPApplicationContent
Example
[image]

Copies shared application data to existing Web application folders.

Install-SPApplicationContent [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Install-SPApplicationContent cmdlet copies shared application data to existing Web application folders.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Remove-SPBusinessDataCatalogModel
Example
[image]

Deletes a Business Data Catalog model.

Remove-SPBusinessDataCatalogModel -Identity <MetadataObject> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.BusinessData.Administration.MetadataObject

Specifies the Business Data Catalog metadata object to remove.

The type must be a valid name of a Business Data Catalog service metadata object; for example, BDCMetadata1.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPBusinessDataCatalogModel cmdlet deletes a Business Data Catalog model.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Remove-SPBusinessDataCatalogThrottleConfig
Example
[image]

Deletes a throttling configuration for a Business Data Catalog service application.

Remove-SPBusinessDataCatalogThrottleConfig -Identity <ThrottleConfig> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.BusinessData.SharedService.ThrottleConfig

Specifies the throttling configuration to remove.

The type must be a valid name of a throttling configuration object; for example, ThrottlingConfig1.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPBusinessDataCatalogThrottleConfig deletes a throttling configuration for a Business Data Catalog service application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Remove-SPUserSolution
Example
[image]

Removes a user solution from the solution gallery.

Remove-SPUserSolution -Identity <String> -Site <SPSitePipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPUserSolutionPipeBind

Specifies the user solution to remove.

The type must be a valid name of a user solution (for example, UserSolution1); a valid URL of a site collection, in the form http://server_name; or an instance of a valid SPUserSolution object.

Site

Required

Microsoft.SharePoint.PowerShell.SPSitePipeBind

Remove the user solution for the specified site collection.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URL, in the form http://server_name; or an instance of a valid SPSite object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Remove-SPUserSolution cmdlet removes a user solution from the solution gallery. A user solution must be inactive before you can remove it from the solution gallery.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Revoke-SPBusinessDataCatalogMetadataObject
Example
[image]

Revokes a right to a principal user in the specified Business Data Catalog object.

Revoke-SPBusinessDataCatalogMetadataObject -Identity <MetadataObject> -Principal <String> -Right <Execute | Edit | SetPermissions | SelectableInClients> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-SettingId <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.BusinessData.Administration.MetadataObject

Specifies the Business Data Catalog metadata object that contains the principal.

The type must be a valid name of a Business Data Catalog service metadata object; for example, BDCMetadata1.

Principal

Required

System.String

Specifies the principal to whom the rights apply.

The type must be a valid name of a user principal name; for example, jeffsmith@fabrikam.com.

Right

Required

Microsoft.SharePoint.BusinessData.SharedService.SPGrantSPBusinessDataCatalogMetadataObjectCmdlet+PSBdcRight

Specifies the right to revoke the principal.

The type must be one of the following valid PSBdcRight object types: All, Execute, Edit, SetPermissions, or SelectableInClients.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

SettingId

Optional

System.String

Specifies the model slice for which to revoke the right.

The type must be a valid string that identifies a model slice; for example, ModelSlice1.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Revoke-SPBusinessDataCatalogMetadataObject cmdlet revokes a right granted to a principal user in the specified Business Data Catalog object.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPBrowserCustomerExperienceImprovementProgram
Example
[image]

Turns on or off the browser Customer Experience Improvement Program.

Set-SPBrowserCustomerExperienceImprovementProgram -Farm <SwitchParameter> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Enable <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Set-SPBrowserCustomerExperienceImprovementProgram -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Enable <SwitchParameter>] [-WhatIf [<SwitchParameter>]]
Set-SPBrowserCustomerExperienceImprovementProgram -SiteSubscription <SPSiteSubscriptionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-Enable <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Farm

Required

System.Management.Automation.SwitchParameter

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Enable

Optional

System.Management.Automation.SwitchParameter

Turns on the browser Customer Experience Improvement Program. The default value is True.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Sets the Customer Experience Improvement Program opt-in state for the specified SharePoint Web application.

The type must be a valid URL, in the form http://server_name; a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Enable

Optional

System.Management.Automation.SwitchParameter

Turns on the browser Customer Experience Improvement Program. The default value is True.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 3

Parameter

Required

Type

Description

SiteSubscription

Required

Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind

Sets the Customer Experience Improvement Program opt-in state for the specified site subscription.

The type must be a valid URL, in the form http://server_name; a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a site subscription (for example, SiteSubscription1); or an instance of a valid SiteSubscription object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

Enable

Optional

System.Management.Automation.SwitchParameter

Turns on the browser Customer Experience Improvement Program. The default value is True.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPBrowserCustomerExperienceImprovementProgram cmdlet turns on or off the browser Customer Experience Improvement Program for collecting software quality metrics.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
Set-SPBrowserCustomerExperienceImprovementProgram -Farm -Enable

This example turns on the browser Customer Experience Improvement Program for the farm.

------------------EXAMPLE 2-----------------------
Copy Code
Set-SPBrowserCustomerExperienceImprovementProgram -Farm -Enable:$False

This example turns off the browser Customer Experience Improvement Program for the farm.

------------------EXAMPLE 3-----------------------
Copy Code
Set-SPWebApplication http://MyOfficeApp1 | Get- SPBrowserCustomerExperienceImprovementProgram -Enable

This example turns on the browser Customer Experience Improvement Program for the Web application, MyOfficeApp1.


Set-SPBusinessDataCatalogMetadataObject
See Also Example
[image]

Sets the value of a property or attribute of a Business Data Connectivity Metadata Store metadata object

Set-SPBusinessDataCatalogMetadataObject -Identity <MetadataObject> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-PropertyName <String>] [-PropertyValue <String>] [-Remove <SwitchParameter>] [-SettingId <String>] [-WhatIf [<SwitchParameter>]]
Set-SPBusinessDataCatalogMetadataObject -Identity <MetadataObject> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DisplayName <String>] [-Remove <SwitchParameter>] [-SettingId <String>] [-WhatIf [<SwitchParameter>]]
Set-SPBusinessDataCatalogMetadataObject -Identity <MetadataObject> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-PropertyName <String>] [-Remove <SwitchParameter>] [-Remove <SwitchParameter>] [-SettingId <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.BusinessData.Administration.MetadataObject

Specifies the Business Data Connectivity Metadata Store metadata object to update.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

PropertyName

Optional

System.String

Specifies the name of the property to update.

The type must be a valid name of a Business Data Connectivity Metadata Store metadata object property; for example, BDCMetadataProp1.

PropertyValue

Optional

System.String

Sets the new value of the property specified in the PropertyName parameter.

Remove

Optional

System.Management.Automation.SwitchParameter

Removes the property specified in the PropertyName parameter.

SettingId

Optional

System.String

Specifies the model slice for which the property applies.

The type must be a valid string that identifies a model slice; for example, ModelSlice1.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.BusinessData.Administration.MetadataObject

Specifies the Business Data Connectivity Metadata Store metadata object to update.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DisplayName

Optional

System.String

Specifies the display name of the Business Data Connectivity Metadata Store metadata object.

The type must be a valid name of a Business Data Connectivity Metadata Store metadata object; for example, BDCMetadata1.

Remove

Optional

System.Management.Automation.SwitchParameter

Removes the property specified in the PropertyName parameter.

SettingId

Optional

System.String

Specifies the model slice for which the property applies.

The type must be a valid string that identifies a model slice; for example, ModelSlice1.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 3

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.BusinessData.Administration.MetadataObject

Specifies the Business Data Connectivity Metadata Store metadata object to update.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

PropertyName

Optional

System.String

Specifies the name of the property to update.

The type must be a valid name of a Business Data Connectivity Metadata Store metadata object property; for example, BDCMetadataProp1.

Remove

Optional

System.Management.Automation.SwitchParameter

Removes the property specified in the PropertyName parameter.

SettingId

Optional

System.String

Specifies the model slice for which the property applies.

The type must be a valid string that identifies a model slice; for example, ModelSlice1.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPBusinessDataCatalogMetadataObject cmdlet sets the value of a property or attribute of a Business Data Connectivity Metadata Store metadata object.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1------------------
Copy Code
$objectToSetOn = Get-SPBusinessDataCatalogMetadataObject -Namespace "ContosoDatabase" -Name "ContosoDatabase" -BdcObjectType "LobSystemInstance" -ServiceContext http://contoso

This example creates a property on the LobSystemInstance (External System Instance) of name ContosoDatabase. The property has the name ShowInSearchUI and a value of True.

------------------EXAMPLE 2------------------
Copy Code
Set-SPBusinessDataCatalogMetadataObject -Identity $objectToSetOn -PropertyName "ShowInSearchUI" -PropertyValue "True"

This example creates a property on the LobSystemInstance (External System Instance). The namespace parameter must be the name of the instance's LobSystem (External System). In this example, they share the same name.

See Also

Reference

Get-SPBusinessDataCatalogMetadataObject
Revoke-SPBusinessDataCatalogMetadataObject
Grant-SPBusinessDataCatalogMetadataObject


Set-SPBusinessDataCatalogThrottleConfig
Example
[image]

Sets the throttling configuration for a Business Data Catalog service application.

Set-SPBusinessDataCatalogThrottleConfig -Default <Int32> -Identity <ThrottleConfig> -Maximum <Int32> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]
Set-SPBusinessDataCatalogThrottleConfig -Enforced <SwitchParameter> -Identity <ThrottleConfig> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Default

Required

System.Int32

Specifies the default setting of the throttle configuration.

A valid integer.

Identity

Required

Microsoft.SharePoint.BusinessData.SharedService.ThrottleConfig

Specifies the throttle configuration to update.

The type must be a valid name of a throttling configuration object; for example, ThrottlingConfig1.

Maximum

Required

System.Int32

Specifies the maximum value of the throttling configuration setting.

A valid integer.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Parameter Set 2

Parameter

Required

Type

Description

Enforced

Required

System.Management.Automation.SwitchParameter

Specifies that the throttle configuration setting cannot be overridden.

Identity

Required

Microsoft.SharePoint.BusinessData.SharedService.ThrottleConfig

Specifies the throttle configuration to update.

The type must be a valid name of a throttling configuration object; for example, ThrottlingConfig1.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPBusinessDataCatalogThrottleConfig cmdlet sets the throttling configuration for a Business Data Catalog service application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPCentralAdministration
Example
[image]

Sets the port for the SharePoint Central Administration Web site.

Set-SPCentralAdministration -Port <Int32> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Port

Required

System.Int32

Specifies the administration port for the Central Administration site.

The type must be a valid port number; for example, 8080.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPCentralAdministration cmdlet sets the port for the Central Administration site.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPCustomLayoutsPage
Example
[image]

Maps a new path for a custom layout page.

Set-SPCustomLayoutsPage -Identity <None | AccessDenied | Confirmation | Error | Login | RequestAccess | Signout | WebDeleted> -RelativePath <String> -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Set-SPCustomLayoutsPage -Identity <None | AccessDenied | Confirmation | Error | Login | RequestAccess | Signout | WebDeleted> -Reset <SwitchParameter> -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.Administration.SPWebApplication+SPCustomPage

Specifies the custom layout page to set.

The type must be one of the following: None, AccessDenied, Confirmation, Error, Login, RequestAccess, Signout, or WebDeleted.

RelativePath

Required

System.String

Specifies the path of the custom layout page.

The type must be a valid path of a layout page, in the form _layouts/custompages/myaccessdenied.aspx.

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the SharePoint Web application that contains the custom layout page.

The type must be a valid URL, in the form http://server_name; a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

Microsoft.SharePoint.Administration.SPWebApplication+SPCustomPage

Specifies the custom layout page to set.

The type must be one of the following: None, AccessDenied, Confirmation, Error, Login, RequestAccess, Signout, or WebDeleted.

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the SharePoint Web application that contains the custom layout page.

The type must be a valid URL, in the form http://server_name; a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Set-SPCustomLayoutsPagecmdlet cmdlet maps a new path for a custom layout page in a Web application. If NULL is specified for the RelativePath parameter, this cmdlet removes the mapping for a custom layout page.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE-----------------------
Copy Code
Set-SPCustomLayoutsPage -Identity "_layouts/accessdenied.aspx" -RelativePath "_layouts/custompages/myaccessdenied.aspx" -WebApplication "http://server_name/mywebapp"

This example maps the specified path for the AccessDenied layout page in the Web application "http://server_name/mywebapp".


Set-SPDiagnosticsProvider
Example
[image]

Enables a diagnostics provider and updates its retention policy.

Set-SPDiagnosticsProvider -Identity <SPDiagnosticsProviderPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DaysRetained <Int32>] [-Enable <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPDiagnosticsProviderPipeBind

Specifies the diagnostic provider to update.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a diagnostic provider (for example, DiagnosticProv1); or an instance of a valid SPDiagnosticsProvider object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DaysRetained

Optional

System.Int32

Specifies the number of days to retain the data collected by a diagnostic provider.

The type must be a valid integer value in the range of 1 to 14.

Enable

Optional

System.Management.Automation.SwitchParameter

Turns on or off the specified diagnostic provider.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPDiagnosticsProvider cmdlet enables a diagnostics provider and updates its retention policy.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------------EXAMPLE 1-----------------------
Copy Code
Get-SPDiagnosticsProvider job-diagnostics-event-log-provider | Set-SPDiagnosticsProvider -Enable:$false
Copy Code
Get-SPDiagnosticsProvider job-diagnostics-event-log-provider

This example disables the event log diagnostic provider.

------------------EXAMPLE 2-----------------------
Copy Code
Get-SPDiagnosticsProvider job-diagnostics-event-log-provider | Set-SPDiagnosticsProvider -Enable -DaysRetained 10
Copy Code
Get-SPDiagnosticsProvider job-diagnostics-event-log-provider

This example enables the event log diagnostic provider and changes its retention policy to 10 days.


Set-SPServiceApplication
Example
[image]

Sets the default endpoint of a service application.

Set-SPServiceApplication -Identity <SPServiceApplicationPipeBind> -DefaultEndpoint <SPServiceEndpointPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPServiceApplicationPipeBind

Specifies the service application to update.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a subscription settings service application (for example, SubSettingsApp1); or an instance of a valid SPServiceApplication object.

DefaultEndpoint

Required

Microsoft.SharePoint.PowerShell.SPServiceEndpointPipeBind

Specifies the address of the default endpoint of the service application.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid URI of an endpoint address, in the form http://localhost:8003/servicemodelsamples/service; or an instance of a valid SPServiceEndpoint object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPServiceApplication cmdlet sets the default endpoint of a service application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPSiteSubscriptionConfig
Example
[image]

Sets the configuration properties of a site subscription.

Set-SPSiteSubscriptionConfig -Identity <SPSiteSubscriptionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-FeatureSet <SPFeatureSetPipeBind>] [-PassThru <SwitchParameter>] [-UserAccountDirectoryPath <String>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPSiteSubscriptionPipeBind

Specifies the site subscription configuration to update.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; an SPSite (object or URL) of a site collection that is a member of the site subscription; or an instance of a valid SiteSubscription object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

PassThru

Optional

System.Management.Automation.SwitchParameter

Specifies the output objec can be passed through the pipeline.

FeatureSet

Optional

Microsoft.SharePoint.PowerShell.SPFeatureSetPipeBind

Specifies the feature set that is associated with the site subscription.

Specify a null value to clear the current association.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or an instance of a valid SPFeatureSet object.

UserAccountDirectoryPath

Optional

System.String

Sets the site user account directory path to a specific organizational unit (OU) that is in the same domain as the site subscription.

The type must be a name of a distinguished OU; for example, OU=Contoso1, DC=OSGCorp,DC=local.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPSiteSubscriptionConfig cmdlet sets the configuration properties of a site subscription.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

------------EXAMPLE---------------
Copy Code
Set-SPSiteSubscription http://contoso.com -FeatureSet 12345678-90ab-cdef-1234-567890abcdef

This example sets the feature set of the entire site subscription that contains http://contoso.com with a feature set GUID.


Set-SPUsageDefinition
Example
[image]

Sets the retention period for a usage provider.

Set-SPUsageDefinition -Identity <SPUsageDefinitionPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-DaysRetained <Int32>] [-Enable <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.PowerShell.SPUsageDefinitionPipeBind

Specifies the usage definition object to update.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a usage definition (for example, SiteSubscriptionConfig1); or an instance of a valid SPUsageDefinition object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DaysRetained

Optional

System.Int32

The number of days that usage data for the usage provider is retained in the usage service database. The default value is 365.

The type must be a valid integer.

Enable

Optional

System.Management.Automation.SwitchParameter

Turns on the specified usage provider.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPUsageDefinition cmdlet sets the retention period for a specified usage provider. A usage definition object defines a specific type of usage provider.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Disable-SPBusinessDataCatalogEntity
Example
[image]

Deactivates an entity in the Business Data Catalog.

Disable-SPBusinessDataCatalogEntity -Identity <Entity> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.BusinessData.Administration.Entity

Specifies the administration entity in the Business Data Catalog to deactivate.

The type must be a valid name of a Business Data Catalog service metadata object; for example, BDCAdminEntity1.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Disable-SPBusinessDataCatalogEntity cmdlet to deactivate an entity in the Business Data Catalog.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example

Copy Code

            Click here to

      submit feedback
             on this topic.


Enable-SPBusinessDataCatalogEntity
Example
[image]

Activates an entity in the Business Data Catalog.

Enable-SPBusinessDataCatalogEntity -Identity <Entity> [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

Identity

Required

Microsoft.SharePoint.BusinessData.Administration.Entity

Specifies the administration entity in the Business Data Catalog to activate.

The type must be a valid name of a Business Data Catalog Service metadata object; for example, BDCAdminEntity1.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Enable-SPBusinessDataCatalogEntity cmdlet activates an entity in the Business Data Catalog.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPClaimProviderManager
Example
[image]

Returns a claim provider manager.

Get-SPClaimProviderManager [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPClaimProviderManager cmdlet reads a claim provider manager.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Get-SPDesignerSettings
See Also Example
[image]

Displays Microsoft SharePoint Designer 2010 features.

Get-SPDesignerSettings -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Required Type Description

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the Web application in which the settings will apply.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The Get-SPDesignerSettings cmdlet determines if SharePoint Designer 2010 features are enabled on the specified Web application.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

---------------------EXAMPLE------------------------

Copy Code
Get-SPDesignerSettings -webapplication http://contoso

This example retrieves the SharePoint Designer 2010 settings for the Web application, http://contoso.

See Also

Reference

Set-SPDesignerSettings

Click here to submit feedback on this topic.


Move-SPBlobStorageLocation
Example
[image]

Copies a Windows SharePoint Services 3.0 database using Remote Blob Storage (RBS).

Move-SPBlobStorageLocation -SourceDatabase <String> [-AssignmentCollection <SPAssignmentCollection>] [-BackupDatabase <String>] [-BackupFileName <String>] [-Confirm [<SwitchParameter>]] [-DebugMod <$true | $false>] [-DestDatabaseFilesBaseName <String>] [-DestinationDatabase <String>] [-DestinationDataSourceInstance <String>] [-Dir <String>] [-MasterPassword <String>] [-VerboseMod <$true | $false>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

SourceDatabase

Required

System.String

Specifies the name of the database on Windows Internal Database.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

BackupDatabase

Optional

System.String

Specifies the name of the database that is temporarily used. The source database is copied with the temporary name to the Windows Internal Database. If the BackupDatabase parameter is not specified, a source database name and a random GUID is created.

BackupFileName

Optional

System.String

Specifies the name of the backup file which will be used to make a copy of original database. If the BackupFileName pararmeter is not specified, a generated file name from the source database a random GUID is created.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

DestDatabaseFilesBaseName

Optional

System.String

Specifies the base name to generate file names for the destination database (that is, *.mdf or *.ldf files). If the DestDatabaseFilesBaseName parameter is not specified, the name specified in the DestinationDatabase parameter is used to automatically create a value.

DestinationDatabase

Optional

System.String

Specifies the name of the migrated database. If the DestinationDatabase parameter is not specified, the SourceDatabase parameter is used.

DestinationDataSourceInstance

Optional

System.String

Specifies the destination database instance name. The value in the SourceDatabase parameter is migrated to this instance. The database instance name should be Microsoft SQL Server 2008 with Service Pack 1 (SP1) version or higher. If the DestinationDataSourceInstance parameter is not specified, the local host name is used.

Dir

Optional

System.String

Used for all disk operations, including storing of temporary backups and database files (*.mdf) of a migrated database. If the Dir parameter is not specified, a default directory of destination SQL instance is used. The free space in this directory should be at least two times the size of source database.

MasterPassword

Optional

System.String

Specifies the master password on the destination database instance for the Remote BLOB Store (RBS) installation. If there is not an existing master password, the value specified is used to create a master password. If the MasterPassword parameter is not specified, a random value is used.

VerboseMod

Optional

System.Boolean

Generates verbose log output to command-line window. If the VerboseMod parameter is not specified, no output is displayed to the command-line window.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

Use the Move-SPBlobStorageLocation cmdlet to copy a Windows SharePoint Services 3.0 database into Microsoft SQL Server 2008 with Service Pack 1 (SP1) database instance using Remote Blob Storage (RBS). The database size limitation using SQL Server 2008 with SP1 is 4 Gigabyes (GB). If there is a Windows SharePoint Services 3.0 version of a database that is greater than 4 GB, the database cannot be copied directly into a database using SQL Server 2008 with SP1 . The Move-SPBlobStorageLocation cmdlet uses the advantage of RBS and copies databases larger than 4 GB. RBS stores the data in the disk and keeps the links to the data in the database, which results in a smaller database size.

For permissions and the most current information about Windows PowerShell for SharePoint Foundation 2010, see TechNet (http://go.microsoft.com/fwlink/?LinkId=163184).

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

-------------------EXAMPLE 1-----------------------
Copy Code
Move-SPBlobStorageLocation WSS_Content

This example copies the content database named WSS_Content from the Windows Internal Database to the same database name in Microsoft SQL Server 2008 Express using Remote Blob Storage.

-------------------EXAMPLE 2-----------------------
Copy Code
Move-SPBlobStorageLocation WSS_Content -DestinationDatabase WSS_V4_Content -BackupDatabase WSSBackupDB -VerboseMod:$true

This example copies the content database named WSS_Content from Windows Internal Database to a database in SQL Server 2008 Express. The name of new database will be WSS_V4_Content. During the move, the backup file name is WSSBackupDB. The output of this command displays log information to the command-line window.


New-SPClaimsPrincipal
Example
[image]

Creates a claims principal.

New-SPClaimsPrincipal -Identity <String> -IdentityType <WindowsSamAccountName | WindowsSecurityGroupSid | FormsUser | FormsRole | EncodedClaim> [-AssignmentCollection <SPAssignmentCollection>]
New-SPClaimsPrincipal -Identity <String> -IdentityProvider <SPIdentityProviderPipeBind> [-AssignmentCollection <SPAssignmentCollection>]
New-SPClaimsPrincipal -ClaimValue <String> [-ClaimType <String>] -IdentityProvider <SPIdentityProviderPipeBind> [-IndetifierClaim <SwitchParameter>] [-AssignmentCollection <SPAssignmentCollection>]
New-SPClaimsPrincipal -EncodedClaim <String> [-AssignmentCollection <SPAssignmentCollection>]
New-SPClaimsPrincipal -ClaimValue <String> -ClaimType <String> -ClaimsProvider <SPClaimProvider> [-AssignmentCollection <SPAssignmentCollection>]

Parameters

Parameter Set 1

Parameter

Required

Type

Description

Identity

Required

System.String

Specifies the name of the new claims principal.

The type must be a valid name of a claims principal.

IdentityType

Required

Microsoft.SharePoint.Administration.Claims.SPIdentifierTypes

Specifies the type of the new claims principal.

The type must be one of the following: WindowsSamAccountName, WindowsSecurityGroupSid, FormsUser, FormsRole, or EncodedClaim.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 2

Parameter

Required

Type

Description

Identity

Required

System.String

Specifies the name of the new claims principal.

The type must be a valid name of a claims principal.

IdentityProvider

Required

Microsoft.SharePoint.PowerShell.SPIdentityProviderPipeBind

Specifies the IP STS that issues the claims principal.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or a valid name of identity provider (for example, MyIDprovider1); or an instance of a valid SPIdentityProvider object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 3

Parameter

Required

Type

Description

ClaimValue

Required

System.String

Specifies the claim value of the claims object. The claims value specifies the user, group, or computer that the claim is authenticating.

The type must be a valid claim value; for example, john@contoso.com.

Identity

Required

System.String

Specifies the name of the new claims principal.

The type must be a valid name of a claims principal.

ClaimType

Required

System.String

Specifies the type of claim to create. The value I indicates a unique user identity claim, and the value C indicates all other claims.

The type must be either of the following values: I or C.

IdentityProvider

Required

Microsoft.SharePoint.PowerShell.SPIdentityProviderPipeBind

Specifies the IP STS that issues the claims principal.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or a valid name of identity provider (for example, MyIDprovider1); or an instance of a valid SPIdentityProvider object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 4

Parameter

Required

Type

Description

EncodedClaim

Required

System.String

Converts a simple claim to a full encoded claim.

The type must be a valid claim value; for example, i:001w|redmond\user.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Parameter Set 5

Parameter

Required

Type

Description

ClaimValue

Required

System.String

Specifies the claim value of the claims object. The claims value specifies the user, group, or computer that the claim is authenticating.

The type must be a valid claim value; for example, john@contoso.com.

ClaimType

Required

System.String

Specifies the type of claim to create. The value I indicates a unique user identity claim, and the value C indicates all other claims.

The type must be either of the following values: I or C.

ClaimsProvider

Required

Microsoft.SharePoint.Administration.Claims.SPClaimProvider

Specifies the security token service identity provider that will contain the claims principal.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or a valid name of identity provider (for example, MyIDprovider1); or an instance of a valid SPIdentityProvider object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Detailed Description

The New-SPClaimsPrincipal cmdlet creates a claims principal.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

Add code example.

Copy Code

            Click here to

      submit feedback
             on this topic.


Set-SPDesignerSettings
See Also Example
[image]

Sets Microsoft SharePoint Designer 2010 features.

Set-SPDesignerSettings -WebApplication <SPWebApplicationPipeBind> [-AllowDesigner <$true | $false>] [-AllowMasterPageEditing <$true | $false>] [-AllowRevertFromTemplate <$true | $false>] [-AssignmentCollection <SPAssignmentCollection>] [-Confirm [<SwitchParameter>]] [-ShowURLStructure <$true | $false>] [-WhatIf [<SwitchParameter>]]

Parameters

Parameter Required Type Description

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the Web application in which the settings will apply.

AllowDesigner

Optional

System.Boolean

Specifies whether to allow users to edit sites in a web application by using Microsoft SharePoint Designer 2010. The default value is True

AllowMasterPageEditing

Optional

System.Boolean

Specifies whether to allow site administrators to customize master pages and layout pages using Microsoft SharePoint Designer 2010. The default value is True.

AllowRevertFromTemplate

Optional

System.Boolean

Specifies whether to allow site administrators to detach pages from the original site definition using Microsoft SharePoint Designer 2010. The default value is True.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

Confirm

Optional

System.Management.Automation.SwitchParameter

Prompts you for confirmation before executing the command. For more information, type the following command: get-help about_commonparameters

ShowURLStructure

Optional

System.Boolean

Specifies whether to allow site administrators to manage the URL structure of their Web sites by using Microsoft SharePoint Designer 2010. The default value is True.

WhatIf

Optional

System.Management.Automation.SwitchParameter

Displays a message that describes the effect of the command instead of executing the command. For more information, type the following command: get-help about_commonparameters

Detailed Description

The Set-SPDesignerSettings cmdlet sets SharePoint Designer 2010 features on a specified Web application when the WebApplicaton is used.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

-------------------EXAMPLE--------------------

Copy Code
Set-SPDesignerSettings -WebApplication http://constoso -AllowRevertFromTemplate $False -AllowMasterPageEditing $False

This example disables the ability to detach pages from existing site definitions and to edit master pages and page layouts.

See Also

Reference

Get-SPDesignerSettings

Click here to submit feedback on this topic.


Test-SPContentDatabase
Example
[image]

Tests a content database.

Test-SPContentDatabase -Name <String> -WebApplication <SPWebApplicationPipeBind> [-AssignmentCollection <SPAssignmentCollection>] [-DatabaseCredentials <PSCredential>] [-ServerInstance <SPDatabaseServiceInstancePipeBind>]

Parameters

Parameter Required Type Description

Name

Required

System.String

Specifies the existing content database to test.

The type must be a valid name of a SharePoint content database; for example, SPContentDB1.

WebApplication

Required

Microsoft.SharePoint.PowerShell.SPWebApplicationPipeBind

Specifies the SharePoint Web application to use to test the content database.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or a valid name of SharePoint Web application (for example, MyOfficeApp1); or an instance of a valid SPWebApplication object.

AssignmentCollection

Optional

Microsoft.SharePoint.PowerShell.SPAssignmentCollection

Manages objects for the purpose of proper disposal. Use of objects, such as SPWeb or SPSite, can use large amounts of memory and use of these objects in Windows PowerShell scripts requires proper memory management. Using the SPAssignment object, you can assign objects to a variable and dispose of the objects after they are needed to free up memory. When SPWeb, SPSite, or SPSiteAdministration objects are used, the objects are automatically disposed of if an assignment collection or the Global parameter is not used.

Note:
When the Global parameter is used, all objects are contained in the global store. If objects are not immediately used, or disposed of by using the Stop-SPAssignment command, an out-of-memory scenario can occur.

DatabaseCredentials

Optional

System.Management.Automation.PSCredential

Specifies the PSCredential object that contains the user name and password to be used for database SQL authentication.

The type must be a valid PSCredential object.

ServerInstance

Optional

Microsoft.SharePoint.PowerShell.SPDatabaseServiceInstancePipeBind

Specifies the instance of the database service to use to test the specified content database.

The type must be a valid GUID, such as 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SQL Server instance (for example, DBSvrInstance1); or an instance of a valid SPDatabaseServiceInstance object.

Detailed Description

Use the Test-SPContentDatabase cmdlet to test a content database against a Web application to verify all customizations referenced within the content database are also installed in the web application. This cmdlet can be issued against a content database currently attached to the farm, or a content database that is not connected to the farm. It can be used to test content databases from Microsoft SharePoint Server 2010 and from the Microsoft Office SharePoint Server 2007 products.

Note:
The Test-SPContentDatabase cmdlet does not change any of the data or structure of the content database, but can cause load on the database while the checks are in progress, which could temporarily block use of the content database. This cmdlet should only be used against a content database that is currently under low or no usage.

Input Types

Return Types

Errors

Error | Description

Exceptions

Exceptions | Description

Example

----------------------------EXAMPLE------------------------------

Copy Code
Test-SPContentDatabase -Name WSS_Content_1 -ServerInstance SQLServer1 -WebApplication http://contoso.com

This example tests a content database that may or may not be currently attached to the farm.