\n(post deleted by author)<\/p>\n<\/blockquote>\n<\/aside>\n
This is exactly how we do it. I use Access Based Enumeration to assign mappings based on user rights. We’re a legal firm and those without rights to certain areas don’t get that access automatically mapped (and are locked out with access rights from those areas as well). Works a treat for us.<\/p>","upvoteCount":1,"datePublished":"2025-07-09T12:27:26.983Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/7","author":{"@type":"Person","name":"Adam345","url":"https://community.spiceworks.com/u/Adam345"}},{"@type":"Answer","text":"
as said i dont see pref under local group policy so i cant do this<\/p>","upvoteCount":1,"datePublished":"2025-07-09T12:33:45.864Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/8","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"}},{"@type":"Answer","text":"
Any reason you can’t use the AD logon options?<\/p>","upvoteCount":1,"datePublished":"2025-07-09T12:37:12.064Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/9","author":{"@type":"Person","name":"Rod-IT","url":"https://community.spiceworks.com/u/Rod-IT"}},{"@type":"Answer","text":"
Are you trying to do this on the local machine? The screen shot is from a Domain Controller running Active Directory and group policy services.<\/p>\n
Do you have an AD server in your environment?<\/p>","upvoteCount":3,"datePublished":"2025-07-09T12:37:21.263Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/10","author":{"@type":"Person","name":"bcrooms","url":"https://community.spiceworks.com/u/bcrooms"}},{"@type":"Answer","text":"
yes but i only want it on this pc only and the share is not domain joined so i have to specify a username and password<\/p>","upvoteCount":1,"datePublished":"2025-07-09T12:57:28.846Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/11","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"}},{"@type":"Answer","text":"
With these restraints then, I would make a TASK pointing to the mapping script, that runs at login, to map the drive. \nthe dir/file being hidden and read only, but that’s me.<\/p>","upvoteCount":2,"datePublished":"2025-07-09T13:08:37.536Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/12","author":{"@type":"Person","name":"TimJjr","url":"https://community.spiceworks.com/u/TimJjr"}},{"@type":"Answer","text":"
You wasn’t clear on this in your first post.<\/p>\n
But just because the share isn’t in the domain, doesn’t mean you can’t use the login script if the user accessing the share IS in the domain.<\/p>\n
You can add the .bat file to the desktop of all users and allow them to double click it when they need the share, or alternatively, if multiple users will use this device and all need the share, add the PC/Laptop to the permissions, not users.<\/p>","upvoteCount":1,"datePublished":"2025-07-09T13:09:03.782Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/13","author":{"@type":"Person","name":"Rod-IT","url":"https://community.spiceworks.com/u/Rod-IT"}},{"@type":"Answer","text":"
thanks guys, i want to use the findstr for a command like<\/p>\n
whoami /groups | findstr /L \"groupname\"\n<\/code><\/pre>\nbut even if i type in group it comes back with the result, i dont want it to come back with the result only when you type in the EXACT match<\/p>","upvoteCount":1,"datePublished":"2025-07-09T13:25:22.221Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/14","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"}},{"@type":"Answer","text":"
how is this related to your mapped drive query?<\/p>","upvoteCount":1,"datePublished":"2025-07-09T13:47:04.600Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/15","author":{"@type":"Person","name":"Rod-IT","url":"https://community.spiceworks.com/u/Rod-IT"}},{"@type":"Answer","text":"
it is as i want to lock it down to only a group<\/p>\n
@echo off\n\nwhoami /groups | findstr /i /L groupname\n\nif %errorlevel% equ 0 net use T: \\\\ipaddress\\sharename /u:user pass /p:yes\n<\/code><\/pre>","upvoteCount":1,"datePublished":"2025-07-09T13:52:38.197Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/16","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"}},{"@type":"Answer","text":"So you want to map a drive, ONLY if the user is in a group, is the group in AD? Is the device and/or users connecting also in the domain?<\/p>\n
If so, you seem to be complicating this.<\/p>\n
From what you’ve shared, it’s only the share itself that isn’t in the domain.<\/p>\n
If you provided this information at the start it would make helping you easier.<\/p>","upvoteCount":1,"datePublished":"2025-07-09T14:03:28.735Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/17","author":{"@type":"Person","name":"Rod-IT","url":"https://community.spiceworks.com/u/Rod-IT"}},{"@type":"Answer","text":"
yes the users are in AD, i made a group including all the users and all the users conencting to this server are on the domain<\/p>","upvoteCount":1,"datePublished":"2025-07-09T14:29:42.491Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/18","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"}},{"@type":"Answer","text":"
Then you can still run this via the AD console under profile>logon script<\/code>, the script just needs to be accessible by the users.<\/p>\nYou wouldn’t need to check for a group this way as you’d specifically add the script to those users you want to access the share.<\/p>\n
As noted earlier, if it’s a specific machine and not strictly users, you can add the device to the permissions on the share, so the device has access. So anyone on this device can use it.<\/p>","upvoteCount":1,"datePublished":"2025-07-09T14:43:06.702Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/19","author":{"@type":"Person","name":"Rod-IT","url":"https://community.spiceworks.com/u/Rod-IT"}},{"@type":"Answer","text":"
Can you help verify a couple of things because I’ve read through your posts a couple of times and I’m getting confused.<\/p>\n
\nThe workstation you want to map the drive on, is NOT domain connected.<\/li>\n The share you are mapping is also on a computer NOT domain connected.<\/li>\n The users and user group you want to secure the share with IS on the domain.<\/li>\n<\/ol>\nIs that correct?<\/p>","upvoteCount":1,"datePublished":"2025-07-09T15:05:06.012Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/20","author":{"@type":"Person","name":"HanSlo-mo","url":"https://community.spiceworks.com/u/HanSlo-mo"}},{"@type":"Answer","text":"
problem solved<\/p>\n
whoami /groups | findstr /i \"\\<exactgroupnamehere\\>\"\n<\/code><\/pre>","upvoteCount":2,"datePublished":"2025-07-09T15:16:33.960Z","url":"https://community.spiceworks.com/t/adding-mapped-drivers-to-users/1222360/21","author":{"@type":"Person","name":"robertkwild","url":"https://community.spiceworks.com/u/robertkwild"}}]}}
hi all,
want to create a script to map a drive on logon, ive done the below and it works
net use T: \\networkShare\Test /u:username password /p:yes
but how do i add if a member of this AD group add it
ive tried to do this via local gpedit of the local computer but everywhere it says you go to
users > pref > widnows settings > mapped drives
but i dont see the “preferences”
thanks,
rob
6 Spice ups
Rod-IT
(Rod-IT)
July 9, 2025, 11:58am
2
If it’s specific users, you can save it as a bat file and add it as their login script in AD.
4 Spice ups
That is correct. Try to make it as a bat file stored in the PC locally in documents, and then you can make a script from GPEDIT at the startup.
It will run at the startup of the PC.
2 Spice ups
bcrooms
(bcrooms)
July 9, 2025, 12:22pm
4
You don’t really have to use a script for this; it can be handled 100% with group policy.
It’s under User Config > Preferences > Windows Settings > Drive Maps
15 Spice ups
TimJjr
(TimJr)
July 9, 2025, 12:26pm
6
And a 3rd way to do this, via AD: assuming you have the security permissions on the shared folder, the users Profile tab allows for this also
4 Spice ups
Adam345
(Adam345)
July 9, 2025, 12:27pm
7
Adam345:
(post deleted by author)
This is exactly how we do it. I use Access Based Enumeration to assign mappings based on user rights. We’re a legal firm and those without rights to certain areas don’t get that access automatically mapped (and are locked out with access rights from those areas as well). Works a treat for us.
1 Spice up
as said i dont see pref under local group policy so i cant do this
1 Spice up
Rod-IT
(Rod-IT)
July 9, 2025, 12:37pm
9
Any reason you can’t use the AD logon options?
1 Spice up
bcrooms
(bcrooms)
July 9, 2025, 12:37pm
10
Are you trying to do this on the local machine? The screen shot is from a Domain Controller running Active Directory and group policy services.
Do you have an AD server in your environment?
3 Spice ups
yes but i only want it on this pc only and the share is not domain joined so i have to specify a username and password
1 Spice up
TimJjr
(TimJr)
July 9, 2025, 1:08pm
12
With these restraints then, I would make a TASK pointing to the mapping script, that runs at login, to map the drive.
the dir/file being hidden and read only, but that’s me.
2 Spice ups
Rod-IT
(Rod-IT)
July 9, 2025, 1:09pm
13
You wasn’t clear on this in your first post.
But just because the share isn’t in the domain, doesn’t mean you can’t use the login script if the user accessing the share IS in the domain.
You can add the .bat file to the desktop of all users and allow them to double click it when they need the share, or alternatively, if multiple users will use this device and all need the share, add the PC/Laptop to the permissions, not users.
1 Spice up
thanks guys, i want to use the findstr for a command like
whoami /groups | findstr /L "groupname"
but even if i type in group it comes back with the result, i dont want it to come back with the result only when you type in the EXACT match
1 Spice up
Rod-IT
(Rod-IT)
July 9, 2025, 1:47pm
15
how is this related to your mapped drive query?
1 Spice up
it is as i want to lock it down to only a group
@echo off
whoami /groups | findstr /i /L groupname
if %errorlevel% equ 0 net use T: \\ipaddress\sharename /u:user pass /p:yes
1 Spice up
Rod-IT
(Rod-IT)
July 9, 2025, 2:03pm
17
So you want to map a drive, ONLY if the user is in a group, is the group in AD? Is the device and/or users connecting also in the domain?
If so, you seem to be complicating this.
From what you’ve shared, it’s only the share itself that isn’t in the domain.
If you provided this information at the start it would make helping you easier.
1 Spice up
yes the users are in AD, i made a group including all the users and all the users conencting to this server are on the domain
1 Spice up
Rod-IT
(Rod-IT)
July 9, 2025, 2:43pm
19
Then you can still run this via the AD console under profile>logon script
, the script just needs to be accessible by the users.
You wouldn’t need to check for a group this way as you’d specifically add the script to those users you want to access the share.
As noted earlier, if it’s a specific machine and not strictly users, you can add the device to the permissions on the share, so the device has access. So anyone on this device can use it.
1 Spice up
HanSlo-mo
(HanSlo-mo)
July 9, 2025, 3:05pm
20
Can you help verify a couple of things because I’ve read through your posts a couple of times and I’m getting confused.
The workstation you want to map the drive on, is NOT domain connected.
The share you are mapping is also on a computer NOT domain connected.
The users and user group you want to secure the share with IS on the domain.
Is that correct?
1 Spice up
problem solved
whoami /groups | findstr /i "\<exactgroupnamehere\>"
2 Spice ups