Aussie owned and operated, with 23+ years of industry experience, Gold Coast InfoTech is delighted to support all of your business technology requirements.

Gallery

Contacts

success@goldcoastinfotech.com.au

1800 291 071

KBArticles Scripts, Commands, Registry

Script to interrogate HP Servers serial and add ilo alias to DNS

‘ Section to interrogate the servers Serial number, trim the spaces then call dnscmd.exe to add the ilo%servername% as an alias to ilo%serialnumber%

strComputer = “.”
Set objWMIService = GetObject(“winmgmts:” _
& “{impersonationLevel=impersonate}!\” & strComputer & “rootcimv2”)
Set colBIOS = objWMIService.ExecQuery _
(“Select * from Win32_BIOS”)
For each objBIOS in colBIOS
strSerial = objBIOS.SerialNumber
Next
Set WshNetwork=WScript.CreateObject(“WScript.Network”)
COMPUTERNAME=WshNetwork.ComputerName
set dShell=createobject(“wscript.shell”)
dshell.run “c:dnscmd.exe DNSSERVER /RecordAdd mydomain.com ilo”& COMPUTERNAME &” CNAME ilo”& TRIM(strSerial) & “.mydomain.com”
set oShell=nothing

Author

Customer

Leave a comment

Your email address will not be published. Required fields are marked *