Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Physical Host Name of a Hyper-V virtual server
#1
Hello everybody,

I'm trying to get some Windows 2008 Hyper-V hosted virtual servers to automatically report their host (physical) server name.
For that purpose, I made a "nombre-host.bat" script with the following commands:
C:\Windows\System32\REG.exe QUERY "HKLM\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters"
And added this other command just to report something already known:
C:\Windows\System32\REG.exe QUERY "HKLM\SOFTWARE\Microsoft\Notepad\DefaultFonts"
Then I've added:
module_exec cmd.exe /c ""c:\1\nombre-host.bat"" >> c:\1\output.txt
to the pandora agent configuration.

The second registry query works as planned but strangely, the first one always return Null or something like that.
I've already tried replacing my .bat with a VBScript with similar commands, but with no luck.

It's like this specific keys were invisible for the pandora agent service. :-(

Does anybody knows a simple and foolproof way of reporting this?

Rgds,

Andres

 Reply
#2

You can't read a 64 bit key from 32 bit service (pandora agent) in Win 2008 unless you use this specific modifier: "/reg:64".

So, the modified command:
"reg query "HKLM\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters" /v PhysicalHostName /reg:64"
works like a charm, reporting the right host name.

http://support.microsoft.com/kb/948698

Rgds.
 Reply


Users browsing this thread: 1 Guest(s)


(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | pandorafms.com | pandorafms.org

Theme © MyBB Themes