How To Map Network Drives Using Logon Script GPO in Windows Server 2019

preview_player
Показать описание
Windows Server 2019 Basic Video Tutorials By MSFTWebcast:

In this step by step video guide, I will show you how to map network drives using bat file login script with the help of Group Policy in Windows Server 2019 Active Directory Domain.

Command to create a .bat file to map a network share as map drive.

net use m: \\ws2k19-dc01\share1

(Where drive letter "M" is assign to map drive, ws2k19-dc01 is the name of the server and share1 is the name of the share folder)

Click here to see all the Windows Server 2019 Video Tutorials:
Рекомендации по теме
Комментарии
Автор

As you say GPO is a better way. However, for those that still want to use a logon script to map drives, may I suggest the following:

net use M: >nul 2>&1
if %errorlevel% equ 0 net use M: /d
net use M: "\\WS2K19-DC01\HRSharedData" /persistent:yes >nul

This will check if the drive letter is already in use and if so remove it. It will then remap the shared location as normal.

NOTE: I have enclosed the share location/path in " even though it is not needed in this example but it is best practice in case your share path has any spaces.

Simulacra
Автор

Thank you so much, this was really helpful.

ayatarek
Автор

super easy. in my case many users have access to multiple shared drives and folders. with my work environment some want access to specific folders. i am thinking on working on a script to prompt options of which folder one would like to map within a shared drive. not sure if its possible. thank you. great video explanation.

infotechyeti
Автор

Thx for your video, but it doesn't works with Windows Server 2012 and windows 10 end user ?, any idea with this issue ?

mikehs
Автор

Would this gpo work with different credentials than the ones I use to log in?

edwarsind
Автор

I wonder if there is any way to force the user to update their data, such as email and phone in AD, when they log in to Windows

MarcosViniciusGomes
Автор

Hey do you know the login scipit where everyone in the domain gets there own data space on a storage pc

javoristhomas
Автор

my bat files can't open... any idea about this issue?

stenzstenz
Автор

Hi, Can you help me, How to map smb share drive via computer base gpo

biswaprakashdas
Автор

Scripts are not working for me no matter what I do, I followed several tutorials as well using the SYSVOL/sysvol/script forlder but they still do not run... Any suggestion what may the problem here?

kodemasterx
Автор

How can you use the GPO to apply individual shared folders to individual user accounts? Like "Roaming" Profile but I just want to attach a specific shared folder for that user account. is that possible?

leadtech
Автор

how about if we run \\sourceIPAddress\c$ from the client side? where shall i run that command? can i just create a .bat file with that command inside on the client side? then run it

ainsalleh
Автор

The domain server I am working on does not have the MUMBAI folder (or anything remotely similar). So I am stuck at the 5:35 timeline. Active Directory Users and Computers does not have any folders like your MUMBAI folder. Neither does my GPO. The GPO does not have any USERS either so I can't link the Mapped Drive GPO. Was the MUMBAI folder created my you and how do I create a folder like this so I can link the GPO to my users? Thank you.

keithspurlock
Автор

In my case after login script is asking for credentials as end user is not be able to access DC NetLogon folder without credentials. So how to resolve this issue ? So that end user domain login can access Netlogon can access without asking credentials and can run the required script

jigneshkhambhati
Автор

I notice that every GPO created, you have to execute (gpupdate /force) command. What is the alternative if you have 1000 client PCs

alialnajjar
Автор

This does not work when the Domain User is a local admin with Windows 10. Can you explain how to accomplish this same thing when the user is a member of the local administrators group?

bradknit
Автор

Hai How to do map network drive which the sharing folder located in another windows computer?

JCHSTUDIO
Автор

Bro it showing error in client computer


Computer policy could not be updated successfully. The following errors were enc
ountered:

The processing of Group Policy failed. Windows could not apply the registry-base
d policy settings for the Group Policy object LocalGPO. Group Policy settings wi
ll not be resolved until this event is resolved. View the event details for more
information on the file name and path that caused the failure.
User Policy update has completed successfully.

To diagnose the failure, review the event log or run GPRESULT /H GPReport.html f
rom the command line to access information about Group Policy results.

muruligowda
Автор

How to create script without specifying the drive label name instead the script picks the free drive label available on client machine

maheshZmarty
Автор

Why mapping via CMD, why Not Preferences?

ittechnik