Microsoft 2019 For Mac Installer Stuck Running Package Scripts

-->

Applies to: Configuration Manager (current branch)

Configuration Manager continues to support packages and programs that were used in Configuration Manager 2007. A deployment that uses packages and programs might be more suitable than an application when you deploy any of the following tools or scripts:

  • Administrative tools that don't install an application on a computer
  • 'One-off' scripts that don't need to be continually monitored
  • Scripts that run on a recurring schedule and can't use global evaluation

Nov 29, 2011 Every single time I would get stuck at 'Running package scripts' - I even left it overnight on the third try to no avail. Each time I would just do the hard shut down (holding down the power button for a few seconds), and then start the iMac back up and it would resume to normal operation (yet with no updates). 2019-8-7  Stuck at 'Running Package Script' screen at the last step during the installation of Office. Issue environment: The issue happens to MAC Mojave 10.14.6. The issue happens in the 16.27 version of Office 365 (2019) for Mac. Suggestions: 1.

Tip

Consider using the Scripts feature in the Configuration Manager console. Scripts may be a better solution for some of the preceding scenarios instead of using packages and programs.

When you migrate packages from an earlier version of Configuration Manager, you can deploy them in your Configuration Manager hierarchy. After migration is complete, the packages appear in the Packages node in the Software Library workspace.

  • Oct 15, 2019 Hello, it looks like the installation for Acrobat Reader fails on the developer beta for the new Catalina. The installer gets stuck at 'Running package scripts'. Regards, Alex.
  • Mac Pro:: Mac Seems To Be Stuck On Installing 3 Items / Running Package Scripts Mar 12, 2012. Has anyone had problems with the latest update? My Mac seems to be stuck on installing 3 items - running package scripts.I also have an installation alert that says to close iTunes to continue installation.
  • To help with issues you might encounter when installing Office because of slow speeds or unreliable connections, as a first step download the Microsoft Support and Recovery Assistant. Offline installer manual steps. If the Microsoft Support and Recovery Assistant didn't help, follow the steps below that are specific to your plan.

You can modify and deploy these packages in the same way you did by using software distribution. The Import Package from Definition Wizard remains in Configuration Manager to import legacy packages. Advertisements are converted to deployments when you migrate from Configuration Manager 2007 to a Configuration Manager hierarchy.

Note

Use Package Conversion Manager to convert packages and programs into Configuration Manager applications.

Starting in version 1806, Package Conversion Manager is integrated with Configuration Manager. For more information, see Package Conversion Manager.

Packages can use some new features of Configuration Manager, including distribution point groups and monitoring. You can't deploy Microsoft Application Virtualization (App-V) applications with packages and programs in Configuration Manager. To distribute virtual applications, create them as Configuration Manager applications. For more information, see Deploy App-V virtual applications.

Create a package and program

Use the Create Package and Program wizard

  1. In the Configuration Manager console, go to the Software Library workspace, expand Application Management, and select the Packages node.

  2. In the Home tab of the ribbon, in the Create group, choose Create Package.

  3. On the Package page of the Create Package and Program Wizard, specify the following information:

    • Name: Specify a name for the package with a maximum of 50 characters.

    • Description: Specify a description for this package with a maximum of 128 characters.

    • Manufacturer (optional): Specify a manufacturer name to help you identify the package in the Configuration Manager console. This name can be a maximum of 32 characters.

    • Language (optional): Specify the language version of the package with a maximum of 32 characters.

    • Version (optional): Specify a version number for the package with a maximum of 32 characters.

    • This package contains source files: This setting indicates whether the package requires source files to be present on client devices. By default, the wizard doesn't enable this option, and Configuration Manager doesn't use distribution points for the package. When you select this option, specify the package content to distribute to distribution points.

    • Source folder: If the package contains source files, choose Browse to open the Set Source Folder dialog box, and then specify the location of the source files for the package.

      Note

      The computer account of the site server must have read access permissions to the source folder that you specify.

    • Starting in version 1906, if you want to pre-cache content on a client, specify the Architecture and Language of the package. For more information, see Configure pre-cache content.

  4. On the Program Type page of the Create Package and Program Wizard, select the type of program to create, and then choose Next. You can create a program for a computer or device, or you can skip this step and create a program later.

    Tip

    To create a new program for an existing package, first select the package. Then, in the Home tab, in the Package group, choose Create Program to open the Create Program Wizard.

