?
Solved

Script to Delete a Hidden Admin Share

Posted on 2013-01-29
2
Medium Priority
?
563 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 40

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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

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 recent project that involved parsing Tableau Desktop and Server log files to extract reusable user queries for use in other systems. I chose to use PowerShell to gather the data, and SharePoint to present it...
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…
Suggested Courses

762 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