-
-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update drive mapping issue #31
Comments
I'm not sure if this will help, but I had a similar request where they wanted the path to self correct in the event that a user changed path. I added a block in the script after the comment line 117. It checks to see if the drive letter and path match. If not, it deletes the mapping and the rest of the script continues to create the intended letter\path. Just make sure to update the intended path(s) in the script below. I hope this helps. if (-not (Test-RunningAsSystem)) {
Start-Sleep -Seconds 10 |
Hey @DaBXRoMeO |
Correct, after the comment section that starts "#Mapping network drive#" |
Thanks @DaBXRoMeO |
Add this after the JSON part (I dit it on line 37), it will remove a drive if doen't match the path values. |
Hi great script and with the addition from intune.training is working very well for remote users still needing a vpn connection etc.
This has all deployed via Intune\endpoint manager like a dream. I've now changed a couple of UNC paths to use a DFS path. I can see the new DriveMapping.ps1 is deployed correctly but the drive mapping doesn't update. If I manually delete the drive mapping the next time the task runs it will create the mapping using the new correct path so it's just the deletion of the old one not working.
Looking at DriveMapping.log I do see an error but I can't figure out why it's not deleting and re-creating the drive mapping
Mapping network drive \xxxxx.local\xxxxxxData\Store
PS>TerminatingError(New-PSDrive): "The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The local device name is already in use"
C:\ProgramData\intune-drive-mapping-generator\DriveMappping.ps1 : The local device name is already in use
At line:1 char:3
3\INTUNE1\DRIVEM~2.PS1}C:\ProgramData\intune-drive-mapping-generator\DriveMappping.ps1 : The local device name is already in use
At line:1 char:3
3\INTUNE1\DRIVEM~2.PS1}Any thoughts?
Thanks
Barry
The text was updated successfully, but these errors were encountered: