Solved

Multiple network share removal.  Globally?

Posted on 2007-03-23
4
247 Views
Last Modified: 2013-12-04
I was just going through some stats on our WAN today and noticed that a bunch of people at one of our remote sites have created network shares which is not something we allow.  Is there a way I can remove those shares at once?  I don't want to go though 100+ PC's and remove the shares one by one.  

Then I'll have to put something in place to restrict end-users from creating them but still allow Admins to create shares where/when needed.

Windows 2003 DC's and WinXP SP2 Workstations.

Any ideas?  Thanks guys.
0
Comment
Question by:wfssupport
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 30

Accepted Solution

by:
LauraEHunterMVP earned 125 total points
ID: 18783092
If you can execute scripts remotely against these machines, just run the following script against each machine, replacing <COMPUTERNAME> with a DNS/NetBIOS name or IP address as needed:

strComputer = "<COMPUTERNAME>"
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colShares = objWMIService.ExecQuery _
    ("Select * from Win32_Share")

For Each objShare in colShares
    objShare.Delete
Next

0
 
LVL 55

Expert Comment

by:McKnife
ID: 18787920
"End users" already are limited, when it comes to shareing, as long as they are members of the users group. Power users can create shares, users can't.
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Keystroke loggers have been around for a very long time. While the threat is old, some of the remedies are new!
Article by: Justin
In light of the WannaCry ransomware attack that affected millions of Windows machines, you might wonder if your Mac needs protecting. Yes, it does and here is how to do it.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

695 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