Solved

Enforce share permissions on a shared computer

Posted on 2016-07-30
5
25 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

My experience with Windows 10 over a one year period and suggestions for smooth operation
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
This video teaches viewers how to encrypt an external drive that requires a password to read and edit the drive. All tasks are done in Disk Utility. Plug in the external drive you wish to encrypt: Make sure all previous data on the drive has been …

707 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

14 Experts available now in Live!

Get 1:1 Help Now