Forum Discussion
awss-1979
Jan 11, 2019Copper Contributor
Proxy Settings when using OMS Agent VM Extension via ARM template
Hi all I'm adding the Monitoring Agent using a VM extension in an ARM template, using the following code. My question is whether it's possible to specify authentication details in the template co...
awss-1979
Jan 14, 2019Copper Contributor
Thank you for the reply. I'm able to configure the proxy address using this method, however my question is how I can use proxy credentials, in order to authenticate to the proxy.
Vinoth_Azure
Jan 14, 2019MCT
To configure proxy settings for the Microsoft Monitoring Agent using Control Panel
Open Control Panel.
Open Microsoft Monitoring Agent.
Click the Proxy Settings tab.
proxy settings tab
Select Use a proxy server and type the URL and port number, if one is needed, similar to the example shown. If your proxy server requires authentication, type the username and password to access the proxy server.
Use the following procedure to create a PowerShell script that you can run to set the proxy settings for each agent that connects directly to servers.
To configure proxy settings for the Microsoft Monitoring Agent using a script
Copy the following sample, update it with information specific to your environment, save it with a PS1 file name extension, and then run the script on each computer that connects directly to the OMS service.
param($ProxyDomainName="http://proxy.contoso.com:80", $cred=(Get-Credential))
# First we get the Health Service configuration object. We need to determine if we
# have the right update rollup with the API we need. If not, no need to run the rest of the script.
$healthServiceSettings = New-Object -ComObject 'AgentConfigManager.MgmtSvcCfg'
$proxyMethod = $healthServiceSettings | Get-Member -Name 'SetProxyInfo'
if (!$proxyMethod)
{
Write-Output 'Health Service proxy API not present, will not update settings.'
return
}
Write-Output "Clearing proxy settings."
$healthServiceSettings.SetProxyInfo('', '', '')
$ProxyUserName = $cred.username
Write-Output "Setting proxy to $ProxyDomainName with proxy username $ProxyUserName."
$healthServiceSettings.SetProxyInfo($ProxyDomainName, $ProxyUserName, $cred.GetNetworkCredential().password)
Open Control Panel.
Open Microsoft Monitoring Agent.
Click the Proxy Settings tab.
proxy settings tab
Select Use a proxy server and type the URL and port number, if one is needed, similar to the example shown. If your proxy server requires authentication, type the username and password to access the proxy server.
Use the following procedure to create a PowerShell script that you can run to set the proxy settings for each agent that connects directly to servers.
To configure proxy settings for the Microsoft Monitoring Agent using a script
Copy the following sample, update it with information specific to your environment, save it with a PS1 file name extension, and then run the script on each computer that connects directly to the OMS service.
param($ProxyDomainName="http://proxy.contoso.com:80", $cred=(Get-Credential))
# First we get the Health Service configuration object. We need to determine if we
# have the right update rollup with the API we need. If not, no need to run the rest of the script.
$healthServiceSettings = New-Object -ComObject 'AgentConfigManager.MgmtSvcCfg'
$proxyMethod = $healthServiceSettings | Get-Member -Name 'SetProxyInfo'
if (!$proxyMethod)
{
Write-Output 'Health Service proxy API not present, will not update settings.'
return
}
Write-Output "Clearing proxy settings."
$healthServiceSettings.SetProxyInfo('', '', '')
$ProxyUserName = $cred.username
Write-Output "Setting proxy to $ProxyDomainName with proxy username $ProxyUserName."
$healthServiceSettings.SetProxyInfo($ProxyDomainName, $ProxyUserName, $cred.GetNetworkCredential().password)