Microsoft Virtualization Discussions
Microsoft Virtualization Discussions
Hi All,
I know this sounds simple but i am unsure how to trigger an AutoSupport from Powershell? I know i can do this by using SSH to the filer and using the cmd "options autosupport.doit" but find i can do everything else in PowerShell.
Any help is much appreciated.
Jason
Solved! See The Solution
You may be able to use the Set-NaOption cmdlet: Set-NaOption autosupport.doit
-Steven
Try Invoke-NaEmsAutosupportLog. Just be sure to leave -GenerateAutosupport set to false, lest you trigger an immediate ASUP phone home action (unless that's what you want).
Thanks for the feedback Clinton. I am trying to generate and immediate ASUP as i logged a technical support case. I tried doing a "get-help Invoke-NaEmsAutosupportLog" but the description is a little confusing to me and when i try to execute it requires a computer host name. Are you able to supply me with a command to just replicate a "options autosupport.doit" from the filer?
Thanks for your help.
Hi Clinton,
I have the same question, its little confusing when I see the example below. Looks like it do not generate autosupport from the help description, can you please clarify this confusion?
This cmdlet is used by applications to log specific events occurring on a host system.
-------------- Example 1 --------------
C:\PS>Invoke-NaEmsAutosupportLog -ComputerName "host1" -EventId 100 -EventSource "powershell" -AppVersion "2.0"
-Category "test" -EventDescription "this is a test message." -LogLevel 6
Thanks
Ravi
Use the -GenerateAutosupport switch if you really want the filer to phone home now. But please do that very sparingly, as there is overhead on both ends when that happens.
Hi Clinton,
Thanks for helping me understand. Please let me know if I got it.
From what you are saying, there is no way of directly replicating the Data ONTAP cmd "options autosupport.doit" to only send ASUP info from the filer yet. I could however write out the whole powershell cmd as listed below with the "-GenerateAutosupport" flag which will also send log data from the Windows Host "host1" and then send an ASUP with it?
C:\PS>Invoke-NaEmsAutosupportLog -ComputerName "host1" -EventId 100 -EventSource "powershell" -AppVersion "2.0" -Category "test" -EventDescription "this is a test message." -LogLevel 6 -GenerateAutosupport
I tried to run the cmd "Invoke-NaEmsAutosupportLog -GenerateAutosupport" directly but it then asked me to input all the info such as ComputerName:, EventId:, EventSource:, AppVersion:, Category:, EventDescription: and LogLevel: before the cmd would execute.
You may be able to use the Set-NaOption cmdlet: Set-NaOption autosupport.doit
-Steven
I get an error when I do that (but it still triggers the ASUP):
I use Invoke-Nassh "options autosupport.doit test". That works and doesn't generate an error.
OK, so if you don't want to use Invoke-NaSsh, and Set-NaOption does trigger the ASUP, you can combine Set-NaOption with -ErrorAction SILENTLYCONTINUE.
Get-NaOption autosupport.doit "Test"