#41629 - 2003-06-17 03:52 PM
Get Ip doesnt work in windows nt 4.0
|
Deniz
Fresh Scripter
Registered: 2003-06-11
Posts: 11
Loc: Brazil
|
Hello everyone.
I made up this script, and it is working fine with Windows 98, 2000 and XP, but it seems not work in windows nt 4.0.
I get this error message: select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE 6The handle is invalid.
The script is following:
=================================== $survey = 01 $memoria = memorysize() + 1
$IpSet = GetObject("winmgmts:").ExecQuery("select IPAddress from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
If @error <> 0 ? @error + " / " @serror else For Each $IPConfig In $IPSet $IP = $IPConfig.IPAddress(0) IF Open( 3 , "\\spohs01\viruslog\controle.txt" , 5 ) = 0 $x = WriteLine(3 , "IP" + "," + $survey + "," + @WKSTA + "," + @LDOMAIN + "," + @USERID + "," + @MDAYNO + "," + @MONTHNO + "," + @YEAR + "," + $IP + "," + Chr(13) + Chr(10)) endif
Next EndIf
exit 1 ==================================== Does anyone have a clue? Its the same login script for all users, but it really doesnt work for windows nt 4.0
Thank you alll Best Regards
Deniz Feital
_________________________
Deniz Feital
|
Top
|
|
|
|
#41631 - 2003-06-17 03:56 PM
Re: Get Ip doesnt work in windows nt 4.0
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
look at WMIQuery()... it does most of the work for you.
However, Jens is probably right. WMI isn't built into NT4, but only as an option in SP 3 or 4
|
Top
|
|
|
|
#41632 - 2003-06-17 03:57 PM
Re: Get Ip doesnt work in windows nt 4.0
|
Deniz
Fresh Scripter
Registered: 2003-06-11
Posts: 11
Loc: Brazil
|
I am sorry, this message was sent to me? I didnt understand it.
Thanks !
_________________________
Deniz Feital
|
Top
|
|
|
|
#41633 - 2003-06-17 04:03 PM
Re: Get Ip doesnt work in windows nt 4.0
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#41634 - 2003-06-17 04:32 PM
Re: Get Ip doesnt work in windows nt 4.0
|
Deniz
Fresh Scripter
Registered: 2003-06-11
Posts: 11
Loc: Brazil
|
Well, cant I run my script to get an IP address from my windows nt 4.0? Is that correct?
I thought I could because it works really fine over other OS.
Regards.
_________________________
Deniz Feital
|
Top
|
|
|
|
#41636 - 2003-06-17 04:45 PM
Re: Get Ip doesnt work in windows nt 4.0
|
Deniz
Fresh Scripter
Registered: 2003-06-11
Posts: 11
Loc: Brazil
|
Hi Jen.
The macro @IPADDRESSx will fit perfectly.
Thank you for your patience.
Best Regards,
_________________________
Deniz Feital
|
Top
|
|
|
|
#41637 - 2003-06-17 04:54 PM
Re: Get Ip doesnt work in windows nt 4.0
|
Deniz
Fresh Scripter
Registered: 2003-06-11
Posts: 11
Loc: Brazil
|
Well, still not working with Windows NT 4.0.
I am not sure if wmi is installed in our workstations, but I bet its not. I know quite nothing about Kix, just trying to make an inventory at the company where I work. I need is to find a couple of values in each workstation, values like, computername, username, operational system and ip address. All is working fine but Ip address. I need to know the ip address to find out where the workstation is. I've tried, @ipaddress, GetObject("winmgmts:") and so on, but nothing seems to work in nt 4.0. I am thinking to use the command ipconfig >test.txt and try to extract the line IP address on that file. Do you know kix can do it?
Thank you again.
_________________________
Deniz Feital
|
Top
|
|
|
|
#41639 - 2003-06-17 04:59 PM
Re: Get Ip doesnt work in windows nt 4.0
|
Deniz
Fresh Scripter
Registered: 2003-06-11
Posts: 11
Loc: Brazil
|
I tried to use it.
It works really fine in Windows 98, Windows 2000 and Windows XP, but doesnt work in Windows NT 4.0 and I still have some windows nt 4.0 workstation at my company.
Thats the issue, I am not being able to find out the ip address for those windows nt 4.0.
Thanks
_________________________
Deniz Feital
|
Top
|
|
|
|
#41642 - 2003-06-17 05:19 PM
Re: Get Ip doesnt work in windows nt 4.0
|
Deniz
Fresh Scripter
Registered: 2003-06-11
Posts: 11
Loc: Brazil
|
Yes, I am using the versio 4.21.
_________________________
Deniz Feital
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1574 anonymous users online.
|
|
|