Solved

Enforce share permissions on a shared computer

Posted on 2016-07-30
5
26 Views
Last Modified: 2016-08-22
Scenario:

- One Windows 10 Workstation having a single user name and password. Not on a domain. One profile, meaning 4 employees log into this computer using the same user name and password.

- One Synology NAS set up (for now) only as a file server. On the server we set up 4 user accounts. Each employee has his own login and password for the NAS. And user permissions on the NAS dictate who sees what (on the NAS).

The Problem:

The FIRST windows user that tries to connect to the NAS, will be prompted for his login. He enters his login and password, does NOT check the box 'remember my login info' and clicks OK.

As long as this Windows computer is running (no one has restarted or logged out), Windows will remember the login info for that connection to the NAS.

I want to provide an option that allows the user to DISCONNECT from the NAS folder:
- without deleting the mapped drive
- without making them log out of windows

Is there a script I can write, or a command I can run, that will
- disconnect from the NAS
- allow the next person to walk up to that same shared computer
- when he double-clicks on the mapped drive to the NAS, he is prompted for HIS login and password

So to recap - while the 4 users can log into and share one windows 10 computer, and they all use the same user name and password, it's the NAS I want to control access to, through separate logins. So, one password for the windows computer, but 4 passwords for the NAS. Windows is remembering the user name entered by the previous user. The only way around it is to log out of windows. I am looking for a way to get windows to 'forget' the active session's connection to the nas without having to log out and log back into windows.
0
Comment
Question by:Eric C
  • 3
  • 2
5 Comments
 
LVL 23

Accepted Solution

by:
NVIT earned 500 total points (awarded by participants)
ID: 41736157
The following does "...get windows to 'forget' the active session's connection to the nas without having to log out and log back in". Contrary to what you want, it does delete the mapped drive to the NAS. Each time a user connects via Explorer or NET USE, the map is saved. There's no way around that:

1. Logon the admin and connect to the NAS share.

2. Open a CMD prompt

3. Note: You said the user does NOT pick the 'Remember my credentials' box. But, in case he does, this next required step removes the credential.

Find out the cmdkey target=NASservername line you need to put in your .bat file:
cmdkey /list

Open in new window


Note the server you need to disconnect from. It's the line that looks like: Target: Domain:target=NASservername

4. The next step removes the mapped drive.

Find out the NET USE Remote servername you need to put in your .bat file. It should be similar to the  NASservername in the prior step but looks like \\NASservername\sharename:
net use

Open in new window


5. Make a .bat file containing this:
cmdkey /del:Domain:target=NASservername
net use \\NASservername\sharename /del

Open in new window


6. Save the .bat in a protected folder to prevent deletion by users.

7. On user's Desktop or Start menu, make a shortcut to the .bat file.

8. When user is done working, he picks the shortcut to run the .bat to disconnect from the share.""
0
 
LVL 5

Author Comment

by:Eric C
ID: 41738150
NVIT, that looks promising and I will try that and report back.  Is there another batch file I can create, that will re-map the shared folder?

In other words:
1. User double-clicks on the icon
2. Windows prompts user for login (if they're not already authenticated)
3. shared folder is mapped to drive 'M'
0
 
LVL 23

Expert Comment

by:NVIT
ID: 41738306
Please close the original question and award points first.
0
 
LVL 5

Author Comment

by:Eric C
ID: 41738358
Agreed, that is fair. Let me try this and get back to you.
0
 
LVL 23

Expert Comment

by:NVIT
ID: 41763495
Working solution by NVIT has not been followed up on by asker.
0

Featured Post

Superior storage. Superior surveillance.

WD Purple drives are built for 24/7, always-on, high-definition security systems. With support for up to 8 hard drives and 32 cameras, WD Purple drives are optimized for surveillance.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

948 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now