/build/static/layout/Breadcrumb_cap_w.png

Scripting Question


Powershell script issues

05/15/2017 1770 views
Trying to execute a powershell script via K1000.  Trying to run a script (built by someone else) that disables SMBv1 (because of recent issues in the wild).

Works perfectly fine on Windows 7 machines (because it is a simple registry change) but on windows 8+ it will not work.  I've tried various fixes already listed in these forums and such to no avail.  Our kbox version is 6.4.x as is the agent.

The current kscript is set to run a batch file with the following:
powershell.exe powershell.exe -nonInteractive -ExecutionPolicy Bypass -File disablesmbv1.ps1 -verb RunAs

I've tried with only one specified powershell.exe and without the -verb RunAs.  I've also run this as local system or as an admin account. I've also run this via "launch program" calling powershell and arguments being the -noninteractive... All come to the same results.

Disablesmbv1.ps1 script can be read and obtained here: https://github.com/TechWhispererCA/disable-smb1-powershell/blob/master/DisableSMB1.ps1

The script works file locally run on machine but when attempting to run via kbox (online kscript) it spits out the following error: The term 'Get-SmbServerConfiguration' is not recognized as the name of a cmdlet, function, script file...
Answer Summary:
2 Comments   [ + ] Show comments

Comments

  • I am having a similar issue with a script I wrote to remove SMB1, I think it has something to do with permissions or elevation. what OS are you getting the Get-SmbServerConfiguration error?
  • Getting it consistently on Windows 10

Answer Chosen by the Author

0
Probably cause by a 32 bit process trying to call a 64 bit one, use this for your 64 bit machines 
:D
%SystemRoot%\sysnative\WindowsPowerShell\v1.0\powershell.exe
Answered 05/15/2017 by: HISDTechGuy
Senior Yellow Belt

  • BOOM! That was it... Thanks a million!

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