Solved

Multiple network share removal.  Globally?

Posted on 2007-03-23
4
244 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 54

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
FSRREMOS 7 60
NTP time source for DC 3 53
Behavior-based and anomalies detection for Symantec 2 23
Mac OS upgrade: Does it expunge malware? 4 25
This article describes my battle tested process for setting up delegation. I use this process anywhere that I need to setup delegation. In the article I will show how it applies to Active Directory
There's a lot of hype surrounding blockchain technology. Here's how it works and some of the novel ways it' s now being used - including for data protection.
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

726 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