Port menu greyed in Active Directory environment

I work in IT for a K-12 school district and our Windows domain joined PCs are quite locked down for our students. I managed to get 1.8.19 working last year by whitelisting the path to %LOCALAPPDATA%\Arduino15 (or perhaps that was left over from testing IDE 2.2.1, and there was another fix I'm forgetting).

In any case, the teacher claims he is having trouble with 1.8.19 and would like to use the latest IDE instead.

I found that the MSI installer for 2.3.3 installs to "%LOCALAPPDATA%\Programs\arduino-ide" and I couldn't find the correct switches to make it install for all users. Luckily I found that the EXE has this option. With the app installed to %PROGRAMFILES%, standard users have no problem launching the app.

The problem I'm seeing now is that when run under a student account, I cannot see any COM ports. The port menu is simply greyed out. If I run the IDE as an Administrator then things work fine. I attempted a few things in Group Policy, but didn't have much luck.

Now at home and testing further on my personal PC, I see that standard Windows users have no issue seeing COM ports by default.

This is obviously related to a restriction policy, which I will continue troubleshooting next week. I'm just wondering if there are others out there who could shed some light on what I should look at next.

Thanks!

Hi @skyblaster

It is ALLUSERS=1.

For example:

msiexec /i arduino-ide_2.3.3_Windows_64bit.msi ALLUSERS=1

The list of ports is provided by a tool named serial-discovery. It might be that either serial-discovery is being prevented from running entirely, or else that the communication between serial-discovery and Arduino IDE is being blocked.

If you find that serial-discovery is running and there is nothing blocking the communication, you can try running the serial-discovery tool directly to check whether the tool itself is able to discover the ports. I'll provide instructions you can follow to do that:


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


During all this, keep an eye out for anything that doesn't match the expected behavior as described at each step.

  1. Open the following folder in Windows "File Explorer":
    C:\Users\<username>\AppData\Local\Arduino15\packages\builtin\tools\serial-discovery
    
    (where <username> is your Windows username)
    Note that the AppData folder is hidden by default in "File Explorer". You can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  2. The serial-discovery folder will contain a subfolder for each of the versions of serial-discovery which are installed on your computer.
    For example:
    serial-discovery/
    ├── 1.3.0/
    ├── 1.3.0-rc1/
    └── 1.3.2/
    
  3. Hold the Shift key while clicking the right hand button on the mouse on the folder with the highest version (1.3.2 in the example above).
    A context menu will open.
  4. Select "Open PowerShell window here" from the menu.
    PowerShell will now open.
  5. Type the following command:
    .\serial-discovery
    
  6. Press the Enter key.
    serial-discovery will now start. There won't be any obvious sign of this other than that there is no longer a command prompt at the cursor in the terminal.
  7. Type the following command:
    HELLO 1 "arduino-cli 0.20.2"
    
  8. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "hello",
      "protocolVersion": 1,
      "message": "OK"
    }
    
  9. Unplug your Arduino board from your computer if you have it plugged in.
  10. Type the following command:
    START_SYNC
    
  11. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "start_sync",
      "message": "OK"
    }
    
    You might also see some additional objects in the output depending on which serial ports are available on your computer.
  12. Plug your Arduino board into your computer.
    You should now see a response printed that looks something like this:
    {
      "eventType": "add",
      "port": {
        "address": "COM42",
        "label": "COM42",
        "protocol": "serial",
        "protocolLabel": "Serial Port (USB)",
        "properties": {
          "pid": "0x804e",
          "vid": "0x2341",
          "serialNumber": "EBEABFD6514D32364E202020FF10181E"
        }
      }
    }
    
    This is only an example of what you might see. The output will be different depending on the board you connected.
  13. Unplug your Arduino board from your computer.
    You should now see a response printed that looks something like this:
    {
      "eventType": "remove",
      "port": {
        "address": "COM42",
        "protocol": "serial"
      }
    }
    
    This is only an example of what you might see. The address field value should be the same as the "add" event you saw when you plugged the board in.

You should continue to see the same results if you repeat steps (12) and (13).

Once you are done with your experiments with the "serial-discovery" tool, follow these instructions to exit:

  1. Type the following command:
    STOP
    
  2. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "stop",
      "message": "OK"
    }
    
  3. Type the following command:
    QUIT
    
  4. Press the Enter key.
    You should now see a response printed exactly like this:
    {
      "eventType": "quit",
      "message": "OK"
    }
    
    You should now be back at the shell command line.