1.    26 Jun 2017 #1
    Join Date : Oct 2016
    Posts : 27
    Windows

    How to Delete all SMBshares using Powershell?


    I've disabled SMB in "Turn Windows Features On or Off".

    How can I remove the SMBShares that return the following error when I enter remove-smbshare <Sharename>?

    Sample Error:
    remove-smbshare : The request is not supported.At line:1 char:1+ remove-smbshare <Sharename>$+ ~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (MSFT_SmbShare (...copeName = "*"):ROOT/Microsoft/Windows/SMB/MSFT_SMB Share) [Remove-SmbShare], CimException + FullyQualifiedErrorId : Windows System Error 50,Remove-SmbShare

    I'm already running Powershell as Administrator.
      My ComputerSystem Spec
  2.    26 Jun 2017 #2
    Join Date : Jul 2015
    Posts : 9,381
    Windows 10 Pro

    Have you tried re-enabling SMB and removing the shares with SMB enabled, then disabling SMB?
      My ComputerSystem Spec
  3.    26 Jun 2017 #3
    Join Date : Oct 2016
    Posts : 27
    Windows
    Thread Starter

    Quote Originally Posted by NavyLCDR View Post
    Have you tried re-enabling SMB and removing the shares with SMB enabled, then disabling SMB?
    Yes. The problem was originally encountered with SMB enabled.
      My ComputerSystem Spec
  4.    26 Jun 2017 #4
    Join Date : Oct 2016
    Charlotte, NC
    Posts : 441
    Win10 Home x64 - 1709

    Assuming your on the machine where the share was created, have you tried ...
    Remove-SmbShare -Name "YOUR-SHARE-NAME"
      My ComputersSystem Spec

 


Similar Threads
Thread Forum
cmd vs powershell
Greetings. As a normal PC-geek I don't know how, when and why I should use Powershell instead of cmd. Or in another way, why has Microsoft changed cmd to Powershell in the right-click menu? What are the benefits? Or has Microsoft just done this...
General Support
Solved I can't run Windows PowerShell
Hey guys, can you help me? I can't run WIndows Powershell (even as admin or not), it say "C:\Users\ASUS K84L\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell.lnk", 131816i try to run via directory and...
General Support
Solved PowerShell
I have a 64-bit laptop running Win 10 Home. I just notice in All apps, there is an entry of PowerShell and PowerShell (x86). I realize the former is for 64-bit and the latter is for 32-bit. Question : In my 64-bit laptop, when I open...
Performance & Maintenance
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 16:17.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums