A
A
andreystrelkov2015-11-11 15:58:55
PowerShell
andreystrelkov, 2015-11-11 15:58:55

How to leave and start IIS on a remote machine using Powershell?

Good afternoon, please tell me
On one virtual machine, a PS script is launched, the purpose of which is to stop IIS on another virtual machine, after which we can immediately start it again.
I'm trying to do it in the following way, at least stop it, but it doesn't work

Enter-PSSession 140vm-elmaelastic.ad.vz
Get-Process w3wp* | Stop-Process -Force
Exit-PSSession

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
ace_foster, 2015-11-12
@ace_foster

What mistake? Is it possible to get into this car at all?

I
Ivan Bazaichenko, 2016-01-13
@Banzaii

icm -comp *hostname* -sc {restart-service w3svc,was -force}
icm -comp *hostname* -sc {iisreset /restart}
iisreset *hostname* /restart

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question