Solved

Script to Delete a Hidden Admin Share

Posted on 2013-01-29
2
537 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

The article will show you how you can maintain a simple logfile of all Startup and Shutdown events on Windows servers and desktops with PowerShell. The script can be easily adapted into doing more like gracefully silencing/updating your monitoring s…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
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…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

929 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

14 Experts available now in Live!

Get 1:1 Help Now