|
|
Data ONTAP® PowerShell Toolkit
|
Cmdlet: Invoke-NcSsh
NAME
Invoke-NcSsh
SYNOPSIS
Send a Data ONTAP CLI command via SSH.
SYNTAX
Invoke-NcSsh -Command <String[]> [-Credential <PSCredential>] [-Port <Int32>
] [-Timeout <Int32>] [-WhatIf] [-Confirm] [<CommonParameters>]
Invoke-NcSsh -Name <String> -Command <String[]> [-Credential <PSCredential>]
[-Port <Int32>] [-Timeout <Int32>] [-Username <String>] [-Passphrase <Secur
eString>] [-PrivateKeyFile <String>] [-WhatIf] [-Confirm] [<CommonParameters
>]
Invoke-NcSsh -Controller <NcController[]> -Command <String[]> [-Credential <
PSCredential>] [-Port <Int32>] [-Timeout <Int32>] [-WhatIf] [-Confirm] [<Com
monParameters>]
DESCRIPTION
Send a Data ONTAP CLI command via SSH.
This cmdlet is useful for querying or manipulating Data ONTAP if a more spec
ific PowerShell cmdlet is not available. It may also be used to to interact
with Data ONTAP in lieu of opening a terminal connection to the controller.
PARAMETERS
-Command <String[]>
The command string to send to Data ONTAP. If the command string contain
s hyphens, enclose the command in quotes lest PowerShell attempt to inte
rpret those as cmdlet arguments.
Required? true
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Credential <PSCredential>
Use this argument to explicitly provide SSH credentials for authenticati
ng with Data ONTAP. If credentials are provided, they take precedence o
ver any other credentials that may be available. If not provided, the c
mdlet will look for valid credentials from either the specified NcContro
ller object or $global:CurrentNcController as appropriate. Failing that
, credentials will be sought in the Toolkit's credential cache.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Port <Int32>
The port on which to connect to the storage controller.
Required? false
Position? named
Default value 22
Accept pipeline input? false
Accept wildcard characters? false
-Timeout <Int32>
Connection timeout in milliseconds.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-WhatIf
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Confirm
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Name <String>
The name or address of the controller to connect to. If a hostname is s
pecified, it must be resolvable to an IP address. Specify either this a
rgument or the -Controller argument, but not both.
Optionally, specify the user in the <user>@<hostname> format. If this f
ormat is specified, the cmdlet will attempt to authenticate the user usi
ng private key authentication.
Required? true
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
-Username <String>
Specify the username to log in as using the private key file. If the Na
me parameter is specified in the <user>@<hostname> format, this paramete
r is ignored.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Passphrase <SecureString>
Passphrase required for the private key file. If not specified, the pri
vate key does not require a passphrase.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-PrivateKeyFile <String>
Full path to the private key file to use to authenticate the connection.
If not specified, the $DataONTAP_SSHPrivateKeyFile variable is consult
ed. The $DataONTAP_SSHPrivateKeyFile variable may contain one or more p
aths to private key files, or directories containing private key files.
Required? false
Position? named
Default value
Accept pipeline input? false
Accept wildcard characters? false
-Controller <NcController[]>
The controller(s) to connect to, embodied in an NcController object as r
eturned by Connect-NcController. Specify
either this argument or the -Name argument, but not both.
Required? true
Position? named
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false
<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".
INPUTS
OUTPUTS
DataONTAP.C.PowerShell.SDK.Cmdlets.MultilineStr
NOTES
Category: toolkit
-------------- Example 1 --------------
C:\PS>Invoke-NcSsh system health status show
Invoke the cluster CLI command 'system health status show'.
NcController : 10.61.172.155
Value : Status
---------------
OK
-------------- Example 2 --------------
C:\PS>Invoke-NcSsh -Name beam@10.61.167.211 -PrivateKeyFile C:\ssh\privateke
y -Command "version"
Invoke the CLI command "version" via SSH. Use the specified private key fil
e for authentication.
NcController : 10.61.167.211
Value : NetApp Release 8.1.2 Cluster-Mode: Tue Oct 30 23:53:39 PDT 20
12
-------------- Example 3 --------------
C:\PS>$passphrase = Read-Host -AsSecureString "Passphrase"
Invoke-NcSsh -Name beam@10.61.167.211 -PrivateKeyFile C:\ssh\win2k8devrre0_p
rivatekey -Command "version" -Passphrase $passphrase
Invoke the CLI command "version" via SSH. Use the specified private key fil
e for authentication. Use a prompt to gather the passphrase.
NcController : 10.61.167.211
Value : NetApp Release 8.1.2 Cluster-Mode: Tue Oct 30 23:53:39 PDT 20
12
-------------- Example 4 --------------
C:\PS>$DataONTAP_SSHPrivateKeyFile = "C:\ssh\privatekey"
Invoke-NcSsh -Name beam@10.61.167.211 -Command "version" -Passphrase $passph
rase
Invoke the CLI command "version" via SSH. Use the private key file specifie
d in the $DataONTAP_SSHPrivateKeyFile variable. Use the passphrase from Exa
mple 3.
NcController : 10.61.167.211
Value : NetApp Release 8.1.2 Cluster-Mode: Tue Oct 30 23:53:39 PDT 20
12
-------------- Example 5 --------------
C:\PS>Invoke-NcSsh -Name beam@10.61.167.211 -Command "version" -Passphrase (
ConvertTo-SecureString "passphrase" -AsPlainText -Force)
Invoke the CLI command "version" via SSH. Use the private key file specifie
d in the $DataONTAP_SSHPrivateKeyFile variable and a plaintext passphrase.
NcController : 10.61.167.211
Value : NetApp Release 8.1.2 Cluster-Mode: Tue Oct 30 23:53:39 PDT 20
12
RELATED LINKS
Connect-NcController
| Copyright © 2012 NetApp. All rights reserved. Use is subject to license terms. |
|
Data ONTAP® PowerShell Toolkit
|