This is the solution that I have come up with that works in my environment. I cannot speak to how this may work in other environments.
Begin by packaging just the VisualStudio2022ProfessionalSetup.exe with the “Microsoft-Win32-Content-Prep-Tool” (https://github.com/Microsoft/Microsoft-Win32-Content-Prep-Tool).
-Sidenote: If you have never used the Win32 Content Prep Tool here’s a quick rundown. Extract the files from the GitHub download to a location of your choosing. Run the “IntuneWinAppUtil.exe” as an administrator. The utility first asks for a Source Folders file path. The Source Folder is the “Package” that gets compressed and encrypted when you use the Utility. For instance, I will name my source folder “Package” and it will hold the application I want to push, such as VisualStudio2022ProfessionalSetup.exe.
Next, it will ask for a “Setup File” This will be the Install file within your source folder. For instance, VisualStudio2022Professional.exe will be the install file in my scenario, so I specify just the name of the file, VisualStudio2022Professional.exe.
Next, it will ask for an “Output Folder” This is where you want the generated “.IntuneWinFile” to be outputted.
Next, it will ask if you want to specify a “catalog folder” You can hit “N” for No.
Now that you have the “.IntuneWinFile” you want to go to the Intune Portal and add an app with the App Type as Win32. Select the app package file, select the “.IntuneWinFile” and
On the App Information Page fill out the App Information to your liking. Try to be as accurate as possible especially when it comes to the Name, Description, Publisher, and App Version Fields as those are what users see in Company Portal, if you set the application as an Available install (more on that later).
On the Program page, my Install Command and Uninstall commands are set to:
VisualStudio2022ProfessionalSetup.exe –quiet –productKey 12345-12345-12345-12345-12345
VisualStudio2022ProfessionalSetup.exe uninstall –installPath “C:\Program Files\Microsoft Visual Studio\2022\Professional” –quiet
*NOTE* I have noticed that if a user opens Visual Studio before it has fully finished installing, the ProductKey does not get applied and will need to be inputted after the full installation. To prevent the user from opening up the application early I usually do not tell them it’s installed until after it has been detected by Intune OR I check for myself.
I set the install time to 15 minutes, and it does take this long, even without any added extensions. It is up to your choosing whether or not to allow them to uninstall.
On the Requirements Page, select the requirements that are needed within your environment.
On the Detection Rules Page, I set a Manually Configured Detection Rule that looks at this file path:
C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE
The detection rule determines if the IDE file or folder exists.
*NOTE* I have witnessed Intune take up to 72 hours to detect the application to be installed.
On the Dependencies Page, you can specify any dependencies you may have in your environment, I have none.
On the Supersedence Page, you can specify another version of Visual Studio to supersede this one. In my case I have none.
On the Scope Tags Page, you can specify the scope tags if you have any. In my case, I do not have one for this application
On the Assignments Page, you will select what groups are included and excluded from your application and whether or not you want to set it as an Available Application or a Required Application. Available will require the end user to install it from Company Portal. Required will install the application as soon as possible, unless specified otherwise.
You now should have a fully functional Visual Studio 2022 Professional Application in Intune. I always test my applications on a few test machines that are put in different scenarios so I can see the outcome. Always test your applications, scripts, and policies before deploying them.
You can Monitor the progress of the application installation on the overview page.
Best of luck!
Extra information: If the VS 2022 Pro License does NOT get applied during the installation for any reason you can remotely license the application via a remote CMD.
Download PStools “https://learn.microsoft.com/en-us/sysinternals/downloads/pstools”
Extract the folder and put that PStools folder somewhere easy to get to on your machine. I put mine right on the root of “c:”
Open an elevated CMD and in my case use the command “cd c:\PStools” to navigate to your PStools folder. Run this command “psexec \\hostname”. As long as you have the proper firewall rules set, you should be able to now use a remote cmd on the target computer. If you do get denied access, follow this article “https://ozitpro.wordpress.com/2016/08/09/allowing-psexec-on-windows-10-pcs/”
Now that you’re on that computer’s CMD use the commands below:
cd C:\Program Files\Microsoft Visual Studio\2022\Professional\Common7\IDE
storePID.exe 12345-12345-12345-12345-12345