Create a standard program

  1. On the Program Type page of the Create Package and Program Wizard, choose Standard Program, and then choose Next.

  2. On the Standard Program page, specify the following information:

    • Name: Specify a name for the program with a maximum of 50 characters.

      Note

      The program name must be unique within a package. After you create a program, you can't modify its name.

    • Command Line: Enter the command line to use to start this program, or choose Browse to browse to the file location.

      If you don't specify an extension for a file name, Configuration Manager attempts to use .com, .exe, and .bat as possible extensions.

      When the client runs the program, Configuration Manager searches for the file in the following locations:

      • Within the package
      • The local Windows folder
      • The local %path%

      If it can't find the file, the program fails.

    • Startup folder (optional): Specify the folder from which the program runs, up to 127 characters. This folder can be an absolute path on the client. It can also be a path that's relative to the distribution point folder that contains the package.

    • Run: Specify the mode in which the program runs on client computers. Select one of the following options:

      • Normal: The program runs in the normal mode based on system and program defaults. This mode is the default.

      • Minimized: The program runs minimized on client devices. Users might see installation activity in the notification area or on the taskbar.

      • Maximized: The program runs maximized on client devices. Users see all installation activity.

      • Hidden: The program runs hidden on client devices. Users don't see any installation activity.

    • Program can run: Specify whether the program runs only when a user is signed in, only when no user is signed in, or regardless of whether a user is signed in to the client computer.

    • Run mode: Specify whether the program runs with administrative permissions or with the permissions of the user who's currently signed in.

    • Allow users to view and interact with the program installation: Use this setting, if available, to specify whether to allow users to interact with the program installation. This option is only available if the following conditions are met:

      • Program can run setting is Only when no user is logged on or Whether or not a user is logged on
      • Run mode setting is to Run with administrative rights
    • Drive mode: Specify information about how this program runs on the network. Choose one of the following options:

      • Runs with UNC name: Specify that the program runs with a Universal Naming Convention (UNC) name. This setting is the default.

      • Requires drive letter: Specify that the program requires a drive letter to fully qualify its location. For this setting, Configuration Manager can use any available drive letter on the client.

      • Requires specific drive letter: Specify that the program requires a specific drive letter that you specify to fully qualify its location. For example, Z:. If the client is already using the specified drive letter, the program doesn't run.

    • Reconnect to distribution point at log on: Indicate whether the client reconnects to the distribution point when the user signs in. By default, the wizard doesn't enable this option.

  3. On the Requirements page of the Create Package and Program Wizard, specify the following information:

    • Run another program first: Identify a package and program that runs before this package and program runs.

    • Platform requirements: Select This program can run on any platform or This program can run only on specified platforms. Then choose the OS versions that clients must have to install this package and program.

    • Estimated disk space: Specify the amount of disk space that the program requires to run on the computer. The default setting is Unknown. If necessary, specify a whole number greater than or equal to zero. If you set a value, also select units for the value.

    • Maximum allowed run time (minutes): Specify the maximum time that you expect the program to run on the client computer. The default value is 120 minutes. Only use whole numbers greater than zero.

      Important

      If you use maintenance windows on the same collection to which you deploy this program, a conflict could occur if the Maximum allowed run time is longer than the scheduled maintenance window. If you set the maximum run time to Unknown, the program starts to run during the maintenance window. It then continues to run as needed after the maintenance window is closed. If you set the maximum run time to a specific period that's greater than the length of any available maintenance window, then the client doesn't run the program.

      If you set this value to Unknown, Configuration Manager sets the maximum allowed run time as 12 hours (720 minutes).

      Note

      If the program exceeds the maximum run time, Configuration Manager stops it if the following conditions are met:

      • You enable the option to Run with administrative rights
      • You don't enable the option to Allow users to view and interact with the program installation

Create a device program

  1. On the Program Type page of the Create Package and Program Wizard, select Program for device, and then choose Next.

  2. On the Program for Device page, specify the following settings:

    • Name: Specify a name for the program with a maximum of 50 characters.

      Note

      The program name must be unique within a package. After you create a program, you can't modify its name.

    • Comment (optional): Specify a comment for this device program with a maximum of 127 characters.

    • Download folder: Specify the name of the folder on the device in which it will store the package source files. The default value is Temp.

    • Command Line: Enter the command line to use to start this program. To browse to the file location, choose Browse.

    • Run command line in download folder: Select this option to run the program from the download folder.

    • Run command line from this folder: Select this option to specify a different folder from which to run the program.

  3. On the Requirements page, specify the following settings:

    • Estimated disk space: Specify the amount of disk space that's required for the software. The client displays this value to mobile device users before they install the program.

    • Download program: Specify information about when the mobile device can download this program. You can specify As soon as possible, Only over a fast network, or Only when the device is docked.

    • Additional requirements: Specify any additional requirements for this program. Users see these requirements before they install the software. For example, you could notify users that they need to close all other applications before running the program.

Deploy packages and programs

  1. In the Configuration Manager console, go to the Software Library workspace, expand Application Management, and select the Packages node.

  2. Select the package that you want to deploy. In the Home tab of the ribbon, in the Deployment group, choose Deploy.

  3. On the General page of the Deploy Software Wizard, specify the name of the package and program that you want to deploy. Select the collection to which you want to deploy the package and program, and any optional comments.

    To store the package content on the collection's default distribution point group, select the option to Use default distribution point groups associated to this collection. If you didn't associate this collection with a distribution point group, this option is unavailable.

  4. On the Content page, choose Add. Select the distribution points or distribution point groups to which you want to distribute the content for this package and program.

  5. On the Deployment Settings page, configure the following settings:

    • Purpose: Choose one of the following options:

      • Available: The user sees the published package and program in Software Center and can install it on demand.

      • Required: The package and program is deployed automatically, according to the configured schedule. In Software Center, you can track its deployment status and install it before the deadline.

      Note

      If multiple users are signed into the device, package and task sequence deployments may not appear in Software Center.

    • Send wake-up packets: If you set the deployment purpose to Required and select this option, the site first sends a wake-up packet to computers at the installation deadline time. Before you can use this option, configure computers for Wake On LAN. For more information, see How to configure Wake on LAN.

    • Allow clients on a metered Internet connection to download content after the installation deadline, which might incur additional costs

    Note

    When you deploy a package and program, the option to Pre-deploy software to the user's primary device isn't available.

  6. On the Scheduling page, configure when to deploy this package and program to client devices.

    The options on this page vary depending on whether you set the deployment action to Available or Required.

    For Required deployments, configure the rerun behavior for the program from the Rerun behavior drop-down menu. Choose from the following options:

    Rerun behaviorDescription
    Never rerun deployed programThe client won't rerun the program. This behavior happens even if the program originally failed or if the program files are changed.
    Always rerun programThe client always reruns the program when the deployment is scheduled. This behavior happens even if the program has already successfully run. It's useful with recurring deployments when you update the program.
    Rerun if failed previous attemptThe client reruns the program when the deployment is scheduled, only if it failed on the previous run attempt.
    Rerun if succeeded on previous attemptThe client reruns the program only if it previously ran successfully on the client. This behavior is useful with recurring deployments when you routinely update the program, and each update requires the previous update to be successfully installed.
  7. On the User Experience page, specify the following information:

    • Allow users to run the program independently of assignments: Users can install this software from Software Center regardless of any scheduled installation time.

    • Software installation: Allows the software to be installed outside of any configured maintenance windows.

    • System restart (if required to complete the installation): If the software installation requires a device restart to finish, allow this action to happen outside of any configured maintenance windows.

    • Embedded devices: When you deploy packages and programs to Windows Embedded devices that are write-filter-enabled, you can specify that they install packages and programs on the temporary overlay and commit changes later. Alternately, commit the changes on the installation deadline or during a maintenance window. When you commit changes on the installation deadline or during a maintenance window, a restart is required, and the changes persist on the device.

      Note

      When you deploy a package or program to a Windows Embedded device, make sure that the device is a member of a collection that has a configured maintenance window. For more information about how maintenance windows are used when you deploy packages and programs to Windows Embedded devices, see Creating Windows Embedded applications.

  8. On the Distribution Points page, specify the following information:

    • Deployment options: Specify the action that a client when it uses a distribution point in its current boundary group. Also select the action for the client when it uses a distribution point from a neighbor boundary group or the default site boundary group.

      Important

      If you configure the deployment option to Run program from distribution point, make sure to enable the option to Copy the content in this package to a package share on distribution points on the Data Access tab of the package properties. Otherwise the package is unavailable to run from distribution points.

    • Allow clients to use distribution points from the default site boundary group: When this content isn't available from any distribution point in the current or neighbor boundary groups, enable this option to let them try distribution points in the site default boundary group.

  9. Complete the wizard.

