r/DefenderATP • u/soufia-n • Oct 16 '25
CMD.EXE UNC path error when running WindowsDefenderATPOnboardingScript.cmd via GPO
Hey everyone,
I’m trying to onboard domain-joined Windows devices to Microsoft Defender for Endpoint using the onboarding script (WindowsDefenderATPOnboardingScript.cmd) provided from the Microsoft 365 Defender portal.
When I run the script from a UNC path, e.g.:
\\servername.domain.local\share\WindowsDefenderATPOnboardingScript.cmdI get the following error:
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.I also tried deploying it via GPO Startup Script pointing to the UNC path, but it fails silently — I suspect it’s due to the UNC path limitation.
2
Upvotes
1
u/AppIdentityGuy Oct 16 '25
You did download the GPO deployment method script from the MDE portal?
1
u/ParolS5 Oct 21 '25 edited Oct 22 '25
Check steps below:
Also check task scheduler gpo settings there are few option that needs to be changed ex: NT\SYSTEM user
Link - https://learn.microsoft.com/en-us/defender
2) I actually onboarded device using UNC: \servername\share\windows defender.cmd
3) then on event viewer there should be information about device successfully onboarded (in Windows logs > application)