Setting Default Application Model Properties Using an SQL Script

AdminStudio 2021 | 21.0 | Application Manager

When a package is imported into the Application Catalog, AdminStudio inserts default values for various Microsoft System Center 2012 Configuration Manager application model properties which cannot be extracted from the imported package.

You can use an SQL script to set these default values. To do this, you just need to update an existing SQL script file (CustomDefaultValues.SQL) and then run that SQL file to update your Application Catalog. The defaults will then be applied to all new packages imported into the Application Catalog.

You can also choose to run the script each time you create a new Application Catalog.

Editing the CustomDefaultValues.SQL Script File
Adding the CustomDefaultValues.SQL Script to the Scripts Run During Application Catalog Creation

Editing the CustomDefaultValues.SQL Script File

To specify default values for application model properties, you need to modify the CustomDefaultValues.SQL script file, which can be found in the following location:

    C:\Program Files (x86)\AdminStudio\2021\Support\SQL_Scripts

Tip:If you run this script, all of the properties in the script file will be updated. If you want to update just a few of the properties, you can create a script file that only contains a subset of the properties and then run that script.

The following application model properties are defined in the CustomDefaultValues.SQL file:

Application Model Properties in the CustomDefaultValues.SQL File

Property

Values

SQl Statement to Set Default Value

AutoInstall

True

False

UPDATE [ASCMProperty] SET [DefaultValue]='True' WHERE Name='AutoInstall'

Classification

Desktop

Server

UPDATE [ASCMProperty] SET [DefaultValue]='Desktop' WHERE Name='Classification'

DisplaySupersedes

True

False

UPDATE [ASCMProperty] SET [DefaultValue]='False' WHERE Name='DisplaySupersedes'

DistributionPriority

High

Medium

Low

UPDATE [ASCMProperty] SET [DefaultValue]='Medium' WHERE Name='DistributionPriority'

EnforceBehaviour

BasedOnExitCode

NoAction

ProgramReboot

ForceReboot

UPDATE [ASCMProperty] SET [DefaultValue]='BasedOnExitCode' WHERE Name='EnforceBehaviour' AND [Class] = 'ASCMMsiUserExperience'

ExecuteTime

Any integer value

UPDATE [ASCMProperty] SET [DefaultValue]='120' WHERE Name='ExecuteTime' AND [Class] = 'ASCMMsiUserExperience'

FallbackToUnprotectedDP

True

False

UPDATE [ASCMProperty] SET [DefaultValue]='False' WHERE Name='FallbackToUnprotectedDP' AND [Class] = 'ASCMMSIContent'

InstallBehaviour

User

System

Any

UPDATE [ASCMProperty] SET [DefaultValue]='System' WHERE Name='InstallBehaviour' AND [Class] = 'ASCMMsiUserExperience'

InstallFolder

Any string value

UPDATE [ASCMProperty] SET [DefaultValue]='' WHERE Name='InstallFolder' AND [Class] = 'ASCMMsiInstaller'

LogonRequirement

True

Null

False

UPDATE [ASCMProperty] SET [DefaultValue]='Null' WHERE Name='LogonRequirement' AND [Class] = 'ASCMMsiUserExperience'

MaxExecuteTime

Any integer value

UPDATE [ASCMProperty] SET [DefaultValue]='60' WHERE Name='MaxExecuteTime' AND [Class] = 'ASCMMsiUserExperience'

OnFastNetwork

Download

DownloadContentForStreaming

UPDATE [ASCMProperty] SET [DefaultValue]='Download' WHERE Name='OnFastNetwork' AND [Class] = 'ASCMMSIContent'

OnSlowNetwork

DoNothing

Download

DownloadContentForStreaming

UPDATE [ASCMProperty] SET [DefaultValue]='DoNothing' WHERE Name='OnSlowNetwork' AND [Class] = 'ASCMMSIContent'

PeerCache

True

False

UPDATE [ASCMProperty] SET [DefaultValue]='True' WHERE Name='PeerCache' AND [Class] = 'ASCMMSIContent'

Note:To set the Allow client to share content on the same subnet property (for MSI or Script packages), pass PeerCache as a property name along with MSI/Script package ID.

