/build/static/layout/Breadcrumb_cap_w.png

Powershell script issues

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...

2 Comments   [ + ] Show 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? - HISDTechGuy 6 years ago
  • Getting it consistently on Windows 10 - cmattcline 6 years ago

Answers (1)

Answer Summary:
Posted by: HISDTechGuy 6 years ago
Senior Yellow Belt
0

Top Answer

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

Comments:
  • BOOM! That was it... Thanks a million! - cmattcline 6 years ago
 
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