Windows 10: How to Delete all SMBshares using Powershell?

  1.    26 Jun 2017 #1

    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

    Have you tried re-enabling SMB and removing the shares with SMB enabled, then disabling SMB?
      My ComputerSystem Spec

  3.    26 Jun 2017 #3

    NavyLCDR said: 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

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


 

Related Threads
cmd vs powershell in General Support
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...
Solved I can't run Windows PowerShell in General Support
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...
Solved PowerShell in Performance & Maintenance
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...
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 15:15.
Find Us