View the deployment in the Deployments node of the Monitoring workspace and in the details pane of the package deployment tab when you select the deployment. For more information, see Monitor packages and programs.

Monitor packages and programs

To monitor package and program deployments, use the same procedures that you use to monitor applications as detailed in Monitor applications.

Packages and programs also include a number of built-in reports, which enable you to monitor information about the deployment status of packages and programs. These reports have the report category of Software Distribution – Packages and Programs and Software Distribution – Package and Program Deployment Status.

For more information about how to configure reporting in Configuration Manager, see Introduction to reporting.

Manage packages and programs

In the Software Library workspace, expand Application Management, and select the Packages node. Select the package that you want to manage, and then choose a management task.

Create Prestage Content File

Opens the Create Prestaged Content File Wizard, to create a file that contains the package content. Use this file to manually import the package to a remote distribution point. This action is useful when you have low network bandwidth between the site server and the distribution point.

Create Program

Opens the Create Program Wizard, to create a new program for this package.

Export

Opens the Export Package Wizard, to export the selected package and its content to a file. Use this file to import the file to another hierarchy.

For information about how to import packages and programs, see Create packages and programs.

Deploy

Opens the Deploy Software Wizard, to deploy the selected package and program to a collection. For more information, see Deploy packages and programs.

Distribute content

Opens the Distribute Content Wizard, to send the content for a package and program to selected distribution points or distribution point groups.

Update distribution points

Updates distribution points with the latest content for the selected package and program.

See also

-->

Applies to: Configuration Manager (current branch)

Configuration Manager has an integrated ability to run PowerShell scripts. PowerShell has the benefit of creating sophisticated, automated scripts that are understood and shared with a larger community. The scripts simplify building custom tools to administer software and let you accomplish mundane tasks quickly, allowing you to get large jobs done more easily and more consistently.

Note

Configuration Manager doesn't enable this optional feature by default. You must enable this feature before using it. For more information, see Enable optional features from updates.

With this integration in Configuration Manager, you can use the Run Scripts functionality to do the following things:

  • Create and edit scripts for use with Configuration Manager.
  • Manage script usage through roles and security scopes.
  • Run scripts on collections or individual on-premises managed Windows PCs.
  • Get rapid aggregated script results from client devices.
  • Monitor script execution and view reporting results from script output.

Warning

  • Given the power of scripts, we remind you to be intentional and careful with their usage. We have built in additional safeguards to assist you; segregated roles and scopes. Be sure to validate the accuracy of scripts before running them and confirm they are from a trusted source, to prevent unintended script execution. Be mindful of extended characters or other obfuscation and educate yourself about securing scripts. Learn more about PowerShell script security
  • Certain anti-malware software may inadvertently trigger events against the Configuration Manager Run Scripts or CMPivot features. It is recommended to exclude %windir%CCMScriptStore so that the anti-malware software permits those features to run without interference.

Prerequisites

  • To run PowerShell scripts, the client must be running PowerShell version 3.0 or later. However, if a script you run contains functionality from a later version of PowerShell, the client on which you run the script must be running that version of PowerShell.
  • Configuration Manager clients must be running the client from the 1706 release, or later in order to run scripts.
  • To use scripts, you must be a member of the appropriate Configuration Manager security role.
  • To import and author scripts - Your account must have Create permissions for SMS Scripts.
  • To approve or deny scripts - Your account must have Approve permissions for SMS Scripts.
  • To run scripts - Your account must have Run Script permissions for Collections.

