The answer is that the script uses the wrong Graph API endpoint, causing all devices to be wiped. The correct Microsoft Graph endpoint for wiping a managed device is `/deviceManagement/managedDevices/{deviceId}/wipe`, which targets a specific device by its Intune device ID. If the script instead uses a generic endpoint like `/devices/{deviceId}/wipe` or an incorrect path, the API may misinterpret the request and apply the wipe action to every device in the tenant, including compliant ones, rather than only the noncompliant targets. On the MD-102 exam, this scenario tests your understanding of Intune device action APIs and the importance of precise endpoint syntax—a common trap is confusing the broader `/devices` endpoint with the Intune-specific `/deviceManagement/managedDevices` path. To avoid this, remember the memory tip: “Managed devices need the full management path—don’t wipe the whole tenant with a shortcut.”
MD-102 Prepare infrastructure for devices Practice Question
This MD-102 practice question tests your understanding of prepare infrastructure for devices. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
Exhibit
Refer to the exhibit.
$devices = Get-MgDeviceManagementManagedDevice -Filter "operatingSystem eq 'Windows'"
foreach ($device in $devices) {
if ($device.ComplianceState -ne 'compliant') {
Invoke-MgDeviceManagementManagedDevice -ManagedDeviceId $device.Id -Action wipe
}
}
Refer to the exhibit. You execute this PowerShell script to wipe noncompliant Windows devices. After running, you find that some compliant devices were also wiped. What is the most likely reason?
Clue words in this question
Noticing these words before you look at the options changes how you read each choice.
Clue: "most likely"
Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
Refer to the exhibit.
$devices = Get-MgDeviceManagementManagedDevice -Filter "operatingSystem eq 'Windows'"
foreach ($device in $devices) {
if ($device.ComplianceState -ne 'compliant') {
Invoke-MgDeviceManagementManagedDevice -ManagedDeviceId $device.Id -Action wipe
}
}
A
The filter 'operatingSystem eq 'Windows'' does not match any devices, so the script wiped all devices.
Why wrong: The filter is correct for Windows devices.
B
The script wipes only noncompliant devices, but some compliant devices had a null compliance state.
Why wrong: A null compliance state would be treated as noncompliant, but compliant devices should have a state of 'compliant'.
C
The script uses the wrong Graph API endpoint, causing all devices to be wiped.
The cmdlet Invoke-MgDeviceManagementManagedDevice does not exist; the correct cmdlet is Invoke-MgDeviceManagementManagedDeviceAction with proper parameters. The incorrect cmdlet might have unexpected behavior or default to wiping all devices.
D
The script does not check the device's compliance state before wiping.
Why wrong: The script does check with the if condition.
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
The script uses the wrong Graph API endpoint, causing all devices to be wiped.
Option C is correct because the script uses the wrong Graph API endpoint. The correct endpoint for wiping a device is `/deviceManagement/managedDevices/{deviceId}/wipe`, but the script likely uses an incorrect or generic endpoint (e.g., `/devices/{deviceId}/wipe` or a non-existent path), which causes the API to misinterpret the request or apply the wipe action to all devices in the tenant, including compliant ones. This is a common misconfiguration when targeting the Microsoft Graph API for Intune device actions.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
✗
The filter 'operatingSystem eq 'Windows'' does not match any devices, so the script wiped all devices.
Why it's wrong here
The filter is correct for Windows devices.
✗
The script wipes only noncompliant devices, but some compliant devices had a null compliance state.
Why it's wrong here
A null compliance state would be treated as noncompliant, but compliant devices should have a state of 'compliant'.
✓
The script uses the wrong Graph API endpoint, causing all devices to be wiped.
Why this is correct
The cmdlet Invoke-MgDeviceManagementManagedDevice does not exist; the correct cmdlet is Invoke-MgDeviceManagementManagedDeviceAction with proper parameters. The incorrect cmdlet might have unexpected behavior or default to wiping all devices.
Clue confirmation
The clue word "most likely" in the question point toward this answer.
Related concept
Read the scenario before looking for a memorised answer.
✗
The script does not check the device's compliance state before wiping.
Why it's wrong here
The script does check with the if condition.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates assume the script logic is correct and focus on the compliance filter, but the real issue is the Graph API endpoint, which is a common misconfiguration that causes unintended mass actions.
Detailed technical explanation
How to think about this question
The Microsoft Graph API for Intune device wipe requires the endpoint `POST /deviceManagement/managedDevices/{managedDeviceId}/wipe`. If a developer mistakenly uses a different endpoint (e.g., `POST /devices/{deviceId}/wipe` or `POST /deviceManagement/managedDevices/wipe` without a device ID), the API may either fail silently or apply the action to all devices due to a fallback or misrouting. In real-world scenarios, this often happens when copying code from older Azure AD Graph or beta endpoints without updating to the v1.0 Intune endpoint.
KKey Concepts to Remember
Read the scenario before looking for a memorised answer.
Find the constraint that changes the correct option.
Eliminate answers that are true in general but not in this case.
TExam Day Tips
→Watch for words such as best, first, most likely and least administrative effort.
→Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A cloud solutions architect for a retail company is evaluating services for a new workload. The correct answer here reflects best practice for the specific scenario described — not a general cloud recommendation. Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option. Cloud exam questions reward reading the constraint carefully: the same technology can be right or wrong depending on the use case.
Related glossary terms
Concepts from this question explained
These glossary pages explain the core terms tested in this MD-102 question in full detail.
Prepare infrastructure for devices — This question tests Prepare infrastructure for devices — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: The script uses the wrong Graph API endpoint, causing all devices to be wiped. — Option C is correct because the script uses the wrong Graph API endpoint. The correct endpoint for wiping a device is `/deviceManagement/managedDevices/{deviceId}/wipe`, but the script likely uses an incorrect or generic endpoint (e.g., `/devices/{deviceId}/wipe` or a non-existent path), which causes the API to misinterpret the request or apply the wipe action to all devices in the tenant, including compliant ones. This is a common misconfiguration when targeting the Microsoft Graph API for Intune device actions.
What should I do if I get this MD-102 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
Are there clue words in this question I should notice?
Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
This MD-102 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the MD-102 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.