install OMS Log Analytics Agent and OMS Dependency Agent to all Windows VMs in the subscription using PowerShell

Save the following code as myscript.ps1 by replacing the ????? with the OMS workspaceid and OMS workspace key. Share the file using Storage Account Shared Access key as https:// function installOMS { param( [parameter(Mandatory=$true, HelpMessage=”OMS Log Analytics Workspace ID”)] [ValidateNotNullOrEmpty()] [string]$WorkSpaceID, [parameter(Mandatory=$true, HelpMessage=”OMS Log Analytics Workspace Key”)] [ValidateNotNullOrEmpty()] [string]$WorkSpaceKey ) $verboseactionoutput = “continue” # Set…

2