Windows Management Instrumentation Scripts
#1
Does anyone know how to write scripts based on WMI.
Basically I need to be able to set a script loose on my domain and gather alist of machines from the browse list.
Then go through this list and gather details of each machine on this list, Hardware inventory, Software Software Inventory and current user.
I would also like to send issue commands remotely using something like the exec.vbs script that comes with 2000 res kit. However this only seems to work with pure MS Apps.
I would like to deploy Hotfixes and ServicePacks using something like exec.vbs.
I'm in a firefighting position at the moment and do not have the time to climb the learning curve. Also the company I'm working for is strapped for cash and getting them to buy tools to do this sort of stuff is not going to be possible.
I would be gratefull for any help/ URL's you can give.
Cheers Guys
VMAX
Basically I need to be able to set a script loose on my domain and gather alist of machines from the browse list.
Then go through this list and gather details of each machine on this list, Hardware inventory, Software Software Inventory and current user.
I would also like to send issue commands remotely using something like the exec.vbs script that comes with 2000 res kit. However this only seems to work with pure MS Apps.
I would like to deploy Hotfixes and ServicePacks using something like exec.vbs.
I'm in a firefighting position at the moment and do not have the time to climb the learning curve. Also the company I'm working for is strapped for cash and getting them to buy tools to do this sort of stuff is not going to be possible.
I would be gratefull for any help/ URL's you can give.
Cheers Guys
VMAX
#2
Hi,
Quick tip re. deploying hotfixes - have just found a great .js at http://www.ntbugtraq.com/default.asp?pid=36&sid=1&A2=ind0110&L=ntbugtraq&F= P&S=&P=7214 . I'm currently playing with this to customise it for our environment.
WRT remote control, I use Dameware Utilities a lot ( http://www.dameware.com ). It doesn't do anything that can't be achieved though rkit/freeware tools, but it does make it all a lot easier.
Hotfix/SP checks - use Microsoft's hfnetchk to scan your whole domain - you can pass this into a spreadsheet to play with it later.
Executing a batchfile against each pc on a domain - create a batch file to take %1 as the computer name then a separate batch file with the following:
FOR /F "skip=3" %%I In ('Net View') Do batchfile.bat %%I
which will pass the name of each machine on your domain (that's turned on at the time). It will error on the last line, but that doesn't really matter (do a Net View to see why!).
IE Patches, Office patches - lots of different techniques. Drop me an email if any of this sounds helpful.
Cheers,
Dom
Quick tip re. deploying hotfixes - have just found a great .js at http://www.ntbugtraq.com/default.asp?pid=36&sid=1&A2=ind0110&L=ntbugtraq&F= P&S=&P=7214 . I'm currently playing with this to customise it for our environment.
WRT remote control, I use Dameware Utilities a lot ( http://www.dameware.com ). It doesn't do anything that can't be achieved though rkit/freeware tools, but it does make it all a lot easier.
Hotfix/SP checks - use Microsoft's hfnetchk to scan your whole domain - you can pass this into a spreadsheet to play with it later.
Executing a batchfile against each pc on a domain - create a batch file to take %1 as the computer name then a separate batch file with the following:
FOR /F "skip=3" %%I In ('Net View') Do batchfile.bat %%I
which will pass the name of each machine on your domain (that's turned on at the time). It will error on the last line, but that doesn't really matter (do a Net View to see why!).
IE Patches, Office patches - lots of different techniques. Drop me an email if any of this sounds helpful.
Cheers,
Dom
#3
DOM,
Thanks for giving me those tips.
I will check out those utils you mentioned. I' found out about Microsoft's Hfnetchk ( Right after being hit by nimda).
The problem is I have a large amount of machines on in the domain. I can keep up with the deployment of fixes. Each machine is Windows NT 4.0 and local users do not have admin rights on the machines so it is difficult to put stuff in login scripts because they fail with noe admin rights.
W2K pro machines are a brease because I use the built in WMI and create a process instance on the machine with admin rights and this installs anything I want.
Any tips you have very gratefull.
Once again thanks for your post.
VMAX
PS: ( Your email addres is not listed )
Thanks for giving me those tips.
I will check out those utils you mentioned. I' found out about Microsoft's Hfnetchk ( Right after being hit by nimda).
The problem is I have a large amount of machines on in the domain. I can keep up with the deployment of fixes. Each machine is Windows NT 4.0 and local users do not have admin rights on the machines so it is difficult to put stuff in login scripts because they fail with noe admin rights.
W2K pro machines are a brease because I use the built in WMI and create a process instance on the machine with admin rights and this installs anything I want.
Any tips you have very gratefull.
Once again thanks for your post.
VMAX
PS: ( Your email addres is not listed )
#4
SMS 2.0 or failing that you can use a mixture of .vbs/kix logon scripts. Get your hands on SMS installer and use this to create your software packages that you want to distribute. Use the clever logon script to identify which machines have got the application.
This can be done by creating a new registry key on each machine when an application is installed that can be queried by the logon script.
You can also use your logon script to run any number of utilites that will get the other info you are after and output it to a .csv file. This file can be collected on a daily basis by the logon and placed on a network share.
Using Excel you could create another bit of VB that collects this data and imports it into a spreadsheet.
Easy.
Regards
Paul
[Edited by paulmon - 10/23/2001 11:52:40 AM]
This can be done by creating a new registry key on each machine when an application is installed that can be queried by the logon script.
You can also use your logon script to run any number of utilites that will get the other info you are after and output it to a .csv file. This file can be collected on a daily basis by the logon and placed on a network share.
Using Excel you could create another bit of VB that collects this data and imports it into a spreadsheet.
Easy.
Regards
Paul
[Edited by paulmon - 10/23/2001 11:52:40 AM]
#5
VMAX,
Yes, slightly different environment. Our users tend to have Local Admin rights which make things a lot easier. As you say, Windows 2000 is a whole lot easier than NT and lends itself to a much greater range of scripting techniques.
For remote deployment to NT machines (where users don't have admin rights), I used the batch file technique that I described previously. A bit clunky, but my "batchfile.bat" basically does the following;
1)Copies the necessary executables to the local PC
2)Schedules a task to run them with the correct parameters (using AT)
3)Schedules another task to clean-up afterwards
Some "hotfixes" are a bit unhelpful and throw up a "Do you want to reboot" no matter what parameters you throw at them (IE hotfixes are a good example). In these instances I use MS scriptit to run the install and cancel/ok the restart box afterwards.
Technique is a bit tacky but seems to be one of few zero expenditure techniques for NT.
Dom
Yes, slightly different environment. Our users tend to have Local Admin rights which make things a lot easier. As you say, Windows 2000 is a whole lot easier than NT and lends itself to a much greater range of scripting techniques.
For remote deployment to NT machines (where users don't have admin rights), I used the batch file technique that I described previously. A bit clunky, but my "batchfile.bat" basically does the following;
1)Copies the necessary executables to the local PC
2)Schedules a task to run them with the correct parameters (using AT)
3)Schedules another task to clean-up afterwards
Some "hotfixes" are a bit unhelpful and throw up a "Do you want to reboot" no matter what parameters you throw at them (IE hotfixes are a good example). In these instances I use MS scriptit to run the install and cancel/ok the restart box afterwards.
Technique is a bit tacky but seems to be one of few zero expenditure techniques for NT.
Dom
Thread
Thread Starter
Forum
Replies
Last Post
shorty87
Full Cars Breaking For Spares
19
22 December 2015 11:59 AM
hardcoreimpreza
Computer & Technology Related
21
11 October 2015 03:40 PM