How to install .NET Desktop Runtime on multiple computers in domain environment ?

Michał Pachnik 0 Reputation points
2025-01-03T12:53:53.2366667+00:00

Hello, as a prerequisite for deploying some app, I need to install .NET Desktop Runtime current version (8.0.11) on all our computers (couple hundred) in AD domain environment (Windows Server 2019) . The easiest way would be using MSI, but Microsoft for some reason don’t provide this installation method. I tried making my own msi installation file, I took .exe installation file, used “exe to msi converter” (from Microsoft store), checked for installation parameters (should be /install /quiet /norestart ), but it doesn’t do anything, on a test target PC it doesn’t even start (there is no events in event log). Also I tried other software for MSI installation it uses command (msiexec /i “filename.exe” WRAPPED_ARGUMENTS="/install /quiet /norestart") but it also doesn’t work. So I have a couple of questions, do someone know a place for downloading MSI or a correct way of making and deploying one , or maybe some other network installation method (without using third party paid software). I know there is also a powershell install script but I don’t know if it is possible to use it on the network on all computers.  

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,068 questions
.NET Runtime
.NET Runtime
.NET: Microsoft Technologies based on the .NET software framework.Runtime: An environment required to run apps that aren't compiled to machine language.
1,187 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jiachen Li-MSFT 33,196 Reputation points Microsoft Vendor
    2025-01-06T07:23:45.7566667+00:00

    Hi @Michał Pachnik ,

    You can install the .NET Desktop Runtime on all computers in a domain at once using PowerShell.

    Ensure you have domain admin privileges and Windows Firewall allows PowerShell Remoting and file sharing is enabled.

    Download the offline installer for .NET Desktop Runtime (EXE or MSI) and place it in a shared folder accessible by all domain computers (e.g., \\ServerName\SharedFolder\dotnet-runtime-x64.exe).

    Uses Invoke-Command to remotely execute the installer on each domain computer:

    # Define the shared location of the installer
    $installerPath = "\\ServerName\SharedFolder\dotnet-runtime-x64.exe"
    $arguments = "/quiet /norestart"
    
    # Get a list of all computers in the domain
    $computers = Get-ADComputer -Filter * | Select-Object -ExpandProperty Name
    
    # Install on each computer
    foreach ($computer in $computers) {
        Write-Host "Installing .NET Runtime on $computer..."
    
        # Check if the computer is online
        if (Test-Connection -ComputerName $computer -Count 1 -Quiet) {
            try {
                Invoke-Command -ComputerName $computer -ScriptBlock {
                    param ($installerPath, $arguments)
                    Start-Process -FilePath $installerPath -ArgumentList $arguments -Wait
                } -ArgumentList $installerPath, $arguments -ErrorAction Stop
    
                Write-Host "Installation completed on $computer."
            } catch {
                Write-Host "Failed to install on $computer: $_"
            }
        } else {
            Write-Host "$computer is offline. Skipping."
        }
    }
    

    Best Regards.

    Jiachen Li


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.