Im trying to run a powershell script to turn off/on a service on the remote computer. I run Veeam VBR as a local service instead of an AD service account. Is this why my script is failing?
Ive tried both of these and using SNMP as an example. Of course they both work interactively from the VBRserver
Get-Service -computername RemoteComputer -DisplayName "SNMP Service"| Stop-Service
invoke-command -ComputerName RemoteComputer -ScriptBlock {Get-Service -Name "SNMP"| Stop-Service}
**********************
Windows PowerShell transcript start
Start time: 20250807125230
Username: WCG\SYSTEM
RunAs User: WCG\SYSTEM
Configuration Name:
Machine: VBRserver (Microsoft Windows NT 10.0.17763.0)
Host Application: powershell.exe -ExecutionPolicy ByPass -Command try {& 'C:\VeeamScripts\freeze-tk.ps1' -ErrorAction Stop } catch { exit 1 }
Process ID: 24996
PSVersion: 5.1.17763.7553
PSEdition: Desktop
PSCompatibleVersions: 1.0, 2.0, 3.0, 4.0, 5.0, 5.1.17763.7553
BuildVersion: 10.0.17763.7553
CLRVersion: 4.0.30319.42000
WSManStackVersion: 3.0
PSRemotingProtocolVersion: 2.3
SerializationVersion: 1.1.0.1
**********************
Transcript started, output file is .\RemoteComputer.log.txt
+ CategoryInfo : OpenError: (RemoteComputer:String) p], PSRemotingTransportException
+ FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken
tRemoteComputer] Connecting to remote server RemoteComputer failed with the following error message : Access is denied. For more
information, see the about_Remote_Troubleshooting Help topic.
+ CategoryInfo : OpenError: (RemoteComputer:String) R], PSRemotingTransportException
+ FullyQualifiedErrorId : AccessDenied,PSSessionStateBroken
**********************
Windows PowerShell transcript end
End time: 20250807125230
**********************