nicolonsky / IntuneDriveMapping

Generate PowerShell scripts to map network drives on Intune managed Windows 10 devices
https://intunedrivemapping.azurewebsites.net/
MIT License
153 stars 18 forks source link

How to add to the script removing all mapped drives before mapping them #51

Open zoldy2000 opened 1 year ago

zoldy2000 commented 1 year ago

I have tested a few things myself and cannot get this to work. I would like to remove all drives before mapping them as we do now with local domain logon scripts. We find this cleaner because if the device boots offline the drives disconnect and do not map. Can someone assist with how and where to add "net use * /delete /y" or some other code to accomplish this and were to place in the script. Thank you

gcsprojects commented 6 months ago

Came here looking to ask the same thing as we're not seeing them refresh correctly as we migrate away from GPOs

What I'm finding is that once a drive has been mapped, any changes don't get reflected until we disconnect all the drives and rerun the scheduled task. This is most noticeable when you change the label of the drive - if the drive is already mapped, that label doesn't get refreshed, but I think its also the reason why any drives that are not in the script are not actually removed but just put into a disconnected state with a red "X"

fr3dr1x commented 4 weeks ago

Check my reply: https://github.com/nicolonsky/IntuneDriveMapping/issues/31#issuecomment-2446083365