I have a script that has this code:
$secpasswd = ConvertTo-SecureString "Ukn545454" -AsPlainText -Force
$mycreds = New-Object System.Management.Automation.PSCredential ("$env:USERDOMAIN\user1", $secpasswd)
invoke-command -ComputerName "MyW10comp" -ScriptBlock {Start-proccess -FilePath PowerShell.exe -Credential $using:mycreds}
I have 8 computers, (one of them is also w10 but 32-bit) and on everyone of them the script runs well, but on of them Windows 10 64-bit it says:
This command cannot be run due to the error: Access is denied.
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
+ PSComputerName : MyW10Comp
If I am runnnig the script locally, everything goes well! What can I check on the computer to see what is the problem?
Thank you