none
Install SQL 2012 remotely with powershell RRS feed

  • Question

  • Hi everyone,

    i am trying to install SQL 2012 Std via a remote Powershell session. I already opened a thread over in the powershell forum

    http://social.technet.microsoft.com/Forums/en-US/30360bd7-b9cd-4838-b3f3-c33a321e2ea2/sql-2012-installation-on-a-remote-server-wo-ad-trust-and-psremoting?forum=winserverpowershell

    But maybe you guys over here know the answere to this.

    With this script

    $Username = "Administrator"
    $Password = "*****"

    #Create remote Session

    $securePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force
    $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $userName, $securePassword
    Invoke-Command -ComputerName 10.240.193.9 -credential $cred -scriptblock {
    c:\Temp\SQL2012Std\Setup.exe /q /ACTION=Install /FEATURES=SQLEngine /INSTALLSQLDATADIR="e:\MSSQLServer\SQL" /INSTALLSHAREDDIR="e:\MSSQLServer\share" /INSTALLSHAREDWOWDIR="e:\MSSQLServer\shareWOW" /INSTANCENAME=projectroom /INSTANCEDIR="f:\data\sql\projectroom" /SQLSVCACCOUNT="Administrator" /SQLSVCPASSWORD="Ipx1234" /SQLSYSADMINACCOUNTS="Administrator","Administrator" /AGTSVCACCOUNT="Administrator" /AGTSVCPASSWORD="****" /TCPENABLED=1 /IACCEPTSQLSERVERLICENSETERMS /SQLCOLLATION="Latin1_General_CI_AS_KS_WS" /PID="******"
    }

    I am trying to install SQL and i am getting this result:

    The following error occurred:
    There was an error generating the XML document.

    Error result: -2068774911
    Result facility code: 1201
    Result error code: 1

    Please review the summary.txt log for further details
    Microsoft (R) SQL Server 2012 11.00.2100.60

    This is the content of Summary.txt

    Overall summary:
      Final result:                  Failed: see details below
      Exit code (Decimal):           -2068774911
      Exit facility code:            1201
      Exit error code:               1
      Exit message:                  There was an error generating the XML document.
      Start time:                    2013-10-10 15:15:44
      End time:                      2013-10-10 15:16:52
      Requested action:              Install
      Exception help link:           http://go.microsoft.com/fwlink?LinkId=20476&ProdName=Microsoft+SQL+Server&EvtSrc=setup.rll&EvtID=50000&ProdVer=11.0.2100.60&EvtType=0xE0C083E6%400xF80B8030&EvtType=0xE0C083E6%400xF80B8030

    Setup completed with required actions for features.
    Troubleshooting information for those features:
      Next step for SQLEngine:       SQL Server Setup was canceled before completing the operation. Try the setup process again.
      Next step for Writer:          SQL Server Setup was canceled before completing the operation. Try the setup process again.
      Next step for Browser:         SQL Server Setup was canceled before completing the operation. Try the setup process again.


    Machine Properties:
      Machine name:                 server01
      Machine processor count:       4
      OS version:                    Future Windows Version
      OS service pack:               
      OS region:                     United States
      OS language:                   English (United States)
      OS architecture:               x64
      Process architecture:          64 Bit
      OS clustered:                  No

    Product features discovered:
      Product              Instance             Instance ID                    Feature                                  Language             Edition              Version         Clustered
      SQL Server 2012      SQLSTD               MSSQL11.SQLSTD                 Database Engine Services                 1033                 Standard Edition     11.0.2100.60    No        
      SQL Server 2012      SQLSTD               MSSQL11.SQLSTD                 SQL Server Replication                   1033                 Standard Edition     11.0.2100.60    No        
      SQL Server 2012      SQLSTD               MSSQL11.SQLSTD                 Full-Text and Semantic Extractions for Search 1033                 Standard Edition     11.0.2100.60    No        
      SQL Server 2012      SQLSTD               MSRS11.SQLSTD                  Reporting Services - Native              1033                 Standard Edition     11.0.2100.60    No        

    Package properties:
      Description:                   Microsoft SQL Server 2012
      ProductName:                   SQL Server 2012
      Type:                          RTM
      Version:                       11
      SPLevel:                       0
      Installation location:         C:\Temp\SQL2012Std\x64\setup\
      Installation edition:          Standard

    Product Update Status:
      None discovered.

    User Input Settings:
      ACTION:                        Install
      ADDCURRENTUSERASSQLADMIN:      false
      AGTSVCACCOUNT:                 Administrator
      AGTSVCPASSWORD:                *****
      AGTSVCSTARTUPTYPE:             Manual
      ASBACKUPDIR:                   Backup
      ASCOLLATION:                   Latin1_General_CI_AS
      ASCONFIGDIR:                   Config
      ASDATADIR:                     Data
      ASLOGDIR:                      Log
      ASPROVIDERMSOLAP:              1
      ASSERVERMODE:                  MULTIDIMENSIONAL
      ASSVCACCOUNT:                  <empty>
      ASSVCPASSWORD:                 <empty>
      ASSVCSTARTUPTYPE:              Automatic
      ASSYSADMINACCOUNTS:            <empty>
      ASTEMPDIR:                     Temp
      BROWSERSVCSTARTUPTYPE:         Automatic
      CLTCTLRNAME:                   <empty>
      CLTRESULTDIR:                  <empty>
      CLTSTARTUPTYPE:                0
      CLTSVCACCOUNT:                 <empty>
      CLTSVCPASSWORD:                <empty>
      CLTWORKINGDIR:                 <empty>
      COMMFABRICENCRYPTION:          0
      COMMFABRICNETWORKLEVEL:        0
      COMMFABRICPORT:                0
      CONFIGURATIONFILE:             
      CTLRSTARTUPTYPE:               0
      CTLRSVCACCOUNT:                <empty>
      CTLRSVCPASSWORD:               <empty>
      CTLRUSERS:                     <empty>
      ENABLERANU:                    false
      ENU:                           true
      ERRORREPORTING:                false
      FEATURES:                      SQLENGINE
      FILESTREAMLEVEL:               0
      FILESTREAMSHARENAME:           <empty>
      FTSVCACCOUNT:                  <empty>
      FTSVCPASSWORD:                 <empty>
      HELP:                          false
      INDICATEPROGRESS:              false
      INSTALLSHAREDDIR:              C:\Program Files\Microsoft SQL Server\
      INSTALLSHAREDWOWDIR:           C:\Program Files (x86)\Microsoft SQL Server\
      INSTALLSQLDATADIR:             e:\MSSQLServer\SQL
      INSTANCEDIR:                   f:\data\sql\projectroom
      INSTANCEID:                    PROJECTROOM
      INSTANCENAME:                  PROJECTROOM
      ISSVCACCOUNT:                  NT AUTHORITY\Network Service
      ISSVCPASSWORD:                 <empty>
      ISSVCSTARTUPTYPE:              Automatic
      MATRIXCMBRICKCOMMPORT:         0
      MATRIXCMSERVERNAME:            <empty>
      MATRIXNAME:                    <empty>
      NPENABLED:                     0
      PID:                           *****
      QUIET:                         true
      QUIETSIMPLE:                   false
      ROLE:                          
      RSINSTALLMODE:                 DefaultNativeMode
      RSSHPINSTALLMODE:              DefaultSharePointMode
      RSSVCACCOUNT:                  <empty>
      RSSVCPASSWORD:                 <empty>
      RSSVCSTARTUPTYPE:              Automatic
      SAPWD:                         <empty>
      SECURITYMODE:                  <empty>
      SQLBACKUPDIR:                  <empty>
      SQLCOLLATION:                  Latin1_General_CI_AS_KS_WS
      SQLSVCACCOUNT:                 Administrator
      SQLSVCPASSWORD:                *****
      SQLSVCSTARTUPTYPE:             Automatic
      SQLSYSADMINACCOUNTS:           Administrator, Administrator
      SQLTEMPDBDIR:                  <empty>
      SQLTEMPDBLOGDIR:               <empty>
      SQLUSERDBDIR:                  <empty>
      SQLUSERDBLOGDIR:               <empty>
      SQMREPORTING:                  false
      TCPENABLED:                    1
      UIMODE:                        Normal
      UpdateEnabled:                 true
      UpdateSource:                  MU
      X86:                           false

      Configuration file:            C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131010_151350\ConfigurationFile.ini

    Detailed results:
      Feature:                       Database Engine Services
      Status:                        Failed: see logs for details
      Reason for failure:            Setup was canceled for the feature.
      Next Step:                     SQL Server Setup was canceled before completing the operation. Try the setup process again.

      Feature:                       SQL Writer
      Status:                        Failed: see logs for details
      Reason for failure:            Setup was canceled for the feature.
      Next Step:                     SQL Server Setup was canceled before completing the operation. Try the setup process again.

      Feature:                       SQL Browser
      Status:                        Failed: see logs for details
      Reason for failure:            Setup was canceled for the feature.
      Next Step:                     SQL Server Setup was canceled before completing the operation. Try the setup process again.

    Rules with failures:

    Global rules:

    Scenario specific rules:

    Rules report file:               C:\Program Files\Microsoft SQL Server\110\Setup Bootstrap\Log\20131010_151350\SystemConfigurationCheck_Report.htm

    Exception summary:
    The following is an exception stack listing the exceptions in outermost to innermost order
    Inner exceptions are being indented

    Exception type: Microsoft.SqlServer.Chainer.Infrastructure.ChainerInfrastructureException
        Message:
            There was an error generating the XML document.
        HResult : 0x84b10001
            FacilityCode : 1201 (4b1)
            ErrorCode : 1 (0001)
        Data:
          DisableWatson = true
        Stack:
            at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)
            at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.FlushCache(Boolean removeAllCachedObj)
            at Microsoft.SqlServer.Configuration.SetupExtension.DatastoreCacheFeatureConfigEventHandler.InConfigurationActionExecutionEventHandler(Object sender, FeatureConfigScenarioEventArgs eventArgs)
            at Microsoft.SqlServer.Chainer.Infrastructure.NotificationHandler.Invoke(Object notification, Object[] objectArray)
            at Microsoft.SqlServer.Configuration.ConfigExtension.ConfigFeatureActionListener.InConfigurationActionExecutionEventHandler(ActionKey key, TextWriter loggingStream)
            at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionMetadata.NotifyInExecution(ActionKey actionRunning, TextWriter loggingStream)
            at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.InvokeAction(WorkflowObject metabase, TextWriter statusStream)
            at Microsoft.SqlServer.Setup.Chainer.Workflow.PendingActions.InvokeActions(WorkflowObject metaDb, TextWriter loggingStream)
            at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionEngine.RunActionQueue()
            at Microsoft.SqlServer.Chainer.TimingConfigAction.Execute(String actionId, TextWriter errorStream)
            at Microsoft.SqlServer.Setup.Chainer.Workflow.ActionInvocation.ExecuteActionHelper(TextWriter statusStream, ISequencedAction actionToRun, ServiceContainer context)
        Inner exception type: System.InvalidOperationException
            Message:
                    There was an error generating the XML document.
            Stack:
                    at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
                    at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o)
                    at Microsoft.SqlServer.Chainer.Infrastructure.DataStoreService.SerializeObject(String rootPath, Object objectToSerialize, Boolean saveToCache)
            Inner exception type: System.Security.Cryptography.CryptographicException
                Message:
                            Access is denied.
                            
                Stack:
                            at System.Security.Cryptography.ProtectedData.Protect(Byte[] userData, Byte[] optionalEntropy, DataProtectionScope scope)
                            at Microsoft.SqlServer.Common.SqlSecureString.WriteXml(XmlWriter writer)
                            at System.Xml.Serialization.XmlSerializationWriter.WriteSerializable(IXmlSerializable serializable, String name, String ns, Boolean isNullable, Boolean wrapped)
                            at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlEngineSetupPublic.Write7_SqlEngineSetupPublic(String n, String ns, SqlEngineSetupPublic o, Boolean isNullable, Boolean needType)
                            at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterSqlEngineSetupPublic.Write8_SqlEngineSetupPublic(Object o)

    Any ideas?

    Thursday, October 10, 2013 1:35 PM

