Use this method to deploy environment variables to managed cloud devices. Before you begin, please download the PowerShell script template from the Downloads page in Iris. Alternatively, you can also download this template by clicking here. Once downloaded, you will notice that the following file is available in the C:\Users\UserName\Downloads folder: Powershell_script_template.zip.
-
Extract the contents of the Powershell_script_template.zip folder.
-
Open the Environment variable folder followed by the PowerShell script in a Text Editor such as Notepad or Notepad++.
-
Replace the INSERT_YOUR_ENVIRONMENT_VARIABLE_NAME with the environment variable within the quotation marks.
-
Replace the INSERT_YOUR_ENVIRONMENT_VARIABLE_VALUE with the environment variable value within the quotation marks and then save the PowerShell script.
-
Log in to the Microsoft 365 admin center and select Admin from the App launcher.
-
Select Devices from the Navigation menu, then Scripts and remediations on the Devices | Overview page.
-
Select the Platform scripts tab from the Devices | Scripts and remediations page, then Add > Windows 10 and later. The Add PowerShell script page appears.
-
In the Basics section, type the name of the PowerShell script in the Name box, then select Next.
-
In the Script settings section, click the Select a file icon to select the PowerShell script you edited earlier.
The PowerShell script will add the environment variable to the user’s profile on their managed cloud device
-
Select Yes to run the PowerShell script using the logged on credentials.
-
Leave all other settings as default and select Next.
-
In the Assignments section, select Add groups (under Included groups) to display the Select groups to include blade.
-
Select the desired Microsoft Entra ID groups for which you want to deploy the environment variable, then click Select.
-
Leave all other settings as default and select Next.
-
Review the settings summary in the Review + add section and select Add to complete deploying the environment variable for users via Microsoft Intune.
When you deploy environment variables via Microsoft Intune, your changes will not take effect immediately. Devices in the selected Microsoft Entra ID groups will sync automatically over a period (generally 30 minutes); you can also manually sync all the devices in the chosen groups via Bulk Device Actions or restart your computer to implement your changes immediately. If you deploy environment variables via Microsoft Intune to a device where CDM is already running, you must restart CDM on that device for your changes to take effect.