For more information about Configuration Manager security roles:
Security scopes for run scripts
Security roles for run scripts
Fundamentals of role-based administration.

Limitations

Run Scripts currently supports:

  • Scripting languages: PowerShell
  • Parameter types: integer, string, and list.

Warning

Be aware that when using parameters, it opens a surface area for potential PowerShell injection attack risk. There are various ways to mitigate and work around, such as using regular expressions to validate parameter input or using predefined parameters. Common best practice is not to include secrets in your PowerShell scripts (no passwords, etc.). Learn more about PowerShell script security

Run Script authors and approvers

Run Scripts uses the concept of script authors and script approvers as separate roles for implementation and execution of a script. Having the author and approver roles separated allows an important process check for the powerful tool that Run Scripts is. There's an additional script runners role that allows execution of scripts, but not creation or approval of scripts. See Create security roles for scripts.

Scripts roles control

By default, users can't approve a script they've authored. Because scripts are powerful, versatile, and potentially deployed to many devices, you can separate the roles between the person that authors the script and the person that approves the script. These roles give an additional level of security against running a script without oversight. You're able to turn off secondary approval, for ease of testing.

Approve or Deny a script

Scripts must be approved, by the script approver role, before they can be run. To approve a script:

  1. In the Configuration Manager console, click Software Library.
  2. In the Software Library workspace, click Scripts.
  3. In the Script list, choose the script you want to approve or deny and then, on the Home tab, in the Script group, click Approve/Deny.
  4. In the Approve or deny script dialog box, select Approve, or Deny for the script. Optionally, enter a comment about your decision. If you deny a script, it can't be run on client devices.
  5. Complete the wizard. In the Script list, you see the Approval State column change depending on the action you took.

Allow users to approve their own scripts

This approval is primarily used for the testing phase of script development.

  1. In the Configuration Manager console, click Administration.
  2. In the Administration workspace, expand Site Configuration, and then click Sites.
  3. In the list of sites, choose your site and then, on the Home tab, in the Sites group, click Hierarchy Settings.
  4. On the General tab of the Hierarchy Settings Properties dialog box, clear the checkbox Script authors require additional script approver.

Important

As a best practice, you shouldn't allow a script author to approve their own scripts. It should only be allowed in a lab setting. Carefully consider the potential impact of changing this setting in a production environment.

Security scopes

(Introduced with version 1710)
Run Scripts uses security scopes, an existing feature of Configuration Manager, to control scripts authoring and execution through assigning tags that represent user groups. For more information on using security scopes, see Configure role-based administration for Configuration Manager.

Create security roles for scripts

The three security roles used for running scripts aren't created by default in Configuration Manager. To create the script runners, script authors, and script approvers roles, follow the outlined steps.

  1. In the Configuration Manager console, go to Administration >Security >Security Roles
  2. Right-click on a role and click Copy. The role you copy has permissions already assigned. Make sure you take only the permissions that you want.
  3. Give the custom role a Name and a Description.
  4. Assign the security role the permissions outlined below.
Microsoft 2019 For Mac Installer Stuck Running Package Scripts

Security Role Permissions

Role Name: Script Runners

  • Description: These permissions enable this role to only run scripts that were previously created and approved by other roles.
  • Permissions: Ensure the following are set to Yes.
CategoryPermissionState
CollectionRun ScriptYes
SiteReadYes
SMS ScriptsReadYes

Role Name: Script Authors

  • Description: These permissions enable this role to author scripts, but they can't approve or run them.
  • Permissions: Ensure the following permissions are set.
CategoryPermissionState
CollectionRun ScriptNo
SiteReadYes
SMS ScriptsCreateYes
SMS ScriptsReadYes
SMS ScriptsDeleteYes
SMS ScriptsModifyYes

Role Name: Script Approvers

  • Description: These permissions enable this role to approve scripts, but they can't create or run them.
  • Permissions: Ensure the following permissions are set.
CategoryPermissionState
CollectionRun ScriptNo
SiteReadYes
SMS ScriptsReadYes
SMS ScriptsApproveYes
SMS ScriptsModifyYes

