How to enable Remote Assistance and add an exception for it in Windows Firewall from the command line?

11,913

To allow remote assistance in firewall:
netsh advfirewall firewall set rule group="remote assistance" new enable=Yes

For adding/editing a registry key:
reg add "HKLM\System\CurrentControlSet\Control\Remote Assistance" /v fAllowToGetHelp /t REG_DWORD /d 1 /f

Share:
11,913

Related videos on Youtube

Phoenix Logan
Author by

Phoenix Logan

Updated on September 18, 2022

Comments

  • Phoenix Logan
    Phoenix Logan over 1 year

    I need to enable Remote Assistance from the command line. The equivalent of checking this box and hitting Apply.

    enter image description here

    This is for automation and I tried editing the registry entry HKLM\System\CurrentControlSet\Control\Remote Assistance\fAllowToGetHelp but the troubleshooter comes up and needs it to allow it through the firewall.

    This page says how to allow ports through the firewall, but not how to add applications, and I see here that the firewall settings vary depending on the network type. How can I automate this like the check box, which just figures everything out automatically?

    When the message comes up saying This computer is not set up for invitations, I can click Repair. When I do this, the troubleshooter automatically fixes everything, but it is visible and requires me to close it manually when it's finished. It's msdt.exe, but I'm not sure how to use it from the command line. I used Process Explorer to see what msra.exe was doing, but the answer file (which tells the troubleshooter what answers to use for questions it asks) it passed to the troubleshooter was deleted by the time I tried to open it. Also, I need the msdt.exe to automatically close.

    I've been searching for hours but could not find anything helpful.

    • Ƭᴇcʜιᴇ007
      Ƭᴇcʜιᴇ007 almost 10 years
      Use policies (gpedit.msc).
    • Phoenix Logan
      Phoenix Logan almost 10 years
      I can't, because I am automating it (not on corporate computers). It's for an application that automatically sets up Remote Assistance, but it has to enable it first. It sets up the password and securely sends the invitation file. I need to do it from the command line, and gpedit.msc is not supported unless you're on a Pro installation of Windows.
  • Ƭᴇcʜιᴇ007
    Ƭᴇcʜιᴇ007 almost 10 years
    "Remote Desktop" is not the same as "Remote Assistance".
  • Phoenix Logan
    Phoenix Logan almost 10 years
    I'll see if this works. That's brilliant!
  • Phoenix Logan
    Phoenix Logan almost 10 years
    Works great! The checkbox is even checked now.
  • redrage
    redrage about 4 years
    sorry for the necro, but just got back on here from .. years. Thank you for the correction!