Solved

Script to Delete a Hidden Admin Share

Posted on 2013-01-29
2
536 Views
Last Modified: 2013-02-03
I am just trying to get a script to delete print$

This has come up as a security vulnerability for us and I want to put a script into a GPO to delete it each time a user logs on. Unless someone has a better way to do this.
0
Comment
Question by:rbmimi
2 Comments
 
LVL 39

Accepted Solution

by:
footech earned 200 total points
ID: 38837021
The following should do what you want.  You can save it as a .ps1 file.
Get-WmiObject Win32_Share -filter "Name = 'print$'" | Remove-WmiObject

Open in new window

0
 

Author Closing Comment

by:rbmimi
ID: 38849165
Thanks, that script works perfectly.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Are you one of those front-line IT Service Desk staff fielding calls, replying to emails, all-the-while working to resolve end-user technological nightmares? I am! That's why I have put together this brief overview of tools and techniques I use in o…
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

747 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

13 Experts available now in Live!

Get 1:1 Help Now