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 7 years ago
-
Getting it consistently on Windows 10 - cmattcline 7 years ago
Answers (1)
Answer Summary:
Please log in to answer
Posted by:
HISDTechGuy
7 years ago
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 7 years ago