[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Script to Delete a Hidden Admin Share

Posted on 2013-01-29
2
Medium Priority
?
567 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
[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
2 Comments
 
LVL 41

Accepted Solution

by:
footech earned 800 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

650 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