Hello everyone,
i am writing a Powershellscript which shuts down some machines. One of these is a Fortigate.
So I establish a new SSH-Session and invoke the "execute Shutdown"-Command. But how can I confirm it with "y"?
Is there any "force"-command or something to work around the Shutdown-Confirmation?
When i do:
Invoke-SSHCommand -SessionId 0 -Command "execute shutdown"
Invoke-SSHCommand -SessionId 0 -Command "y"
it doesn't work.
Thanks a lot,
DoubleD
Nominating a forum post submits a request to create a new Knowledge Article based on the forum post topic. Please ensure your nomination includes a solution within the reply.
Hello DoubleD,
i have the same problem. How did you solve the issue?
Thank you in advance, Markus
Hi Markus,
just try it with a SSHStream:
$SSHStream = New-SSHShellStream -Index 0
$SSHStream.WriteLine("execute shutdown") $SSHStream.Read()
regards,
Dominik
Did you look at adding the cmd option to set Confirm:$false in your script?
Ken Felix
PCNSE
NSE
StrongSwan
May better to use directly API (with PoweFGT !) need only to found the API call for shutdown device
Select Forum Responses to become Knowledge Articles!
Select the “Nominate to Knowledge Base” button to recommend a forum post to become a knowledge article.
User | Count |
---|---|
1712 | |
1093 | |
752 | |
447 | |
231 |
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.