Example of SMS Scripts permissions for the script authors role

Create a script

  1. In the Configuration Manager console, click Software Library.
  2. In the Software Library workspace, click Scripts.
  3. On the Home tab, in the Create group, click Create Script.
  4. On the Script page of the Create Script wizard, configure the following settings:
    • Script Name - Enter a name for the script. Although you can create multiple scripts with the same name, using duplicate names makes it harder for you to find the script you need in the Configuration Manager console.
    • Script language - Currently, only PowerShell scripts are supported.
    • Import - Import a PowerShell script into the console. The script is displayed in the Script field.
    • Clear - Removes the current script from the Script field.
    • Script - Displays the currently imported script. You can edit the script in this field as necessary.
  5. Complete the wizard. The new script is displayed in the Script list with a status of Waiting for approval. Before you can run this script on client devices, you must approve it.

Important

Avoid scripting a device reboot or a restart of the Configuration Manager agent when using the Run Scripts feature. Doing so could lead to a continuous rebooting state. If needed, there are enhancements to the client notification feature that enable restarting devices, starting in Configuration Manager version 1710. The pending restart column can help identify devices that need a restart.

Script parameters

(Introduced with version 1710)
Adding parameters to a script provides increased flexibility for your work. You can include up to 10 parameters. The following outlines the Run Scripts feature's current capability with script parameters for; String, Integer data types. Lists of preset values are also available. If your script has unsupported data types, you get a warning.

In the Create Script dialog, click Script Parameters under Script.

Each of your script's parameters has its own dialog for adding further details and validation. If there's a default parameter in the script, it will be enumerated in the parameter UI and you can set it. Configuration Manager won't overwrite the default value since it will never modify the script directly. You can think of this as 'pre-populated suggested values' are provided in the UI, but Configuration Manager doesn't provide access to 'default' values at run-time. This can be worked around by editing the script to have the correct defaults.

Important

Parameter values can't contain an apostrophe.
There is a known issue in Configuration Manager version 1802 where parameters with spaces don't get passed to the script properly. If a space is used in the parameter, only the first item in the parameter is passed to the script and everything after the space is not passed. Admins can script around this by substituting alternate characters for spaces and converting them, or with other methods.

Parameter validation

Each parameter in your script has a Script Parameter Properties dialog for you to add validation for that parameter. After adding validation, you should get errors if you're entering a value for a parameter that doesn't meet its validation.

Example: FirstName

In this example, you're able to set the properties of the string parameter, FirstName.

The validation section of the Script Parameter Properties dialog contains the following fields for your use:

  • Minimum Length - minimum number of characters of the FirstName field.
  • Maximum Length- maximum number of characters of the FirstName field
  • RegEx - short for Regular Expression. For more information on using the Regular Expression, see the next section, Using Regular Expression validation.
  • Custom Error - useful for adding your own custom error message that supersedes any system validation error messages.

Using Regular Expression validation

A regular expression is a compact form of programming for checking a string of characters against an encoded validation. For example, you could check for the absence of a capital alphabetic character in the FirstName field by placing [^A-Z] in the RegEx field.

The regular expression processing for this dialog is supported by the .NET Framework. For guidance on using regular expressions, see .NET Regular Expression and Regular Expression Language.

Script examples

Here are a couple examples that illustrate scripts you might want to use with this capability.

Create a new folder and file

This script creates a new folder and a file within the folder, given your naming input.

Get OS Version

Microsoft 2019 For Mac Installer Stuck Running Package Scripts Download

This script uses WMI to query the machine for its OS version.

Edit or copy PowerShell scripts

(Introduced with version 1902)
You can Edit or Copy an existing PowerShell script used with the Run Scripts feature. Instead of recreating a script that you need to change, now directly edit it. Both actions use the same wizard experience as when you create a new script. When you edit or copy a script, Configuration Manager doesn't persist the approval state.

Tip

Don't edit a script that's actively running on clients. They won't finish running the original script, and you may not get the intended results from these clients.

Edit a script

  1. Go to the Scripts node under the Software Library workspace.
  2. Select the script to edit, then click Edit in the ribbon.
  3. Change or reimport your script in the Script Details page.
  4. Click Next to view the Summary then Close when you're finished editing.