To set the Enable peer-to-peer content distribution property (for an App-V package), pass PeerCache as a property name along with the App-V package ID.

PinOnClient

True

False

UPDATE [ASCMProperty] SET [DefaultValue]='True' WHERE Name='PinOnClient' AND [Class] = 'ASCMMSIContent'

PreferredDistribute

True

False

UPDATE [ASCMProperty] SET [DefaultValue]='False' WHERE Name='PreferredDistribute'

PrestagedDPSetting

Auto

OnlyContentChange

ManualCopy

UPDATE [ASCMProperty] SET [DefaultValue]='ManualCopy' WHERE Name='PrestagedDPSetting'

ProgramVisibility

Maximized

Normal

Minimized

Hidden

UPDATE [ASCMProperty] SET [DefaultValue]='Hidden' WHERE Name='ProgramVisibility' AND [Class] = 'ASCMMsiUserExperience'

RequireLoad

True

False

UPDATE [ASCMProperty] SET [DefaultValue]='False' WHERE Name='RequireLoad' AND [Class] = 'ASCMMSIContent'

RequiresUserInteraction

True

False

UPDATE [ASCMProperty] SET [DefaultValue]='False' WHERE Name='RequiresUserInteraction'

RunAs32

True

False

UPDATE [ASCMProperty] SET [DefaultValue]='False' WHERE Name='RunAs32' AND [Class] = 'ASCMMsiInstaller'

SourceUpdateProductCode

Any valid GUID

UPDATE [ASCMProperty] SET [DefaultValue]='' WHERE Name='SourceUpdateProductCode' AND [Class] = 'ASCMMsiInstaller'

UninstallCommandLine

Any string value

UPDATE [ASCMProperty] SET [DefaultValue]='' WHERE Name='InstallCommandLine' AND [Class] = 'ASCMMsiInstaller'

UninstallCommandLine

Any string value

UPDATE [ASCMProperty] SET [DefaultValue]='' WHERE Name='UninstallCommandLine' AND [Class] = 'ASCMMsiInstaller'

UninstallFolder

Any string value

UPDATE [ASCMProperty] SET [DefaultValue]='' WHERE Name='InstallFolder' AND [Class] = 'ASCMMsiInstaller'

Adding the CustomDefaultValues.SQL Script to the Scripts Run During Application Catalog Creation

When you create a new Application Catalog, the scripts listed in the <Create> section under <AdminStudio> in the Upgrade.xml file are run. The Upgrade.xml file is found in the following location:

C:\Program Files (x86)\AdminStudio\2021\Support

If you want to use an SQL script to set the default Application Model properties for all applications that are imported into a new Application Catalog, you need to add the name of the CustomDefaultValues.SQL file to this script.

To add the CustomDefaultValues.SQL script to the Upgrade.xml file:

1. Edit the CustomDefaultValues.SQL script file, as described in Editing the CustomDefaultValues.SQL Script File, and copy it to the following location:

C:\Program Files (x86)\AdminStudio\2021\Support\SQL_Scripts

2. Open the following file in a text editor:

C:\Program Files (x86)\AdminStudio\2021\Support\Upgrade.xml

3. Locate the <AdminStudio> element in the Upgrade.xml file.
4. Add the CustomDefaultValues.SQL file to the list of scripts in the <SQLServer> child element of the <Create> element, as highlighted below:

<AdminStudio>

  <Version version="12.01" target="13286599"/>

  <Create>

    <SQLServer>

      <Script internal="yes">AS_System_Schema.SQL</Script>

      <Script>Seed_Data.SQL</Script>

      <!-- <Script internal="no">AS_Schema.sql</Script> -->

      <!-- MUST RUN CustomReportWizard.SQL LAST-->

      <Script>CustomReportWizard.SQL</Script>

      <Script>AS_TestCenter.sql</Script>

      <Script>AS_TestEngine.sql</Script>

      <Script>Reporting.StoredProcedures.sql</Script>

      <Script>CustomDefaultValues.SQL</Script>

    </SQLServer>

    ...

  </Create>

5. Save the Upgrade.xml file. The next time you create a new Application Catalog, the CustomDefaultValues.SQL script will be run, setting the default application model properties that you have defined.