?
Solved

Multiple network share removal.  Globally?

Posted on 2007-03-23
4
Medium Priority
?
251 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 375 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 56

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

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

There is a lot to be said for protecting yourself and your accounts with 2 factor authentication.  I found to my own chagrin, that there is a big downside as well.
Hey fellow admins! This time, I have a little fairy tale for you. As many tales do, it starts boring and then gets pretty gory. I hope you like it. TL;DR: It is about an important security matter, you should read it if you run or administer Windows …
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…
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…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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