I do the testing and it work by adding a role setting to the DEFAULT as readonly.
Security role creation:
security login role create -role script -cmddirname "DEFAULT" -access readonly -vserver cluster1
security login role create -role script -cmddirname "vserver" -access readonly -vserver cluster1
security login role create -role script -cmddirname "vserver options" -access all -query "-option-name replication.throttle.outgoing.max_kbs" -vserver cluster1
Create and apply role to a user:
security login create -user-or-group-name jocolon -application ontapi -authentication-method password -role script -vserver cluster1
security login create -user-or-group-name jocolon -application ssh -authentication-method password -role script -vserver cluster1
Create the powershell credential object:
PS C:\Users\Administrator.DEMO> $cred = (Get-Credential)
Display powershell credential object:
PS C:\Users\Administrator.DEMO> $cred
UserName Password
-------- --------
jocolon System.Security.SecureString
I changed your script a litter bit:
PS C:\Users\Administrator.DEMO> Invoke-NcSsh -Name cluster1 -Credential $cred -Command "vserver options -option-name replication.throttle.outgoing.max_kbs 3125"
NcController : cluster1
Value :
Last login time: 1/30/2021 15:24:50
1 entry was modified.
Display the modified option:
PS C:\Users\Administrator.DEMO> Invoke-NcSsh -Name cluster1 -Credential $cred -Command "vserver options -option-name replication.throttle.outgoing.max_kbs"
NcController : cluster1
Value :
Last login time: 1/30/2021 15:25:06
cluster1
replication.throttle.outgoing.max_kbs 3125 -
I learn something new today! Thanks