Microsoft Virtualization Discussions

powershell cmdlet for security login publickey cli

AdaikkappanArumugam
6,584 Views

Hi Powershell Experts,

                I am looking for the powershell cmdlet that does the following cli equivalent.

 

security  login publickey  create -username (account) -comment (change control #) -vserver (clustername) -index 0 -publickey (ssh key)

 

If there is none, I will use the Inovke-NcSsh. But before that wanted to check with the experts.

 

Thanks

Adai

 

7 REPLIES 7

JGPSHNTAP
6,551 Views

I haven't had much luck searching as well.

 

Im curious if this is going to be for a domain implementation for ssh keys

coreywanless
6,543 Views

Unfortunately, there is no direct powershell commandlet for this. What I have done to get around this is to utilize the "invoke-ncssh" command to run the command.  Sorry to be a disappointment in this area. 

AdaikkappanArumugam
6,517 Views

Thats what I ended up doing...

$command = "security login publickey create  -username $($userList.userName) -index 1 -publickey ""$($userList.publicKey)"""

Invoke-NcSsh $command

 

 

Do note the multiple quotes around the key.

 

Regards

Adai

korns
6,526 Views

I'm not sure this is an answer but I did just read the Toolkit announce in the forum on DataONTAP PSTK 3.3 (inside  new NetApp  ontap/santricty/mars PSTK) which ays with ontap 8.3.1 and this new TK there are 7 new 'Security Key Mgmt' cmdlets.

mcgue
6,457 Views

Does New-NcUser get you what you are looking for?

coreywanless
6,443 Views

'New-NcUser' will allow you to create the user and allow publickey as an authentication method, but it doesn't allow you to upload your public key.  (At least in any combination I have tried)

mcgue
6,418 Views

I looked at the 3.3 toolkit and the new security key items are for the key server options for running encrypted disks, so that doesn't look like it will help.  It looks like the suggestion that Adai has for you above is the best way to get this done now.

Public