Answers

  • Hi, thanks for your reply. No i am deplyoing it on a Server 2012 Server.

    I have found the solution to make this work.

    I just have to run the Invoke-Command with the "-Authentication CredSSP" option and everything works fine

    $Username = "Administrator"
    $Password = "*****"

    #Create remote Session

    $securePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force
    $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $userName, $securePassword
    Invoke-Command -ComputerName 10.240.193.9 -Authentication CredSSP -credential $cred -scriptblock {
    c:\Temp\SQL2012Std\Setup.exe /q /ACTION=Install /FEATURES=SQLEngine /INSTALLSQLDATADIR="e:\MSSQLServer\SQL" /INSTALLSHAREDDIR="e:\MSSQLServer\share" /INSTALLSHAREDWOWDIR="e:\MSSQLServer\shareWOW" /INSTANCENAME=projectroom /INSTANCEDIR="f:\data\sql\projectroom" /SQLSVCACCOUNT="Administrator" /SQLSVCPASSWORD="Ipx1234" /SQLSYSADMINACCOUNTS="Administrator","Administrator" /AGTSVCACCOUNT="Administrator" /AGTSVCPASSWORD="****" /TCPENABLED=1 /IACCEPTSQLSERVERLICENSETERMS /SQLCOLLATION="Latin1_General_CI_AS_KS_WS" /PID="******"
    }

    Thanks anyway :)

    Thursday, October 10, 2013 3:37 PM

All replies

  • Hi,

    Are you installing SQL on your laptop? if yes, then your laptop has a password to login?


    Thanks & Regards RAJUKIRAN L Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers.

    Thursday, October 10, 2013 3:30 PM
  • Hi, thanks for your reply. No i am deplyoing it on a Server 2012 Server.

    I have found the solution to make this work.

    I just have to run the Invoke-Command with the "-Authentication CredSSP" option and everything works fine

    $Username = "Administrator"
    $Password = "*****"

    #Create remote Session

    $securePassword = ConvertTo-SecureString -String $Password -AsPlainText -Force
    $cred = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $userName, $securePassword
    Invoke-Command -ComputerName 10.240.193.9 -Authentication CredSSP -credential $cred -scriptblock {
    c:\Temp\SQL2012Std\Setup.exe /q /ACTION=Install /FEATURES=SQLEngine /INSTALLSQLDATADIR="e:\MSSQLServer\SQL" /INSTALLSHAREDDIR="e:\MSSQLServer\share" /INSTALLSHAREDWOWDIR="e:\MSSQLServer\shareWOW" /INSTANCENAME=projectroom /INSTANCEDIR="f:\data\sql\projectroom" /SQLSVCACCOUNT="Administrator" /SQLSVCPASSWORD="Ipx1234" /SQLSYSADMINACCOUNTS="Administrator","Administrator" /AGTSVCACCOUNT="Administrator" /AGTSVCPASSWORD="****" /TCPENABLED=1 /IACCEPTSQLSERVERLICENSETERMS /SQLCOLLATION="Latin1_General_CI_AS_KS_WS" /PID="******"
    }

    Thanks anyway :)

    Thursday, October 10, 2013 3:37 PM