I am trying to run powershell script from my server machine on all machines in network. Firstly I am trying it with only 1 machine.
But, I am getting following error:
File C:\file.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:27
+ C:\file.ps1 <<<<
+ CategoryInfo : NotSpecified: (:) [], PSSecurityException
+ FullyQualifiedErrorId : RuntimeException
I am using following command:
D:\Task\PSTools>PsExec.exe remotemachine -u domain\adminuname -p adminpwd cmd.exe \c start
PsExec v2.1 - Execute processes remotely
Copyright (C) 2001-2013 Mark Russinovich
Sysinternals - www.sysinternals.com
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Windows\system32>powershell.exe "C:\file.ps1"
So can you please help me in this.
Thanks in advance.