Setup command line trick

Setup command line trick

  • Comments 7
  • Likes

Here’s one trick you can use to build command line for installing SM components silently (e.g. for install them with some script file).

First of all if you execute command “setup.exe /?” command line parameters will be shown (see screenshot below), and you need to figure out which parameters you need to install your component and what their value should be.

But there is another way to do it. If you install your component successfully with UI you can use setup log files to figure out what command line parameters you need to use and what their values are.

First you need to find log file after your setup succeeded – just go to %temp% folder. Now open latest SCSMInstall0X.log file. In the file you can fine command line which was used to install components you choose. E.g.:

MSI (s) (D8:CC) [17:55:50:125]: Command Line: COMPANYNAME= USERNAME=asttest SEND_CEIP_REPORTS=1 ENABLE_ERROR_REPORTING=1 INSTALL_SM_PORTAL=0 INSTALL_SM_CONSOLE=1 INSTALL_SM_SERVER=1 INSTALL_SM_DW=0 INSTALLDIR=C:\Program Files\Microsoft System Center\Service Manager 2010 ADMIN_ROLE_GROUP=SMX\asttest ADMIN_ROLE_GROUP_FORDB=SMX\asttest SDK_USE_COMPUTER_ACCOUNT=1 INSTALL_SM_DATABASE=1 SM_DB_IS_LOCAL=1 MANAGEMENT_GROUP=sm002-1 SQLSVR_INSTANCE=SM002-1 SMDATABASENAME=ServiceManager DB_SIZE=2000 DB_DATA_DIR=C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA DB_LOG_DIR=C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA WORKFLOW_USE_COMPUTER_ACCOUNT=1 ADDLOCAL=SMCommon,SMServer,SMConsole,SMDatabase CURRENTDIRECTORY=C:\SMCDImage CLIENTUILEVEL=3 MSICLIENTUSESEXTERNALUI=1 CLIENTPROCESSID=46208

Even if this command line is truncated because of it is too long you can still find all you parameters value just a few lines below the command line. They look like this:

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Adding USERNAME property. Its value is 'asttest'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Modifying SEND_CEIP_REPORTS property. Its current value is '0'. Its new value: '1'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Modifying ENABLE_ERROR_REPORTING property. Its current value is '0'. Its new value: '1'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Adding INSTALLDIR property. Its value is 'C:\Program Files\Microsoft System Center\Service Manager 2010'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Adding ADMIN_ROLE_GROUP property. Its value is 'SMX\asttest'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Adding ADMIN_ROLE_GROUP_FORDB property. Its value is 'SMX\asttest'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Adding SM_DB_IS_LOCAL property. Its value is '1'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Adding MANAGEMENT_GROUP property. Its value is 'sm002-1'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Adding SQLSVR_INSTANCE property. Its value is 'SM002-1'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Modifying SMDATABASENAME property. Its current value is 'DWStagingAndConfig'. Its new value: 'ServiceManager'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Modifying DB_SIZE property. Its current value is '1000'. Its new value: '2000'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Adding DB_DATA_DIR property. Its value is 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Adding DB_LOG_DIR property. Its value is 'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA'.

MSI (s) (D8:CC) [17:55:50:134]: PROPERTY CHANGE: Adding ADDLOCAL property. Its value is 'SMCommon,SMServer,SMConsole,SMDatabase'.

Note: There are some things you should keep in mind:

·        Setup UI does some extra validation for parameters you provide, e.g. it verifies if SQL server instance is accessible, if user account can be authenticated and so on.

·        Parameters names in the log file are for msi, not for setup.exe itself, so they can be slightly different from what you see in setup help. What actually you are looking for are parameters values.

·        You need to add /Silent parameter to the command if you need to install product without UI.

·        Some keys are optional

Some examples

·        Install SM Server:

setup.exe /silent /install:Server /AdminRoleGroup:<DomainName>\<AccountName>

/CreateNewDatabase: /SqlServerInstance:<SQLServerInstance>

