Deleting Shares

If you'd like to get rid of a file share, such as the one you created via WMI in our last tip, this is how you can do it:

(Get-WMIObject Win32_Share -filter "Name='$sharename'").Delete()

As with share creation, you need admin rights to delete a share.


Posted May 12 2009, 08:00 AM by ps1
Concentrated Tech NSoftware Dell Compellent Sponsored by Idera and Concentrated Tech and NSoftware and Dell Compellent
Copyright 2011 PowerShell.com. All rights reserved.