I built a SOC lab with Microsoft Sentinel, Microsoft Defender XDR, and a Windows virtual machine to practice the investigation workflow I’m studying for SC-200. I wanted to see how a Windows process event becomes something an analyst can investigate. I traced it from endpoint telemetry to a KQL hunt, a custom detection alert, and a correlated incident.
The custom rule fired on a controlled discovery event. Defender later showed that alert and a separate Windows Security log-clearing alert in a single incident on the same endpoint. The interesting part was deciding how much each signal could tell me about the activity.
Lab overview#
I used a private lab tenant and a local Windows VM. An administrator account was used for setup. For an operational SOC, I would scope analyst and configuration permissions to the tasks each person needs to perform.
| Component | Role in this lab |
|---|---|
| Windows virtual machine | Isolated endpoint for controlled lab activity |
| Microsoft Defender for Endpoint | Collected device and process telemetry |
| Microsoft Defender XDR | Advanced Hunting, custom detection, and incident review |
| Microsoft Sentinel | Connected workspace for reviewing selected Defender data |
Endpoint events reached Defender for Endpoint and became available in Defender XDR. I used Advanced Hunting to query them, then used the Defender XDR integration to review selected data in the Sentinel workspace. The custom detection and case review took place in Defender XDR.
Part 1 — Build the environment#
Step 1. Create the Azure subscription#
I started with an Azure trial subscription for the Sentinel and Log Analytics resources. The Windows VM ran locally, so this setup didn’t require an Azure VM. Before creating cloud resources, I checked the billing scope and trial terms in the portal. I kept the workspace in a dedicated resource group to make the lab easier to identify and clean up.
Step 2. Start the Microsoft 365 trials#
I used a Microsoft 365 Business Premium trial and the Defender and Purview Suites add-on for Business Premium. My lab notes record these as separate trials. The useful check was whether my tenant could use Defender for Endpoint Plan 2, because the investigation depended on endpoint telemetry, Advanced Hunting, and the device timeline. Trial availability, entitlements, and renewal dates depend on the tenant and offer.
Step 3. Verify Defender for Endpoint Plan 2#
I confirmed the add-on was assigned in the Microsoft 365 admin center, then opened the Microsoft Defender portal and checked Settings → Endpoints → Licenses. In my lab I switched from Defender for Business to Defender for Endpoint Plan 2 and waited for the subscription state to update. In the Endpoints settings, I also enabled Live Response for the lab. The detection workflow below uses the available telemetry and doesn’t require a Live Response session.
Step 4. Create a Log Analytics workspace and connect Sentinel#
- In the Azure portal, open Log Analytics workspaces and create a workspace in a dedicated lab resource group.
- Select the subscription and region. I used East US for this lab.
- After deployment, open Microsoft Sentinel and enable it for the workspace.
- Confirm the workspace is available in the Microsoft Defender portal before moving on to endpoint onboarding and data checks.
The workspace is the Azure resource that holds the Sentinel data. The Defender portal is where I reviewed the combined lab data.
Step 5. Prepare the Windows VM#
I used a local Windows VM as the test endpoint. Before onboarding, record the current operating system, hostname, VM platform, and assigned lab account in your private notes. My original captures came from more than one session, so I use lab endpoint throughout this writeup and cite the Windows 10 verification capture for that specific check.
Step 6. Onboard the VM to Defender for Endpoint#
- In the Defender portal, open endpoint onboarding and select the Windows operating system group for the VM.
- Select Streamlined connectivity if available for your environment. For the single test device, I used Local script as the deployment method.
- Download the onboarding package from the lab tenant. Extract it on the VM and run the included script from an elevated prompt.
- In Assets → Devices, open the device record and check that the endpoint is onboarded and reporting. I ran the portal’s built-in detection test and confirmed the resulting test alert appeared in Defender.
I also checked the local sensor service and onboarding state while the VM was online.
Get-Service -Name Sense | Format-List Status, Name, DisplayName
Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows Advanced Threat Protection\Status" -Name OnboardingState
sc.exe query senseOn the verified VM, the service reported Running and OnboardingState was 1. The Defender device record and test alert confirmed that the endpoint was also reporting to the service.

