|
|
|||||||
I'm completely new with scripting and i could use some help. Following script gets IP addresses from lan adapters but what command removes the 0 answers? ?"IP"@IPADDRESS0 ?"IP,"@IPADDRESS1 ?"IP,"@IPADDRESS2 ?"IP,"@IPADDRESS3 ?"IP,"@IPADDRESS4 ?"IP,"@IPADDRESS5 ?"IP,"@IPADDRESS6 ?"IP,"@IPADDRESS7 ?"IP,"@IPADDRESS8 ?"IP,"@IPADDRESS9 I tryed something like this if @IPADDRESS <> "" but it doesn't help. Couldn't find any help using search on this board or google. |
||||||||
|
|
|||||||
What about Code:
FYI: EnumIPInfo does not work for p.e. Windows NT4... |
||||||||
|
|
|||||||
Code:
I think this also works for NT4 Sorry, the code I posted here before was not usuable |
||||||||
|
|
|||||||
@IPADDRESS only goes from 0 to 3. Quote: |
||||||||
|
|
|||||||
I allso need to get these information from NT4 servers, but this script doesn't work. However it works in w2k and w2k3 servers. $strComputer = "." $objWMIService = GetObject("winmgmts:\\"+ $strComputer + "\root\cimv2") $colItems = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem") For Each $objItem in $colItems ? "" + $objItem.Name Next $colItems = $objWMIService.ExecQuery("Select * from Win32_BaseBoard") For Each $objItem in $colItems For Each $x in $objItem.ConfigOptions ? "Config Options:" + $x Next ? "," + $objItem.SerialNumber Next $colItems = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem") For Each $objItem in $colItems ? "," + $objItem.Manufacturer ? "," + $objItem.Model Next $colItems = $objWMIService.ExecQuery("Select * from Win32_OperatingSystem") For Each $objItem in $colItems ? "," + $objItem.Caption ? "," + $objItem.Version ? "," + $objItem.ServicePackMajorVersion Next $colItems = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem") For Each $objItem in $colItems ? "," + $objItem.NumberOfProcessors ? "," + $objItem.TotalPhysicalMemory Next The script needs to print the information to command prompt where the data is collected using tivoli. |
||||||||
|
|
|||||||
WMI is not included in a default NT4 installation. It is available as a download at MS. http://www.microsoft.com/downloads/detai...5B-FBF236E0E875 |
||||||||
|
|
|||||||
I'm able to get these information: ?"HOST name = "@HOSTNAME ?"IP address = "@IPADDRESS0 ?"OS = "@PRODUCTTYPE ?"ver = "@DOS"." @BUILD ?"SP = "@CSD ?"Memory = "MemorySize(0)" MB" ...but still i could use some help finding out NT4 servers serial no., manufacturer (IBM, Dell, HP), model number and the amount of CPU's. I don't want to install any software or addons to them because they are production servers. |
||||||||
|
|
|||||||
I'm able to get the amount of processors with: $EnvNUMBER_OF_PROCESSORS = "%NUMBER_OF_PROCESSORS%" ? "cpu = " + $EnvNUMBER_OF_PROCESSORS ..but the most important information that i need (hardware serial number) seems to be available only if i use WMI. If anyone knows any other way to get that information i would really appreciate it. |
||||||||
|
|
|||||||
see WMIQuery() in the UDF forum for a simple method of getting WMI Info. |
||||||||
|
|
|||||||
If I understand well, for using WMIQuery(), Omit will still have to download and install WMI on his NT4 servers as Mart says. |
||||||||
|
|
|||||||
I realize that but as i mentioned earlyer "I don't want to install any software or addons to them because they are production servers." That's why i asked that if theres any other way to solve serial no., manufacturer (IBM, Dell, HP)and model number besides WMIQuery. I have used allmost all day searching and googling and i'm gettin quite desperate. |
||||||||
|
|
|||||||
Not unless there is a native application on the Servers in question that would probably have come from the MFG. Without WMI it requires a specially written application that would normally come from MFG. Without installing some type of software like WMI or SiSoftSandra or similar then you're probably out of luck. |
||||||||
|
|
|||||||
There is a util for Dell called asset.com and avail here (3-4 different versions). To my knowledge, it only works on the local system and you'd have to pipe it to a text file, then parse that for the info you want. As for HP & IBM I would assume there is a similar utility. |
||||||||
|
|
|||||||
Can someone tell me why this script displays empty answers in NT4 computers but works in w2k and w2k3 servers. I have installed the WMI from microsoft pages. $strComputer = "." $objWMIService = GetObject("winmgmts:\\"+ $strComputer + "\root\cimv2") $colItems = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem") For Each $objItem in $colItems ? "" + $objItem.Name Next $colItems = $objWMIService.ExecQuery("Select * from Win32_BaseBoard") For Each $objItem in $colItems For Each $x in $objItem.ConfigOptions ? "Config Options:" + $x Next ? "," + $objItem.SerialNumber Next $colItems = $objWMIService.ExecQuery("Select * from Win32_ComputerSystem") For Each $objItem in $colItems ? "," + $objItem.Manufacturer ? "," + $objItem.Model Next |
||||||||
|
|
|||||||
I just tested it, and it works fine after installing the wmi on a nt4 box. And just to sound stupid - you need to replace $strComputer = "." with $strComputer = "Thecomputeryouwishtocheck". Edit: After reading Mart's comment, perhaps you should try to get something you know exists and see if a value is returned. |
||||||||
|
|
|||||||
It could also be an option that the info you want to retrieve is not stored in for example the BIOS of the specific machine by the manufacturer. If is the case then you are screwed. |
||||||||
|
|
|||||||
The whole thing actually crashes to the point where after WMI installation the computer needs to be rebooted -> can't boot ower 30 servers that are on production network. Thank you all who helped with this! I may return some day with more starter questions. |
||||||||
|
|
|||||||
Schedule a reboot with AT, so you see the result in the morning... |
||||||||
|
|
|||||||
Or you come in to work with a few systems at BSOD |
||||||||
|
|
|||||||
$strComputer = "." is correct syntax if one targets the local computer. |