NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Microsoft Virtualization Discussions

Get-NcAntivirusLog : not authorized for that command

jbattista
3,861 Views

When attempting to run Get-NcAntivirusLog, for the purposes of building a report, this error is returned.
Get-NcAntivirusLog : not authorized for that command

 

Get-Help does not show any additional command required for this cmdlet. I am assuming it requires advanced privileges (set -privilege advanced), but I have not found a way to set those within Powershell.

1 ACCEPTED SOLUTION

jbattista
3,797 Views

I believe have figured out how to run the cmdlet in question.

Invoke-NcSsh -Command "set -privilege advanced -confirmations off" | Get-NcVscanEvents

Since the command is a PowerShell call to "vserver vscan show-events", and to be able to use that command, set -privilege advanced needs to be called, putting the command into the Invoke-NcSsh cmdlet and piping the reset to the Get-NCAntiVirusLog cmdlet, works. 

I do think that the Get-NcVscanEvents should be a standalone, and not require this addition to make it work. I think the advanced privilege should be either in the Connect-NcController or the Get-NcVscanEvents or Get-NcAntiVirusLog.

View solution in original post

4 REPLIES 4

hmoubara
3,824 Views

Hello,

 

Which version of Ontap are you running and what user are you using to connect to the storage?

 

Thanks 

NetApp_SR
3,815 Views

Just to be sure while logged in as the same user you are connecting with in powershell, set privilege to advanced and try to run the "vserver vscan show-events".   Then move on to the script. I looked at some other scripts so maybe something like Invoke-NcSsh -Command "set -privilege advanced;vserver vscan show-events" will work for you. Let me know if this helps or if we need to try again.

jbattista
3,799 Views

I actually posted that same solution yesterday after I posted my question. It seems to have gone missing.

jbattista
3,798 Views

I believe have figured out how to run the cmdlet in question.

Invoke-NcSsh -Command "set -privilege advanced -confirmations off" | Get-NcVscanEvents

Since the command is a PowerShell call to "vserver vscan show-events", and to be able to use that command, set -privilege advanced needs to be called, putting the command into the Invoke-NcSsh cmdlet and piping the reset to the Get-NCAntiVirusLog cmdlet, works. 

I do think that the Get-NcVscanEvents should be a standalone, and not require this addition to make it work. I think the advanced privilege should be either in the Connect-NcController or the Get-NcVscanEvents or Get-NcAntiVirusLog.

Public