Step 7. Check the Defender XDR integration in Sentinel#
I checked the Microsoft Defender XDR data connector for the workspace and enabled the event tables used in the lab.
| Table | Why I selected it |
|---|---|
DeviceInfo |
Check that the Windows endpoint was reporting |
DeviceProcessEvents |
Review process activity and its initiating process |
DeviceNetworkEvents |
Keep network activity available for follow-up |
The lab’s connector settings included incidents and alerts along with selected events. Microsoft documents that the connector is automatically enabled when a Sentinel workspace is onboarded to the Defender portal. Check the connector state in your own workspace before following the manual Azure portal steps.
Step 8. Verify that data is arriving#
In Hunting → Advanced Hunting, I opened the lab workspace and ran a small query to confirm that device records were available.
DeviceInfo
| take 10
The endpoint tables were empty during my first check. They began returning data after the tenant finished configuring Defender and the VM stayed online. When troubleshooting, I’d check the selected workspace and time range, then confirm the VM is online and the sensor is healthy before changing the detection query.
Part 2 — Hunt, detect, and investigate#
Step 9. Prepare controlled lab telemetry#
I used Atomic Red Team in the isolated Windows VM for the lab validation. I reviewed the system information discovery test details before running it and used that single endpoint for the test activity. For the investigation I tracked the test window, the target endpoint, and the expected process event so I could check whether the hunt found the activity I intended to generate.
Step 10. Hunt for system information discovery#
For the hunt, I used a controlled system information discovery event from the lab. MITRE ATT&CK T1082 describes this behavior. On Windows, systeminfo.exe is also a normal administrative utility, so the same process name can appear in routine activity.
DeviceProcessEvents
| where FileName =~ "systeminfo.exe"
| project Timestamp, ReportId, DeviceId, DeviceName,
FileName, ProcessCommandLine, InitiatingProcessCommandLine
| sort by Timestamp desc
The timestamp helped me place the event in the timeline. The process command line and initiating process showed what ran and what launched it. I also retained the event and device identifiers in the query so the custom detection could associate the result with the right endpoint.
Step 11. Configure the custom detection#
In the Advanced Hunting editor, I selected Create detection rule and reviewed these settings before submitting the rule.
| Wizard step | Lab setting |
|---|---|
| General | Suspicious System Reconnaissance (T1082), Continuous (NRT), Informational |
| Alert settings | Discovery category and T1082 mapping |
| Impacted asset | Device mapped to DeviceId |
| Related evidence | Process and initiating process command lines |
| Incident settings | Included in incident correlation |
| Automated actions | None configured for the lab rule |




Step 12. Validate the custom alert#
I opened Incidents & alerts in Defender and found Automated Reconnaissance Script Detected (systeminfo). I checked its informational severity, custom detection source, and impacted endpoint. This confirmed that telemetry reached Advanced Hunting, the rule matched it, and the alert preserved device context for the analyst.
Step 13. Review the event log cleared alert#
The second test produced a built-in Event log was cleared alert in Defender. I reviewed it as a separate signal and compared the device and event time with the discovery alert. In a real investigation I would check whether the same time and device are represented in centrally collected data, then review any authorized maintenance for that window.
Step 14. Investigate incident correlation#
| Signal | What I observed |
|---|---|
| Custom discovery alert | Defender raised an informational alert for the process event. |
| Event log cleared | A separate built-in alert appeared on the same Windows endpoint during the lab. |
| Incident view | Defender displayed both alerts in a single case and associated them with the same device. |
Grouping gave me one timeline to investigate. I would start with the process lineage and account activity around each timestamp, then check whether another alert or endpoint event supports a connection. The shared incident is useful context. Establishing a common cause would require additional evidence.
Cleanup and costs#
- Confirm which trials are still active and cancel any subscriptions that are no longer needed. Check the renewal dates in the tenant’s billing screens.
- Review Azure Cost Management for the Sentinel workspace, including any ingestion or retention charges. Remove the dedicated resource group when its resources and retained evidence are no longer needed.
- Remove the test artifacts from the VM, restore its original protection settings, and confirm the endpoint is back in its expected state.
What I would test next#
A process-name match is a useful first check for a lab. In an operational environment, the same query could flag routine inventory scripts and troubleshooting. Informational severity helps communicate the confidence of the signal. The match criteria still determine which events generate alerts.
My next step would be to collect examples of legitimate administrative use and compare their parent processes, accounts, and timing with the lab event. That would give me data to test any tuning decision. I would also capture when Defender first displayed the combined case if I wanted to measure the time it took to group the alerts.
References#
- Microsoft Learn — Advanced Hunting in Microsoft Defender
- Microsoft Learn — Onboard Windows devices with a local script
- Microsoft Learn — Prerequisites for deploying Microsoft Sentinel
- Microsoft Learn — Create custom detection rules
- Microsoft Learn — Stream Defender XDR data to Microsoft Sentinel
- MITRE ATT&CK — System Information Discovery (T1082)