Access the Windows 10 device portal

Since RS1 (Anniversary Update) of Windows 10, a function called "device portal" is installed. This is a feature for developers. By accessing the device portal of another machine via the network, the inside information of the corresponding machine can be obtained.

The device portal can monitor and control the status of other machines connected to the network using a web browser.

If you use a web browser such as a mobile router or NAS to open the page indicated by the corresponding IP address, you can see the device settings and status, but the device portal is the same. Internally, a web server (http server) dedicated to the device portal is running, and it is accessed using a browser. In addition, an API that returns JSON in REST format is also defined, and it is possible to develop programs that can remotely configure necessary settings and obtain information.

● API reference https://docs.microsoft.com/ja-jp/windows/uwp/debug-test-perf/device-portal-api-core

In terms of security, it is a problematic function, so it is prohibited from operating in the initial state, and it is enabled only when the developer mode is turned on in the "Settings" app. Basically, any PC owner can easily turn it on, but if you're not sure, we recommend that you don't turn on developer mode itself. Also, if you have a PC that you take with you when you go out, you should never turn it on.

In the unlikely event that you connect to your local network and use the device portal, you should turn off the device portal and developer mode (developer mode itself reduces security) before you go out.

To use the device portal, turn on developer mode in Settings → Update & Security → For Developers. From RS2, you no longer need to restart even if you turn on developer mode.

To enable the device portal, first set to developer mode

When developer mode is turned on, "Enable Device Portal" can be turned on. When turned on, fields such as "authentication", "user name", and "password" are displayed below it.

Next, set "Enable Device Portal" to "On" and set the user name and password.

It sets the username and password used to access the device portal over the network. If you turn off the "Authentication" setting, you do not need to enter the user name etc., but since you do not need to enter the user name etc. from the second time onward due to the completion function of the browser, there is not much point in turning it off.

On the contrary, if it is turned off, it will be possible to easily use the device portal from all machines in the LAN. Files can be deleted from the device portal, or the machine can be shut down or restarted, which can be daunting if manipulated while working. You should always set a username and password to prevent easy access to the device portal.

In the past, when routers for the Internet began to spread, setting pages using web servers could be accessed from the Internet side as well. For this reason, mischief was popular in which routers for which passwords were not set were reset from one end. Even if you don't feel like mischief, you may accidentally see the settings page open and press the restart button displayed in your browser.

When using it for development, the user name and password may be the same as those of other machines. The point is to prevent users who do not know anything from easily accessing it, and it is better to think that it is not intended to increase security. In terms of image, it's like the "closure" on the button of the self-destruct device that you see in movies and anime.

Launch the device portal

The device portal is available on all versions of Windows 10, including Mobile and IoT, as well as the desktop version of Windows 10. However, there are differences in the initial settings and access methods. Let's actually access it from another machine. For Windows 10 Desktop, on the settings page, if you enable the device portal, the URL for access will be displayed below. Basically,

https: // [IP address]: 50443 http: // [IP address]: 50080

Windows 10のデバイスポータルにアクセスする

Use either. It depends on the model, but it seems that http is more responsive than https, probably because the load is different. It's also better to use Edge as your browser. When using IE, the page display may be strange.

The login page will appear first, so enter the user name and password set in the device portal. You can now open the device portal. In the case of https, the browser displays that it is a certificate error, but it is forcibly displayed. Depending on the browser, you may need to press a button to open the details page.

On the other hand, in the case of Windows 10 Mobile,

https: // [IP address]: 443 http: // [IP address]: 80

use. However, if authentication is turned on on the Windows 10 Mobile side, turn on "Settings"-> "Update and Security"-> "For Developers"-> "Device Detection" and press the pairing button below. Display the PIN.

To access the Windows 10 Mobile device portal, turn on device detection, press the "Pair" button to display the PIN, and enter it in the accessing web browser.

You can open the device portal by entering the displayed PIN in your browser. At this time, if "Remember my computer" is turned on, the PIN will be saved and you will be able to open the device portal directly from the next time.

On the left side of the device portal window is a list of pages that correspond to a feature called "Tool". Windows 10 Desktop and Mobile have different numbers of Tool pages. However, "Scratch" at the end is not a functional item because it is for the workspace where the tool is registered. Also, in reality, there are no pages in the initial state, and there are some tools that users can only view by assigning them to the workspace.

Scratch at the end is a workspace where you can freely register Tools.Click the hamburger icon at the top left of the window and select "Add tools to workspace" from the menu

Furthermore, in Windows 10 Desktop, the items are different between the current RS2 (Creators Update) and RS3 (Fall Creators Update). Probably not with Windows 10 Mobile, but I didn't know because I have only one Windows 10 Mobile machine.

The table below summarizes these. Many things are common, but Desktop has support for debugging and mixed reality features.

The basic usage is explained at the following URL.

https://docs.microsoft.com/ja-jp/windows/uwp/debug-test-perf/device-portal

Basically, all functions are used for developers to debug and verify software in some way, but Running processes etc. are when the process that seems to be problematic is forcibly stopped when the PC freezes. Can be used for.

In the past, these tasks had to use telnet (enabled Windows features) up to Windows 8 and ssh on Windows 10 (ssh server runs in developer mode on Windows 10). Using these functions, I ran cmd.exe and used commands such as tasklist and taskkill from there.

However, if you can use the device portal, you can find the program from here and kill it. However, Windows 10 Mobile's device portal doesn't currently have the ability to kill processes, it just displays a list of running processes. In the worst case, you can reboot or power off any platform from the device portal.

Also, if you are using the Preview version of RS3 on Windows 10 Desktop, you can display the USB Devices tool on Scratch etc. to display the information that Windows recognizes about the USB device.

USB Devices, which are not assigned to pages by default, can display information that Windows recognizes about the USB device.

The "Scratch" at the end of the list on the left side of the page is a "workspace" where you can arrange any function as a tab. Frequently used tools and highly related tools can be placed here. Since you can add multiple workspaces, you can create your own tool layout according to your work.

The workspace registration seems to be saved on the browser side, but there are workspace setting import and export functions, so the same workspace can be used on other machines. Although not specifically mentioned, the exported text file is in JSON format and should be readable by any platform web browser in principle.