|
| 1 | +--- |
| 2 | +title: Detect Windows workstations and servers with a local script |
| 3 | +description: Learn about how to detect Windows workstations and servers on your network using a local script. |
| 4 | +ms.date: 07/12/2022 |
| 5 | +ms.topic: how-to |
| 6 | +--- |
| 7 | + |
| 8 | +# Detect Windows workstations and servers with a local script |
| 9 | + |
| 10 | +In addition to detecting OT devices on your network, use Defender for IoT to discover Microsoft Windows workstations and servers. Same as other detected devices, detected Windows workstations and servers are displayed in the Device inventory. The **Device inventory** pages on the sensor and on-premises management console show enriched data about Windows devices, including data about the Windows operating system and applications installed, patch-level data, open ports, and more. |
| 11 | + |
| 12 | +This article describes how to configure Defender for IoT to detect Windows workstations and servers with local surveying, performed by distributing and running a script on each device. While you can use active scanning and scheduled WMI scans to obtain this data, working with local scripts bypasses the risks of running WMI polling on an endpoint. Running a local script is also useful for regulated networks that have waterfalls and one-way elements. |
| 13 | + |
| 14 | +For more information, see [Configure Windows Endpoint Monitoring](configure-windows-endpoint-monitoring.md). |
| 15 | + |
| 16 | +## Supported operating systems |
| 17 | + |
| 18 | +The script described in this article is supported for the following Windows operating systems: |
| 19 | + |
| 20 | +- Windows XP |
| 21 | +- Windows 2000 |
| 22 | +- Windows NT |
| 23 | +- Windows 7 |
| 24 | +- Windows 10 |
| 25 | +- Windows Server 2003/2008/2012/2016 |
| 26 | + |
| 27 | +## Prerequisites |
| 28 | + |
| 29 | +Before you start, make sure that you have: |
| 30 | + |
| 31 | +- Administrator permissions on any devices where you intend to run the script |
| 32 | +- A Defender for IoT OT sensor already monitoring the network where the device is connected |
| 33 | + |
| 34 | +If an OT network sensor has already learned the device, running the script will retrieve its information and enrichment data. |
| 35 | + |
| 36 | +## Run the script |
| 37 | + |
| 38 | +This procedure describes how to obtain, deploy, and run the script on the Windows workstation and servers that you want to monitor in Defender for IoT. |
| 39 | + |
| 40 | +The script you run to detect enriched Windows data is run as a utility and not as an installed program. Running the script doesn't affect the endpoint. |
| 41 | + |
| 42 | +1. To acquire the script, [contact customer support](mailto:support.microsoft.com). |
| 43 | + |
| 44 | +1. Deploy the script once, or using ongoing automation, using standard automated deployment methods and tools. |
| 45 | + |
| 46 | +1. Copy the script to a local drive and unzip it. The following files appear: |
| 47 | + |
| 48 | + - `start.bat` |
| 49 | + - `settings.json` |
| 50 | + - `data.bin` |
| 51 | + - `run.bat` |
| 52 | + |
| 53 | +1. Run the `run.bat` file. |
| 54 | + |
| 55 | + After the script runs to probe the registry, a CX-snapshot file appears with the registry information. The filename indicates the system name, date, and time of the snapshot with the following syntax: `CX-snaphot_SystemName_Month_Year_Time` |
| 56 | + |
| 57 | +Files generated by the script: |
| 58 | + |
| 59 | +- Remain on the local drive until you delete them. |
| 60 | +- Must remain in the same location. Do not separate the generated files. |
| 61 | +- Are overwritten if you run the script again. |
| 62 | + |
| 63 | +## Import device details |
| 64 | + |
| 65 | +After having run the script as described [earlier](#run-the-script), import the generated data to your sensor to view the device details in the **Device inventory**. |
| 66 | + |
| 67 | +**To import device details to your sensor**: |
| 68 | + |
| 69 | +1. Use standard, automated methods and tools to move the generated files from each Windows endpoint to a location accessible from your OT sensors. |
| 70 | + |
| 71 | + Do not update filenames or separate the files from each other. |
| 72 | + |
| 73 | +1. On your OT sensor console, select **System Settings** > **Import Settings** > **Windows Information**. |
| 74 | + |
| 75 | +1. Select **Import File**, and then select all the files (Ctrl+A). |
| 76 | + |
| 77 | +1. Select **Close**. The device registry information is imported and a successful confirmation message is shown |
| 78 | + |
| 79 | + If there's a problem uploading one of the files, you'll be informed which file upload failed. |
| 80 | + |
| 81 | +## Next steps |
| 82 | + |
| 83 | +For more information, see [View detected devices on-premises](how-to-investigate-sensor-detections-in-a-device-inventory.md). |
0 commit comments