[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Delete a NET USE to a specified server

Posted on 2013-01-24
4
Medium Priority
?
946 Views
Last Modified: 2013-02-26
When I do a NET USE it returns something like this:

Status       Local     Remote                    Network
-------------------------------------------------------------------------------
OK                     \\10.101.194.32\apps      Microsoft Windows Network
OK                     \\10.101.194.32\customers Microsoft Windows Network
OK                     \\10.101.201.28\C$        Microsoft Windows Network
                       \\TSCLIENT\C              Microsoft Terminal Services
                       \\TSCLIENT\D              Microsoft Terminal Services
                       \\TSCLIENT\F              Microsoft Terminal Services
                       \\TSCLIENT\G              Microsoft Terminal Services

Open in new window


I'm working in an Access database and want grab files from or push files to a file server (the \\10.101.194.32 -- call it PrimeSrvr) in a different domain on the local network. But I will never be sure if the user has already authenticated or connected to the PrimeSrvr on any given day or an particular share.

So I what I want to do is delete all the connections to PrimeSrvr, but leave any others in place, such as the \\TSClient in or the connection the other computer's admins share (the \\10.101.201.28\C$).

I know there is the NET USE * /DELETE, but that would wipe them all out. I just want to wipe out the PrimeSrvr ones only and the re-authenticate so I know I can grab the files I need.

Anyone have suggestions?
0
Comment
Question by:Jim P.
  • 2
4 Comments
 
LVL 14

Assisted Solution

by:Schnell Solutions
Schnell Solutions earned 1000 total points
ID: 38816823
Like you know, net use * /delete eliminates all the connections

In your case, you can eliminate one by one the desired connections, for example:

net use \\10.101.194.32\apps /delete

and so on
0
 
LVL 38

Author Comment

by:Jim P.
ID: 38816842
I'm trying to do this programmatically  from an MS Access DB. I won't know what shares are connected.
0
 
LVL 20

Accepted Solution

by:
agonza07 earned 1000 total points
ID: 38817240
You'll likely have to script it.

Check out this link to give you an idea of how to check for mapped drives to one server. Its not what you are looking for, but it'll lead you in a good direction.

http://stackoverflow.com/questions/12351518/script-to-change-users-manually-mapped-drives-to-a-new-server-with-new-server-na
0
 
LVL 38

Author Closing Comment

by:Jim P.
ID: 38931177
It looks like it should work. But I go pulled of to other tasks.
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

If you’re involved with your company’s wide area network (WAN), you’ve probably heard about SD-WANs. They’re the “boy wonder” of networking, ostensibly allowing companies to replace expensive MPLS lines with low-cost Internet access. But, are they …
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

872 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