Dees anyone have a script to retrieve Host Syslog settings? The output file should contain hostname and syslog entry. I do not want to change the settings automatically, I only want to check to ensure that all hosts have a entry.
Thank you
Hello, -
You can employ the Get-VMHostSyslogServer cmdlet to get this info. Like:
Get-VMHost | %{$oSyslogEndpoint = Get-VMHostSysLogServer -VMHost $_; Select-Object -InputObject $_ `
name,@{n="SyslogSrv"; e={$oSyslogEndpoint.Host}},@{n="SyslogPort"; e={$oSyslogEndpoint.Port}}}
That would output something like:
Name SyslogSrv SyslogPort
---- --------- ----------
myHost0 oursyslogSrv.dom.com 514
myHost1 oursyslogSrv.dom.com 514
myHost2
myHost3 oursyslogSrv.dom.com 514
...where there are no values for SyslogSrv and SyslogPort if the VMHost has no Syslog server configured. And, if you want to export that to a file, you can append " | Export-Csv c:\temp\VMHostSyslogInfo.txt -UseCulture -NoTypeInfo" to the end. That do it for you?
Hello, -
You can employ the Get-VMHostSyslogServer cmdlet to get this info. Like:
Get-VMHost | %{$oSyslogEndpoint = Get-VMHostSysLogServer -VMHost $_; Select-Object -InputObject $_ `
name,@{n="SyslogSrv"; e={$oSyslogEndpoint.Host}},@{n="SyslogPort"; e={$oSyslogEndpoint.Port}}}
That would output something like:
Name SyslogSrv SyslogPort
---- --------- ----------
myHost0 oursyslogSrv.dom.com 514
myHost1 oursyslogSrv.dom.com 514
myHost2
myHost3 oursyslogSrv.dom.com 514
...where there are no values for SyslogSrv and SyslogPort if the VMHost has no Syslog server configured. And, if you want to export that to a file, you can append " | Export-Csv c:\temp\VMHostSyslogInfo.txt -UseCulture -NoTypeInfo" to the end. That do it for you?
that was the ticket!
Thank You so much