Close / minimize all windows on specific monitor from command-line

GUIPropView is a tool for Windows that allows you to do many things (Hide, show, disable, enable, and more...) from command-line on the desired windows, according to their properties (Class Name, Title, Process, and so on...)

In order to close all opened windows on specific monitor from command-line, simply run the following command:
GUIPropView.exe /Action Close Visible:Yes Monitor:\\.\DISPLAY2

The above command requests to find all visible windows (Visible:Yes) that are located inside \\.\DISPLAY2 monitor, and then close all found Windows. You can find out the name of the display monitor by looking at the 'Monitor' column of every window in the upper pane of GUIPropView.

If you want to minimize all windows on specific monitor instead of closing, simply replace the 'Close' command with the 'Minimize' command:
GUIPropView.exe /Action Minimize Visible:Yes Monitor:\\.\DISPLAY2