Copy a script

  1. Go to the Scripts node under the Software Library workspace.
  2. Select the script to copy, then click Copy in the ribbon.
  3. Rename the script in the Script name field and make any additional edits you may need.
  4. Click Next to view the Summary then Close when you're finished editing.

Run a script

After a script is approved, it can be run against a single device or a collection. Once execution of your script begins, it's launched quickly through a high priority system that times-out in one hour. The results of the script are then returned using a state message system.

To select a collection of targets for your script:

  1. In the Configuration Manager console, click Assets and Compliance.
  2. In the Assets and Compliance workspace, click Device Collections.
  3. In the Device Collections list, click the collection of devices on which you want to run the script.
  4. Select a collection of your choice, click Run Script.
  5. On the Script page of the Run Script wizard, choose a script from the list. Only approved scripts are shown.
  6. Click Next, and then complete the wizard.

Important

If a script does not run, for example because a target device is turned off during the one hour time period, you must run it again.

Target machine execution

The script is executed as the system or computer account on the targeted client(s). This account has limited network access. Any access to remote systems and locations by the script must be provisioned accordingly.

Script monitoring

After you have initiated running a script on a collection of devices, use the following procedure to monitor the operation. Beginning with version 1710, you're both able to monitor a script in real time as it executes, and you can also return to a report for a given Run Script execution. Script status data is cleaned up as part of the Delete Aged Client Operations maintenance task or deletion of the script.

  1. In the Configuration Manager console, click Monitoring.

  2. In the Monitoring workspace, click Script Status.

  3. In the Script Status list, you view the results for each script you ran on client devices. A script exit code of 0 generally indicates that the script ran successfully.

    • Beginning in Configuration Manager 1802, script output is truncated to 4 KB to allow for better display experience.

Script output in 1810

You can view detailed script output in raw or structured JSON format. This formatting makes the output easier to read and analyze. If the script returns valid JSON-formatted text, then view the detailed output as either JSON Output or Raw Output. Otherwise the only option is Script Output.

Example: Script output is valid JSON

Command: $PSVersionTable.PSVersion

Example: Script output isn't valid JSON

Microsoft 2019 For Mac Installer Stuck Running Package Scripts Free

Command: Write-Output (Get-WmiObject -Class Win32_OperatingSystem).Caption

  • 1810 clients return output less than 80 KB to the site over a fast communication channel. This change increases the performance of viewing script or query output.

    • If the script or query output is greater than 80 KB, the client sends the data via a state message.
    • Pre-1802 clients continue to use state messages.

Microsoft 2019 For Mac Installer Stuck Running Package Scripts 2017

Script output pre-1810

Microsoft 2019 For Mac Installer Stuck Running Package Scripts Online

  • Starting in Configuration Manager version 1802, script output returns using JSON formatting. This format consistently returns a readable script output.

  • Scripts that get an unknown result, or where the client was offline, won't show in the charts or data set.

  • Avoid returning large script output since it's truncated to 4 KB.

  • Some functionality with script output formatting isn't available when running Configuration Manager version 1802 or later with a down-level version of the client.

    • When you have a pre-1802 Configuration Manager client, you get a string output.
    • For Configuration Manager client version 1802 and above, you get JSON formatting.
      • For example, you might get results that say TEXT on one client version and 'TEXT' (the output is surrounded in double quotes) on other version, which will be put in chart as two different categories.
      • If you need to work around this behavior, consider running script against two different collections. One with pre-1802 clients and another with 1802 and higher clients. Or, you can convert an enum object to a string value in scripts so they're properly displayed in JSON formatting.
  • Convert an enum object to a string value in scripts so they're properly displayed in JSON formatting.

Log files

Starting in version 1810, additional logging was added for troubleshooting.

  • On the client, by default in C:WindowsCCMlogs:

    • Scripts.log
    • CcmMessaging.log
  • On the MP, by default in C:SMS_CCMLogs:

    • MP_RelayMsgMgr.log
  • On the site server, by default in C:Program FilesConfiguration ManagerLogs:

    • SMS_Message_Processing_Engine.log

See Also