### Applications Installation Example Source: https://learn.microsoft.com/en-us/intune/configmgr/mdt/properties Example showing how to specify application GUIDs for installation using CustomSettings.ini. ```ini [Settings] Priority=Default [Default] Applications001={1D7DF331-47B7-472C-87B3-442597EC2F7D} Applications002={9d2b8999-5e4d-4f3d-bb05-edaaf4fe5628} ``` -------------------------------- ### Configure Client Installation Properties in a File Source: https://learn.microsoft.com/en-us/intune/configmgr/core/clients/deploy/about-client-installation-properties An example of how to define client installation properties within the `[Client Install]` section of a configuration file. This allows for detailed customization of the client setup. ```ini [Client Install] Install=INSTALL=ALL SMSSITECODE=ABC SMSCACHESIZE=100 ``` -------------------------------- ### CCMSetup.exe command-line example Source: https://learn.microsoft.com/en-us/intune/configmgr/core/clients/deploy/about-client-installation-properties This example shows how to specify a management point, log on behavior, site code, and fallback status point during client installation. ```cmd CCMSetup.exe /mp:SMSMP01 /logon SMSSITECODE=S01 FSP=SMSFSP01 ``` -------------------------------- ### OSDApplicationList Example Source: https://learn.microsoft.com/en-us/intune/configmgr/mdt/udi-reference Specifies a semicolon-delimited list of application IDs to be selected by default in the OSD Setup Wizard's Install Software page. ```text OSDApplicationList=2;3 ``` -------------------------------- ### Install Site Using a Setup Script File Source: https://learn.microsoft.com/en-us/intune/configmgr/core/servers/deploy/install/use-a-command-line-to-install-sites Use the /SCRIPT command-line option to specify an INI file for unattended site installation. Ensure the script file has the .ini extension and provide the full path. The account running setup must have Administrator rights. ```cmd setup.exe /script C:\Setup\setup.ini ``` -------------------------------- ### Start Setup Downloader Without UI (Command Line) Source: https://learn.microsoft.com/en-us/intune/configmgr/core/servers/deploy/install/setup-downloader This command initiates the setup downloader process without displaying the user interface. A download path is required for this option to specify where the files should be stored. ```cmd setupdl.exe /NOUI C:\Download ``` -------------------------------- ### Manual Client Installation with CCMSetup.exe Source: https://learn.microsoft.com/en-us/intune/configmgr/core/clients/deploy/deploy-clients-to-windows-computers Use this command-line example to manually install the Configuration Manager client. It specifies a management point for downloading files, stops installation if a client is found, automatically assigns the site code, and sets a fallback status point. ```cmd CCMSetup.exe /mp:SMSMP01 /logon SMSSITECODE=AUTO FSP=SMSFP01 ``` -------------------------------- ### Install clients on the internet with CCMSetup properties Source: https://learn.microsoft.com/en-us/intune/configmgr/core/clients/deploy/deploy-clients-to-windows-computers Use this method to install Configuration Manager clients directly on the internet. Ensure clients have PKI certificates installed beforehand. This example shows the essential CCMSetup command-line parameters and Client.msi properties. ```cmd ccmsetup.exe /source:"" /UsePKICert CCMHOSTNAME= SMSSIGNCERT="" SMSSITECODE= ``` -------------------------------- ### Visual Basic Example of Create Function Source: https://learn.microsoft.com/en-us/intune/configmgr/develop/reference/core/servers/manage/create-function This Visual Basic example demonstrates how to instantiate the InstallStatusMIF object and call its Create method to generate a status MIF file indicating a successful installation. ```vb [VisualBasic] Dim MIFStatus As New InstallStatusMIF MIFStatus.Create "MyStatusFile", _ "MyCompany", _ "MyProduct", _ "1.00.000", _ "ENU", _ " ", _ "Installation Successful", _ True ``` -------------------------------- ### Run Setup Downloader with User Interface Source: https://learn.microsoft.com/en-us/intune/configmgr/core/servers/deploy/install/setup-downloader Browse to the SMSSETUP\BIN\X64 subfolder on the installation media and run Setupdl.exe. Specify a download folder and select Download. Setup downloader verifies and downloads missing or newer files. ```powershell C:\ConfigMgrSetup.log ``` -------------------------------- ### Install Microsoft Tunnel in Rootless Podman Source: https://learn.microsoft.com/en-us/intune/device-security/microsoft-tunnel/install Use this modified command to start the Microsoft Tunnel setup script when installing in a rootless Podman container. ```bash mst_rootless_mode=1 ./mstunnel-setup ``` -------------------------------- ### Example Device Installation Log Entry Source: https://learn.microsoft.com/en-us/intune/device-configuration/settings-catalog/restrict-usb This log entry shows a device being explicitly restricted by policy, indicating that its Class GUID is not present in the allowed list. It also highlights the specific Class GUID that was changed. ```log >>> [Device Install (Hardware initiated) - USB\VID_046D&PID_C534\5&bd89ed7&0&2] >>> Section start 2020/01/20 17:26:03.547 dvi: {Build Driver List} 17:26:03.597 … dvi: {Build Driver List - exit(0x00000000)} 17:26:03.645 dvi: {DIF_SELECTBESTCOMPATDRV} 17:26:03.647 dvi: {Select Best Driver} dvi: Class GUID of device changed to: {36fc9e60-c465-11cf-8056-444553540000}. dvi: Selected Driver: dvi: Description - USB Composite Device dvi: InfFile - c:\windows\system32\driverstore\filerepository\usb.inf_amd64_9646056539e4be37\usb.inf dvi: Section - Composite.Dev dvi: {Select Best Driver - exit(0x00000000)} dvi: Default installer: Exit dvi: {DIF_SELECTBESTCOMPATDRV - exit(0x00000000)} 17:26:03.664 dvi: {Core Device Install} 17:26:03.666 dvi: {Install Device - USB\VID_046D&PID_C534\5&BD89ED7&0&2} 17:26:03.667 dvi: Device Status: 0x01806400, Problem: 0x1 (0xc0000361) dvi: Parent device: USB\ROOT_HUB30\4&278ca476&0&0 !!! pol: The device is explicitly restricted by the following policy settings: !!! pol: [-] Restricted installation of devices not described by policy !!! pol: {Device installation policy check [USB\VID_046D&PID_C534\5&BD89ED7&0&2] exit(0xe0000248)} !!! dvi: Installation of device is blocked by policy! ! dvi: Queueing up error report for device install failure. dvi: {Install Device - exit(0xe0000248)} 17:26:03.692 dvi: {Core Device Install - exit(0xe0000248)} 17:26:03.694 <<< Section end 2020/01/20 17:26:03.697 <<< [Exit status: FAILURE(0xe0000248)] ``` -------------------------------- ### Example script to install a primary site Source: https://learn.microsoft.com/en-us/intune/configmgr/core/servers/deploy/install/command-line-script-file This script demonstrates the configuration options for installing a primary site using the command line. It includes sections for identification, general options, SQL configuration, cloud connector settings, and site assignment branch options. ```ini [Identification] Action=InstallPrimarySite CDLatest=1 [Options] ProductID=Eval SiteCode=XYZ SiteName=Contoso eval site SMSInstallDir=D:\Program Files\Microsoft Configuration Manager SDKServer=cmsite.contoso.com PrerequisiteComp=0 PrerequisitePath=C:\Sources\Redist AdminConsole=1 JoinCEIP=0 ManagementPoint=cmsite.contoso.com ManagementPointProtocol=HTTP DistributionPoint=cmsite.contoso.com DistributionPointProtocol=HTTP DistributionPointInstallIIS=1 RoleCommunicationProtocol=HTTPorHTTPS ClientsUsePKICertificate=0 MobileDeviceLanguage=0 [SQLConfigOptions] SQLServerName=cmsql.contoso.com SQLServerPort=1433 DatabaseName=CM_XYZ SQLSSBPort=4022 SQLDataFilePath=E:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\ SQLLogFilePath=E:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\DATA\ [CloudConnectorOptions] CloudConnector=1 CloudConnectorServer=cmsite.contoso.com UseProxy=0 [SABranchOptions] SAActive=1 CurrentBranch=1 ``` -------------------------------- ### Calling InstallStatusMIF Directly Source: https://learn.microsoft.com/en-us/intune/configmgr/develop/reference/core/servers/manage/installstatusmif-function Example of how to call the InstallStatusMIF function by directly loading and calling Ismif32.dll. This demonstrates the typical usage within an installation setup application. ```csharp [C/C++] DWORD (WINAPI *InstallStatusMIF)(char *, char *, char *, char *, char *, char *, char *, BOOL); #define PROCSIGNATURE DWORD (WINAPI *)(char *, char *, char *, char *, char *, char *, char *, BOOL) HINSTANCE hinst; int RetCode; hinst = LoadLibrary("ismif32.dll"); InstallStatusMIF = (PROCSIGNATURE) GetProcAddress(hinst, "InstallStatusMIF"); if (InstallStatusMIF) { RetCode = InstallStatusMIF("Status", "Microsoft", "Microsoft SQL Server 7.0", "7.00.000", "ENU", NULL, "Installation Successful", true); } FreeLibrary(hinst); ``` -------------------------------- ### Run a command line with setup.exe Source: https://learn.microsoft.com/en-us/intune/configmgr/osd/understand/task-sequence-steps Example of running an executable with command-line arguments. Use 'cmd.exe /c' to precede command-line actions like output redirection or copy commands for successful execution. ```cmd setup.exe /a ``` -------------------------------- ### Run Microsoft Tunnel Setup Script Source: https://learn.microsoft.com/en-us/intune/device-security/microsoft-tunnel/install Execute the Microsoft Tunnel setup script as root to begin the installation. The script installs the latest version. ```bash sudo ./mstunnel-setup ``` -------------------------------- ### Running the Win32 Content Prep Tool with Command-Line Parameters Source: https://learn.microsoft.com/en-us/intune/app-management/deployment/create-win32-package Provide the setup folder, setup file, and output folder directly as command-line arguments to the IntuneWinAppUtil.exe for automated processing. The '-q' parameter enables quiet mode. ```powershell IntuneWinAppUtil.exe -c "C:\Setup" -s "setup.exe" -o "C:\Output" -q ``` -------------------------------- ### Example Configuration Manager Unattended Installation Script Source: https://learn.microsoft.com/en-us/intune/configmgr/core/servers/deploy/install/use-a-command-line-to-install-sites This is an example of an unattended installation script file for Configuration Manager. It includes essential sections like Identification, Options, and SQLConfigOptions. Ensure all required keys and values are provided for your specific installation scenario. ```ini [Identification] AssignedSiteCode = CM1 SiteName = My Site Name SiteCode = CM1 [Options] SQLServerName = MySQLServer.contoso.com SQLDatabaseName = CM_CM1 [SQLConfigOptions] ProductCode = "{00000000-0000-0000-0000-000000000000}" [HierarchyExpansionOption] Option = 2 [CloudConnectorOptions] Option = 0 [SABranchOptions] Option = 0 ``` -------------------------------- ### Uninstall MSI Package by GUID Source: https://learn.microsoft.com/en-us/intune/app-management/deployment/add-win32 Use this command to uninstall an MSI package using its Product Code (GUID). Replace the example GUID with the actual GUID of your application. ```bash msiexec /x "{12345A67-89B0-1234-5678-000001000000}" ``` -------------------------------- ### Create Install Software Task Sequence (C#) Source: https://learn.microsoft.com/en-us/intune/configmgr/develop/osd/how-to-create-an-operating-system-deployment-task-sequence This C# example creates a task sequence that installs a software program. It requires a WqlConnectionManager, a package ID, and a program name. The method also calls a helper method to create the task sequence package. Ensure the necessary namespaces and assemblies are referenced. ```csharp public void CreateInstallSoftwareTaskSequence( WqlConnectionManager connection, string name, string packageId, string programName) { try { // Create the task sequence. IResultObject taskSequence = connection.CreateInstance("SMS_TaskSequence"); IResultObject ro = connection.CreateEmbeddedObjectInstance("SMS_TaskSequence_InstallSoftwareAction"); ro["ProgramName"].StringValue = programName; ro["packageId"].StringValue = packageId; ro["Name"].StringValue = name; ro["Enabled"].BooleanValue = true; ro["ContinueOnError"].BooleanValue = false; // Add the step to the task sequence. List array = taskSequence.GetArrayItems("Steps"); array.Add(ro); taskSequence.SetArrayItems("Steps", array); // Create the task sequence package. this.CreateTaskSequencePackage(connection, taskSequence); } catch (SmsException e) { Console.WriteLine("Failed to create Task Sequence: " + e.Message); throw; } } ``` -------------------------------- ### Get CM Install Application Step Source: https://learn.microsoft.com/en-us/intune/configmgr/osd/understand/task-sequence-steps Retrieves an install application step from a task sequence. ```powershell Get-CMTSStepInstallApplication ``` -------------------------------- ### Configure Mandatory Applications with GUIDs Source: https://learn.microsoft.com/en-us/intune/configmgr/mdt/properties Specifies a list of application GUIDs to be installed on the target computer. These GUIDs correspond to applications defined in the Deployment Workbench and Applications.xml. ```ini [Settings] Priority=Default [Default] MandatoryApplications001={1D7DF331-47B7-472C-87B3-442597EC2F7D} MandatoryApplications002={9d2b8999-5e4d-4f3d-bb05-edaaf4fe5628} Administrators001=WOODGROVEBANK\NYC Help Desk Staff ``` -------------------------------- ### Example ProductKey Configuration Source: https://learn.microsoft.com/en-us/intune/configmgr/mdt/properties Shows how to specify a product key for the target computer during deployment. The product key is automatically inserted into the Unattend.xml file. ```ini [Settings] Priority=Default [Default] ProductKey=AAAAA-BBBBB-CCCCC-DDDDD-EEEEE-FFFFF ``` -------------------------------- ### Configuration Manager Setup Command with CDLatest Option Source: https://learn.microsoft.com/en-us/intune/configmgr/core/servers/deploy/install/use-a-command-line-to-install-sites When running setup from the CD.Latest folder for a scripted install or recovery, include the 'CDLatest' key with a value of '1'. This is not supported with installation media from the Microsoft Volume License site. ```bash setup.exe /SCRIPT:"C:\MySetup\MyConfigMgrUnattended.ini" CDLatest=1 ``` -------------------------------- ### Example Manifest.xml for Console Extension Source: https://learn.microsoft.com/en-us/intune/configmgr/develop/core/servers/console/console-extension-register Provides a concrete example of a `manifest.xml` file, demonstrating how to specify extension details like ID, name, description, version, author, and deployment configurations for node and action extensions. ```XML 543F2947AEA734B6833F275091AC6A159C0FCD341373D6E53062E37281B602B3 C60FB69B86BF9B2E924FF272292CA2C97864D636B8190C95DC926049651A002E ``` -------------------------------- ### InitiateUserInstall Method Source: https://learn.microsoft.com/en-us/intune/configmgr/develop/reference/apps/initiateuserinstall-method-in-class-sms_application This method is reserved for future use. The syntax below is simplified from Managed Object Format (MOF) code and defines the method signature and its parameters. ```APIDOC ## InitiateUserInstall Method ### Description This method is reserved for future use. It is intended to initiate a user installation for an application. ### Method SInt32 InitiateUserInstall (String ModelName, String Username, String ClientGUID); ### Parameters #### Path Parameters - **ModelName** (String) - Required - Model name of the application. - **Username** (String) - Required - Unique user name. - **ClientGUID** (String) - Required - Unique identifier of a client. ### Return Values An `SInt32` data type that is 0 to indicate success or non-zero to indicate failure. For more information about handling returned errors, see About Configuration Manager Errors. ``` -------------------------------- ### Example: GUID for Configuration Manager Client Identification Source: https://learn.microsoft.com/en-us/intune/configmgr/develop/core/servers/configure/about-the-unique-identifier-value-for-a-resource This example shows how Configuration Manager uses a Globally Unique Identifier (GUID) to uniquely identify a Configuration Manager client. This follows the ':' format. ```text GUID:4976DCD4-CAAE-11D2-8E00-00104BCC3648 ``` -------------------------------- ### Get Current User Example Source: https://learn.microsoft.com/en-us/intune/configmgr/develop/reference/core/servers/configure/getcurrentuser-method-in-class-sms_identification This VBScript example demonstrates how to call the GetCurrentUser method to retrieve the domain\user name used by the SMS Provider. ```vbscript Dim Identification As SWbemObject Dim UserName As String Set Identification = GetObject("winmgmts:\\root\sms\site_:SMS_Identification") Identification.GetCurrentUser UserName MsgBox "UserName = " & UserName ``` -------------------------------- ### Running the Win32 Content Prep Tool with Interactive Prompts Source: https://learn.microsoft.com/en-us/intune/app-management/deployment/create-win32-package Execute the IntuneWinAppUtil.exe without any parameters to be interactively prompted for the required setup folder, setup file, and output folder. ```powershell IntuneWinAppUtil.exe ```