Add-SCSQLDeployment

Adds a SQL Server deployment to a SQL Server profile.

Syntax

Add-SCSQLDeployment
   -AgentServiceRunAsAccount <VMMCredential>
   -SQLServiceRunAsAccount <VMMCredential>
   [-ReportingServiceRunAsAccount <VMMCredential>]
   [-DeploymentRunAsAccount <VMMCredential>]
   [-DeploymentTimeoutSeconds <Int32>]
   [-EnableNamedPipes <Boolean>]
   [-SARunAsAccount <VMMCredential>]
   [-SecurityMode <String>]
   [-EnableTCP <Boolean>]
   [-ProductKey <String>]
   -SQLProfile <SQLProfile>
   -Name <String>
   -InstanceID <String>
   -MediaSource <String>
   -SQLSysAdminMemberList <String[]>
   [-SQLConfigurationFile <Script>]
   [-InstanceName <String>]
   [-MergeSQLAnswerFile <Boolean>]
   [-RunAsynchronously]
   [-PROTipID <Guid>]
   [-JobVariable <String>]
   [<CommonParameters>]

Description

The Add-SCSQLDeployment cmdlet adds a Microsoft SQL Server deployment to a SQL Server profile.

Examples

Example 1: Add a SQL Server deployment to a SQL Server profile

PS C:\> $SQLProfile = Get-SCSQLProfile -Name "SQLProfile01"
PS C:\> $DeploymentRunAsProfile = Get-SCRunAsProfile -Name "NTSystemRAP"
PS C:\> $SARunAsProfile = Get-SCRunAsProfile -Name "SQLAdminRAP"
PS C:\> $SQLSvcsRunAsProfile = Get-SCRunAsProfile -Name "NTSystemRAP"
PS C:\> Add-SCSQLDeployment -SQLProfile $SQLProfile -Name "SQL Deployment 01" -MediaSource "C:\SQLMedia" -InstanceID "SysPrepSQL" -InstanceName "MSSQLSERVER" -DeploymentTimeoutSeconds 3600 -SQLAuthenticationType "SQLServerAuthentication" -EnableNamedPipes $True -EnableTCP $True -SQLSysAdminMemberList @("Contoso\SQLAdmins") -ProductKey $Null -AgentServiceRunAsProfile $SQLSvcsRunAsProfile -SQLServiceRunAsProfile $SQLSvcsRunAsProfile -DeploymentRunAsProfile $DeploymentRunAsProfile -SARunAsProfile $SARunAsProfile

The first command gets the SQL Server profile named SQLProfile01, and then stores that object in the $SQLProfile variable.

The second command gets the RunAsProfile named NTSystemRAP, and then stores that object in the $DeploymentRunAsProfile variable. For more information, type Get-Help Get-SCRunAsProfile. A subsequent command specifies this object to initiate and run the deployment.

The third command gets the RunAsProfile named SQLAdminRAP, and then stores that object in the $SARunAsProfile variable. A subsequent command defines this value as the system administrator credentials for the deployment.

The fourth command gets the RunAsProfile named NTSystemRAP, and then stores that object in the $SQLSvcsRunAsProfile variable. A subsequent command specifies this value as the service account for the SQL Server and SQL Server Agent Windows services,

The final command adds a SQL Server deployment named SQL Deployment 01 to the SQLProfile01 SQL profile. This command specifies RunAsProfile objects that previous commands stored in variables.

Parameters

-AgentServiceRunAsAccount

Specifies the Run As account that the SQL Server agent service uses.

Type:VMMCredential
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DeploymentRunAsAccount

Specifies the Run As account that this cmdlet uses to install SQL Server.

Type:VMMCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DeploymentTimeoutSeconds

Specifies the amount of time, in seconds, that the SQL Server deployment waits before it times out.

Type:Int32
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableNamedPipes

Indicates whether remote connections use named pipes.

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableTCP

Indicates whether remote connections use TCP/IP.

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InstanceID

Specifies the ID of a SQL Server deployment instance.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InstanceName

Specifies the name of the SQL Server Analysis Services (SSAS) database instance.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-JobVariable

Specifies a variable in which job progress is tracked and stored.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-MediaSource

Specifies a media source for the new SQL Server deployment.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-MergeSQLAnswerFile

Indicates whether this cmdlet merges the answer file together with guest operating system settings. The default value is $True. VMM console uses this parameter. Do not specify this parameter.

Type:Boolean
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Specifies the name of the SQL Server deployment that this cmdlet adds.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-ProductKey

Specifies the product key for the VMM Server. The product key is a 25-digit number that identifies the product license.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-PROTipID

Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.

Type:Guid
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ReportingServiceRunAsAccount

Specifies the Run As account that Reporting Services uses.

Type:VMMCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RunAsynchronously

Indicates that the job runs asynchronously so that control returns to the command shell immediately.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SARunAsAccount

Specifies the Run As account for the SQL Server system administrator password.

Type:VMMCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SecurityMode

Specifies the security mode for SQL Server. Valid values are: WindowsAuthentication and SQLServerAuthentication.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SQLConfigurationFile

Specifies the configuration file for the SQL Server deployment that this cmdlet adds.

Type:Script
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-SQLProfile

Specifies the SQL Server profile to which this cmdlet adds a SQL Server deployment.

Type:SQLProfile
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-SQLServiceRunAsAccount

Specifies the Run As account that the SQL Server service uses.

Type:VMMCredential
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-SQLSysAdminMemberList

Specifies an array of users who are SQL Server administrators.

Type:String[]
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

Outputs

SQLDeployment

This cmdlet returns a SQLDeployment object.