Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

It is possible to run Customized PowerShell commandlets or scripts on the servers managed by VSM. 

The output from these scripts can be seen on the View Details page or Dashlet. 

To configure a custom script, navigate to your Manage Equipment Page, and Edit a Windows Server.

Under the Custom Scripts Tab, enter the PowerShell command details.

For example:

  • Retrieve the last 10 lines of an application log file every 5 minutes:
     Get-Content c:/User/AppData\Local\Microsoft\Teams/logs.txt | tail -10
  • Retrieve random Internet Cat Facts every 24 hours
     Invoke-WebRequest -Uri 'https://catfact.ninja/fact' -UseBasicParsing | Select-Object -ExpandProperty 'Content' | ConvertFrom-Json

A maximum of five PowerShell commandlets may be added with minimum frequency of 5 minutes.

Viewing Custom Script Output

To view command output, click on View Details -> Custom Scripts, for that Windows Server.

Or, open a Windows Server Dashlet.