logo elektroda
logo elektroda
X
logo elektroda

[Solved] Mapping Disks on Domain Accounts: Drive Mappings Script for Desktop Display

lukaes 6042 15
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 17097897
    lukaes
    Level 4  
    Posts: 35
    Rate: 1
    Hi,
    I have a question about drive mappings on domain accounts. I normally map the drive with a script, but it displays on my computer. I would like it to be mapped on the desktop. Anyone know how to do it?
  • ADVERTISEMENT
  • #2 17097957
    lesławek
    Level 32  
    Posts: 1529
    Help: 190
    Rate: 294
    make a shortcut ...
  • ADVERTISEMENT
  • #3 17097965
    lukaes
    Level 4  
    Posts: 35
    Rate: 1
    lesławek wrote:
    make a shortcut ...

    Ehh. If I wanted to make a shortcut, I would probably not include this topic here.
  • #4 17097968
    lesławek
    Level 32  
    Posts: 1529
    Help: 190
    Rate: 294
    What exactly do you want to do? Because it's not fully understood ... the contents of the root directory should be displayed as desktop icons?
  • #5 17097980
    lukaes
    Level 4  
    Posts: 35
    Rate: 1
    lesławek wrote:
    What exactly do you want to do? Because it's not fully understood ... the contents of the root directory should be displayed as desktop icons?


    I want the drive in my mobile profile to map to the desktop, not my computer's drives
  • #6 17098003
    sylweksylwina
    Moderator of Computers service
    Posts: 13170
    Help: 1875
    Rate: 2335
    And what's the difference with the abbreviation?
  • #7 17098007
    lukaes
    Level 4  
    Posts: 35
    Rate: 1
    sylweksylwina wrote:
    And what's the difference with the abbreviation?

    This needs to be done on multiple computers with multiple drives. It is much easier for me to make a script that will map them to my desktop than to map them manually on 20 computers
  • ADVERTISEMENT
  • #10 17098078
    jprzedworski
    Network and Internet specialist
    Posts: 5353
    Help: 757
    Rate: 824
    It is even more this direction.
  • #11 17098085
    lukaes
    Level 4  
    Posts: 35
    Rate: 1
    jprzedworski wrote:
    It is even more this direction.


    The disks map to me only in "my computer", not as I would like - on the desktop
  • ADVERTISEMENT
  • #12 17098341
    salmon
    VIP Meritorious for electroda.pl
    Posts: 3477
    Help: 435
    Rate: 262
    lukaes wrote:
    and not as I would like - on the desktop

    Then create yourself - via GPO - a shortcut on the desktop, what's the problem
  • Helpful post
    #13 17098358
    jprzedworski
    Network and Internet specialist
    Posts: 5353
    Help: 757
    Rate: 824
    I have just checked for a test. In "Default Domain Policy" -> User configuration -> Preferences -> Shortcuts I added a shortcut as in the picture (example) and there is a shortcut to this network drive on the desktop.

    Mapping Disks on Domain Accounts: Drive Mappings Script for Desktop Display

    Anyway, the first link from my previous post is just about taking a shortcut. For example, you can give him his own icon for distinction.
  • #14 17099601
    lukaes
    Level 4  
    Posts: 35
    Rate: 1
    jprzedworski wrote:
    I have just checked for a test. In "Default Domain Policy" -> User configuration -> Preferences -> Shortcuts I added a shortcut as in the picture (example) and there is a shortcut to this network drive on the desktop.

    Mapping Disks on Domain Accounts: Drive Mappings Script for Desktop Display

    Anyway, the first link from my previous post is just about taking a shortcut. For example, you can give him his own icon for distinction.


    Well, it's funny that I've been doing this for a long time and it doesn't work for me.
  • #15 17099740
    jprzedworski
    Network and Internet specialist
    Posts: 5353
    Help: 757
    Rate: 824
    Malice of inanimate objects ;) or some minor mistake. I have Windows Server 2016 + Windows 10 and it worked. I don't have it on a daily basis, because I don't want such shortcuts, but you can. I put it in the Default Domain Policy so as not to play around with little things. Since other rules work there, this one should too. I have no idea what else you need. I understand that what you want to connect to the desktop has been previously defined as a shared resource. Anyway, it wouldn't be possible to map it otherwise. And try to make such a shortcut manually on the desktop with the same path to the resource ("Target path" in GPO configuration).
  • #16 17099867
    lukaes
    Level 4  
    Posts: 35
    Rate: 1
    Everything is already working. There were minor permission issues.

    Added after 1 [minutes]:

    The @jprzedworski method works without any problems. I had a problem with file permissions.