/ServiceRunUnderAccount:<DomainName>\<AccountName>\<AccountPassword>

/WorkflowAccount:<DomainName>\<AccountName>\<AccountPassword>

/ManagementGroupName:<ManagementGroupName> /EnableErrorReporting:No

/CustomerExperienceImprovementProgram:No

 

·        Restore SM Server (install use existing DB):

Setup.exe /Silent /Install:Portal

/UseExistingDatabase:<SqlServerInstance>:<ExistingServiceManagerDBName>

/ServiceRunUnderAccount:<DomainName>\<AccountName>\<AccountPassword>

/CustomerExperienceImprovementProgram:No /EnableErrorReporting:No

 

·        Install DW Server:

Setup.exe /silent /install:Datawarehouse /AdminRoleGroup:<DomainName>\<AccountName>

/CreateNewDatabase: /SqlServerInstance:<SQLServerInstance>

/ServiceRunUnderAccount:<DomainName>\<AccountName>\<AccountPassword>

/DatasourceAccount:<DomainName>\<AccountName>\<AccountPassword>

/ManagementGroupName:<ManagementGroupName>  /ReportingServer:<ServerName>

/ReportingWebServiceURL:<Virtual Dir Name> /EnableErrorReporting:No

/CustomerExperienceImprovementProgram:No

 

·        Install console only:

Setup.exe /silent /install:Console /EnableErrorReporting:No

/CustomerExperienceImprovementProgram:No

 

·        Install Portal:

Setup.exe /Silent /Install:Portal

/UseExistingDatabase:<SqlServerInstance>:<ExistingServiceManagerDBName>

/PortalWebSiteName:<PortalWebSiteName> /PortalWebSitePort:<PortNumber>

/PortalAccount:<domain\username\password> /CustomerExperienceImprovementProgram:No

/EnableErrorReporting:No

 

·        Upgrade any component

Setup.exe /silent /upgrade

 

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • Do you know the command line for silent console install? I use what /? gives but with no success..

  • To perform a silent installation of the SCSM Console you can use the following command line:

    start /w Setup.exe /silent /install:Console /EnableErrorReporting:No /CustomerExperienceImprovementProgram:No

    Using "start /w" will wait for setup.exe to exit before returning.  This is useful if you will be installing the Console as part of a larger script that installs other software.

    You can also point the Console to your SCSM server by adding a Registry key:

    reg add "HKEY_CURRENT_USER\Software\Microsoft\System Center\2010\Service Manager\Console\User Settings" /v SDKServiceMachine /t REG_SZ /d "ManagementServerName"

    Just replace "ManagementServerName" with the actual name of your SCSM management server.  Note that this setting is per user and would need to be run as the user account that will be using the Console.

  • When attempting to install via command-line in Windows XP, setup.exe pops the "Run As" box asking which credentials to use when running setup? How do you get around this as this makes a silent installation impossible.

  • Had the same problem as "ARay" in a managed desktop environment.  It appears that the main boot-strapper setup.exe calls to SetupWizard.exe in the Setup sub-folder; however, it's not passing the credentials of the invoker.  What I did to get around the problem was use a script to install the report viewer prerequisite and then used the setup.exe switches with setupwizard.exe instead.  This worked great for installing the Console and I assume would work for the other components as well.

  • Thanks, as noted in the comments a current user reg key is added for the managerment server.  Is there any way to specify it from the command line?

  • Did you try to install SCSM DW Server with databases on remote SQL? When I try to do this in unattended mode even if I add:

    /CreateNewDatabase: /SqlServerInstance:RemoteSQL\Instance

    the installer tries to find SQL on local machine!

    What else needs to be done?

  • OK. I figured it out...

    .../StgConfigSqlServerInstance:RmoteSQL /RepositorySqlServerInstance:RemoteSQL /DataMartSqlServerInstance:RemoteSQL

    I also found something from SCSM2012 that can be useful: technet.microsoft.com/.../hh519635.aspx