Solved

Multiple network share removal.  Globally?

Posted on 2007-03-23
4
235 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
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 53

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Big data transfers via information superhighways require special attention and protection. Learn more about the IT-regulations of the country where your server is located. Analyze cloud providers and their encryption systems for safe data transit. S…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

758 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

17 Experts available now in Live!

Get 1:1 Help Now