Topic summary

✨ The discussion revolves around mapping network drives to the desktop for domain accounts using a script, specifically in a Windows Server 2016 environment. The user seeks a solution to have mapped drives appear on the desktop rather than in "My Computer." Responses suggest using Group Policy Objects (GPO) to create desktop shortcuts for network drives. A user confirmed success with this method after resolving minor permission issues. The conversation highlights the need for automation in mapping drives across multiple computers to streamline the process.
Generated by the language model.

FAQ

TL;DR: "Group Policy is refreshed in the background every 90 minutes, with a random offset of 0–30 minutes." Use a Group Policy Shortcuts preference to place network-drive icons on users’ Desktops, and fix permissions if icons don’t appear. [Group Policy fundamentals - Windows Client]

Why it matters: Admins who ask “how do I map drives to the desktop via domain logon?” can automate this reliably at scale for users.

Quick Facts

Can I map a network drive directly to the Desktop instead of This PC?

Not directly. Mapping creates a drive letter in File Explorer. To expose it on the Desktop, deploy a shortcut to the mapped drive or UNC path. Use Group Policy Preferences (Shortcuts) to push the icon domain-wide instead of creating it manually on each PC. [Elektroda, salmon, post #17098341]

How do I create a desktop shortcut to a mapped or UNC drive using Group Policy?

Use a Shortcuts preference item.
  1. In GPMC, edit a user‑scoped GPO: User Configuration > Preferences > Windows Settings > Shortcuts.
  2. New Shortcut: Action=Create, Location=Desktop, Target path=\server\share or H:\, set Name/Icon.
  3. Link/scope the GPO to your users; log off/on to see the icon. [Elektroda, jprzedworski, post #17098358]

Why doesn’t the desktop shortcut appear after I set the GPO?

Check permissions first. In the thread, the shortcut failed because of file permission issues. After fixing access, the desktop shortcut deployed correctly. Ensure the user can write to the Desktop location and read the target share. [Elektroda, lukaes, post #17099867]

Which Windows versions did you confirm this on?

It worked on a Windows Server 2016 domain with Windows 10 clients. The shortcut deployed from a user‑scoped Shortcuts preference and appeared on the Desktop. [Elektroda, jprzedworski, post #17099740]

I have 20 computers and multiple drives. What’s the fastest approach?

Create one GPO and add a Shortcuts preference per drive you want visible. This avoids manually mapping or placing icons on 20 PCs. The original scenario involved exactly this scale. [Elektroda, lukaes, post #17098007]

When will users see the new Desktop icon?

At next logon or during background refresh. "Group Policy is refreshed in the background every 90 minutes, with a random offset of 0–30 minutes." Tell users to log off/on or wait for refresh. [Group Policy fundamentals - Windows Client]

Can I target only specific users or groups with the desktop shortcut?

Yes. Use Item‑level targeting on the Shortcuts preference item. You can target a security group, OU, computer, IP range, and more from the targeting editor. [Configure item-level targeting - Windows]

My logon script maps drives, but no Desktop icon appears. Why?

Drive‑mapping scripts create letters under This PC, not Desktop icons. Add a separate Desktop shortcut via GPO Shortcuts or a script that writes a .lnk file. The thread confirms mapping alone showed only in "My Computer." [Elektroda, lukaes, post #17098085]

Is it okay to put this setting in the Default Domain Policy?

It works and is fine for quick testing. A participant placed the Shortcuts item in Default Domain Policy and the desktop icon appeared as expected. For production, link a dedicated GPO to the right OU. [Elektroda, jprzedworski, post #17098358]

How can I create the Desktop shortcut without Group Policy?

Use a script to create a .lnk. The WScript.Shell CreateShortcut method can write a shortcut to %Public%\Desktop or the user’s Desktop. Set TargetPath to the mapped drive or UNC, then save the shortcut. [WshShell.CreateShortcut method - Windows]

Can I assign a custom icon to the desktop shortcut?

Yes. In the Shortcuts preference item, set a custom icon file so the network drive shortcut stands out for users. This was suggested and tested in the thread. [Elektroda, jprzedworski, post #17098358]

How do I verify the policy with the desktop shortcut actually applied?

Run gpresult /r as the affected user to see which GPOs applied. Confirm the GPO containing your Shortcuts preference is listed under User Settings. [gpresult - Windows Commands]
Generated by the language model.
ADVERTISEMENT