Forum Discussion
Mapping legacy server shares in Intune on Windows 10 MDM
- Jul 03, 2018
I wish I saw this earlier because I ended up making my own. Looks like this one has some more feature rich than what I wrote. Great job!
JosLieben Is there a configuration that can map drives to network shared folders for SYSTEM context?
e.g. Lenovo Vantage runs as a service in SYSTEM context, and can be configured to access a custom UNC path instead of Lenovo's regular support center web site. However that means it does not use any user's credentials or Windows session, and none of their mapped drives.
- Thijs LecomteMar 12, 2020Bronze Contributor
You could try executing the map share file command with psexec
https://stackoverflow.com/questions/77528/how-do-you-run-cmd-exe-under-the-local-system-account- icelavaMar 13, 2020Brass Contributor
Thijs Lecomte I've learnt how to deal with it using the Scheduled Tasks avenue to map on OS startup. 🙂 After fiddling with schtasks a while, eventually went the Powershell route because it's got more granular control over power/battery conditions.
$taskName = "MapDrive_ForSYSTEM"
Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction Ignore$stAction = New-ScheduledTaskAction -Execute "net" -Argument "use S: http://127.0.0.1 /persistent:yes /user:.\username password"
$stTrigger = New-ScheduledTaskTrigger -AtStartup
$stPrincipal = New-ScheduledTaskPrincipal -UserId "NT AUTHORITY\SYSTEM" -LogonType ServiceAccount
$stSettings = New-ScheduledTaskSettingsSet -AllowStartIfOnBatteries
$st = New-ScheduledTask -Action $stAction -Trigger $stTrigger -Principal $stPrincipal -Settings $stSettings
Register-ScheduledTask -TaskName $taskName -InputObject $st