nicolonsky / IntuneDriveMapping

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

Use system variables as drive label? #34

Closed elephantgrenades closed 2 years ago

elephantgrenades commented 3 years ago

Our org uses the $env:USERNAME variable to map our user folders. Looking at the script, I can't see a way that doesn't treat that as a string. Is there a alternative way to map the drive with a variable name?

nicolonsky commented 3 years ago

https://github.com/nicolonsky/IntuneDriveMapping/wiki#adding-network-drive-mapping-entries

On 19 Aug 2021, at 18:46, elephantgrenades @.***> wrote:



Our org uses the $env:USERNAME variable to map our user folders. Looking at the script, I can't see a way that doesn't treat that as a string. Is there a alternative way to map the drive with a variable name?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnicolonsky%2FIntuneDriveMapping%2Fissues%2F34&data=04%7C01%7Cnicola%40nicolasuter.ch%7Caa069cc5051a491f7f1408d96330f2b1%7C7955e1b3cbad49eb9a84e14aed7f3400%7C1%7C0%7C637649884160520692%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=zMha71kp1hWNOHhpiTgonrUfz7%2B0iNaSJfIVmdFzbfQ%3D&reserved=0, or unsubscribehttps://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAH3AFKU2XDOJEK65YL6455LT5UYPXANCNFSM5COTO3XQ&data=04%7C01%7Cnicola%40nicolasuter.ch%7Caa069cc5051a491f7f1408d96330f2b1%7C7955e1b3cbad49eb9a84e14aed7f3400%7C1%7C0%7C637649884160530646%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=F8oAoAQqqcoU1EO0XnYY6xGTnd%2B2%2B0SJdI9PvCz0RAU%3D&reserved=0.

elephantgrenades commented 3 years ago

Apologies. I should have used clearer language. I'm looking for a way to use a variable as the label display name. So, H: maps as $env:USERNAME. If Joe Smith's AD account was jsmith, then H: would map as jsmith in WIndows Explorer.

Display Name - reflects the name displayed in windows explorer.

Is that possible?

elephantgrenades commented 3 years ago

Bump. Anyone have an idea if what I'm asking is possible?

elephantgrenades commented 2 years ago

I finally had time to look at this more in depth and found that if the Display Name is left blank or labeled as null the drive maps with the name of the logged in user. Thanks.