1

Good Day,

i look for a same command as

sc config BITS type= own in Powershell. I think ist with set-service -name BITS -computername server1234 -idon´t know

I have the problem that my INVOKE-COMMAND don´t work. But all scripts work only this line don´t work.

Invoke-Command -ComputerName $serverneedhelp -ScriptBlock {Start-Process cmd -ArgumentList "/c 'sc config bits type= own'"}

If anybody can help me, it is were so great. Thankyou

Greeting Jan

Jan Kraemer
  • 21
  • 1
  • 5

3 Answers3

0

in my script work it with

Invoke-Command -ComputerName $serverneedhelp -ScriptBlock {Start-Process cmd  -ArgumentList "/c sc config bits type= own"}

But I search a version of Powershell without cmd

SecretAgentMan
  • 2,856
  • 7
  • 21
  • 41
Jan Kraemer
  • 21
  • 1
  • 5
0

Run it directly?

Invoke-Command $serverneedhelp { sc config bits type= own }

The other alternative is with wmi: Configure service with Set-Service

js2010
  • 23,033
  • 6
  • 64
  • 66
0

I know that this is old thread, but maybe someone would benefit from this. What worked for me is:

Invoke-Command -ComputerName $serverneedhelp -ScriptBlock {& SC.exe config "bits" type= own}
mr00va
  • 1
  • 2