Check and Disable SMB1 Protocol

Procedures to check and disable SMB1

Description

This listing contains two agent procedures:
-Check SMB1 Status
-Disable SMB1 Protocol
The first one requires to create a custom field named "SMB1 Status" prior to scheduling the procedure. It will then check the SMb1 status and update the custom field with "Enabled" or "Disabled"
The second procedure will disable the SMB1 protocol on the endpoint. It will only take effect after the endpoint has been restarted. The restart is not included in the procedure to give the liberty of scheduling it at the best time.
Make sure you are not actively using the SMB1 protocol prior to running the procedure.
Disclaimer: This procedure is not intended to be used on Windows XP. The Workstation service will not be able to start once one of the registry keys get changed.

Developer
  • Name: Douglas Sanchez
  • Company: Kaseya
  • Website: http://www.kaseya.com
  • Contact Developer
  • Summary
  • Check and Disable SMB1 Protocol
  • 270 Downloads
  • Released on June 27th, 2017
  • Reviews
    Gravatar for Josh Youngberg
    by Josh Youngberg on April 18th, 2019

    I ran the "Check SMB1" procedure on a machine which had SMB1 disabled. The procedure correctly entered "Disabled" into the custom field called "SMB1 Status".I then manually enabled SMB1 via "Windows Features" on the same machine. I re-ran the "Check SMB1" procedure but the custom field still said "Disabled". This still needs some work. I am also having issues importing the "Disable SMB1 Protocol" procedure. Import Center indicates that the xml was successfully imported but I can't find the procedure in the "Import Center" folder of Agent Procedures.

    Gravatar for Nick
    by Nick on June 30th, 2017

    Works great, thanks

    Gravatar for Nick
    by Nick on June 28th, 2017

    nice and simple script. appreciate the effort of the Kaseya team to put things like this together

    Discussion
    Gravatar for CustomTec
    CustomTec about 2 years ago

    Hi I ran the SMB check procedure and got an errors saying "Get variable, with error File Open failed, get content from file c:\agentdirectory\SMBStatus.txt. I'll look into fixing this in our download

    Gravatar for Gene Berkinsky
    Gene Berkinsky about 2 years ago

    The script fails on the line:
    getVariable("File Content", "#vAgentConfiguration.agentTempDir#\SMBStatus.txt", "smbstatus", "All Operating Systems", "Halt on Fail")

    Is there a fix for this?

    Gravatar for Gene Berkinsky
    Gene Berkinsky about 2 years ago

    The script fails on the line:
    getVariable("File Content", "#vAgentConfiguration.agentTempDir#\SMBStatus.txt", "smbstatus", "All Operating Systems", "Halt on Fail")

    Is there a fix for this?

    Gravatar for Gene Berkinsky
    Gene Berkinsky about 2 years ago

    The script fails on the line:
    getVariable("File Content", "#vAgentConfiguration.agentTempDir#\SMBStatus.txt", "smbstatus", "All Operating Systems", "Halt on Fail")

    Is there a fix for this?

    Gravatar for Douglas Sanchez
    Douglas Sanchez about 2 years ago

    I was troubleshooting this issue and found out it is due to the Registry Key related to SMB1 missing on the system. By default, if the Key is missing, SMB1 is enabled as it considers its value to be 1.
    I will edit the procedure to return "Enabled" when the registry key is missing.

    Gravatar for Douglas Sanchez
    Douglas Sanchez about 2 years ago

    I just updated the procedure with some additional logic to specify SMB1 is enabled in case the registry key is missing.

    Gravatar for Corey Crossman
    Corey Crossman about 2 years ago

    Work great, success on all my systems! Thanks Douglas!

    Gravatar for Corey Crossman
    Corey Crossman about 2 years ago

    Worked great, success on all my systems! Thanks Douglas!

    Gravatar for Gene Berkinsky
    Gene Berkinsky about 2 years ago

    Thank you for the update. I tried again and it only works with Windows 10, and Server 2012/2016.

    Gravatar for Jason Paradis
    Jason Paradis about 2 years ago

    The check script errors out on Windows 7 64 bit with the error "Failed THEN in step 9 (Line 15).

    Gravatar for MICHAEL CARBONARO
    MICHAEL CARBONARO about 2 years ago

    where do you create the custom field required?

    Gravatar for Douglas Sanchez
    Douglas Sanchez about 2 years ago

    Michael, you can create the Custom Field in the Audit module under Machine Summary.

    Gravatar for Douglas Sanchez
    Douglas Sanchez about 2 years ago

    Michael, you can create the Custom Field in the Audit module under Machine Summary.

    Gravatar for Tom Johsnon
    Tom Johsnon over 1 year ago

    i can not get the status added to a report

    Gravatar for Tom Johsnon
    Tom Johsnon over 1 year ago

    i can not get the status added to a report

    Gravatar for Douglas Sanchez
    Douglas Sanchez over 1 year ago

    @Tom, you need to create a new report part from the Audit Module using the Machine Summary part. In there you can display any column you want, and slide the Custom Field you need to the Columns you wanted to display. On older version of the VSA, the custom fields' names are not edited and will show Custom Field 00, 01, 02 ... In this case I recommend creating a report part with all Custom Fields so that you know which one correspond to the one you need.