Login | |
|
 |
RE: Pull information from a file based on search criteria - 12/11/2006 9:35:26 AM
|
|
 |
|
| |
ehvbs
Posts: 2077
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
|
Hi aburt, nice to see/read from you again. As to the first problem: If I run my netshrun-02.vbs on my sample file, I get cscript netshrun-02.vbs ok, doTheRealWork() was called, but we aren't done yet! nUB 2 Count 3 Clients 2 ------------- 100.10.12.10 ------------- Not Found Run this from the commandline and hope for the best netsh dhcp server \\Server scope 100.10.9.1 add reservedip 100.10.12.10 000000000000 Machine Name nocomment ---------------------------------------- ------------- 100.10.12.11 ------------- Found Run this from the commandline and hope for the best netsh dhcp server \\DHCPSERVER scope ?<ScopeID>? add reservedip 100.10.12.11 00-11-43-13-1f-f6 Machinea.company.com ---------------------------------------- because my sample files contains: ClientInfo : IP Address = 100.10.12.11. SubnetMask = 255.255.254.0. Client Hardware Address = 00-11-43-13-1f-f6. Name = Machinea.company.com. So: (a) double check your input file (b) if you can't guarantee a consistent format, use the Replace(..) strategy on the data red as we did on the default data ( I'm not complaining or chiding, but in my last post I wrote: ' we could/should remove dashes once for all at init/when reading it for the found IPs ' but doing it here keeps all changes at one place; you can do the Replace() wherever ' it's necessary ) The "executing", well, yes. As I can't test it here, I really hesitate to say something like: "use the script on a input file with just 1 ClientInfo; look once again at the output; change the "False" we talked about to "True"; cross your fingers and run the script". You'll have to do your own risk assessment, of course. Good luck!
|
|
| |
|
|
|
|