I am putting together my plans for what to discuss during my MMS presentation on Automating Windows System administration using scripting technologies. I have a ton of thoughts, but I'd like to see what the community is interested in hearing.
If you want something covered, then send me an email detailing your needs.
Thanks
Posted Tuesday, February 22, 2005 12:13 PM by dthomson | 1 comment(s)
We've all seen the articles speaking of how the open source products are taking over the industry. One instance of this is the Firefox browser. We are told that Firefox is moving rapidly and will own a large segment of the market before long. The problem I have with the reporting is that these articles are using statistics based on the number of downloads versus actual product usage. If this is how product popularity is going to be reported, then I know I've really bumped up a few sites when I downloaded a tool to work on a system, used it and then removed it when I was done. Do this quite a bit and it will really begin to skew the numbers.
I added a freeware counter from StatCounter to my blog the other day. On a limited basis, it allows me to keep track of various statistics relating to who is visiting and what is being read. Since I'm a proponent of accurate reporting, I thought I'd provide some statistics. It's only been a few days, but the numbers are interesting.
Clearly these statistics show that the news headlines are not correct. Of course this is the weekend, so I'll keep tabs on things this coming week and report back my findings.
Please note that this article was not posted to try to swing users to a particular product, but instead, to try to bring a bit of reality to what is being reported.
Posted Sunday, February 13, 2005 1:51 PM by dthomson | 3 comment(s)
This was shared on the NT SysAdmin email list today. It's pretty cool. Test how accurate you are with your knowledge of locating the states.
Place the State
I scored 96% with an average error of 6 miles and it took me 506 seconds (including some time for a few distractions)
Go here -> States Web Games for more.
Posted Friday, February 11, 2005 4:34 PM by dthomson | with no comments
This may have been covered by someone else already, but here is my take on adding a search feature to your blog.
For blogs based on the .Text code, navigating through the Admin features of your blog, you should go to Options -> Configure and add the following code to the Static News/Announcement section.
The two items in red will need to be changed to reflect the proper location of your blog (item 1) and your username on myITforum.com (item 2).
Q: What does this code do?
A: This code will add a search area to the News section of your blog. The search uses Google and includes the following items:
Another customization I did to the search was to have the results displayed in a separate window (see the code highlighted in blue).
Feel free to contact me if you have questions or comments on this post. I hope you find this useful.
Posted Friday, February 11, 2005 12:54 PM by dthomson | 1 comment(s)
I wonder if anyone is deploying their custom mof files and, while doing so, inclduing them in the list of mof files which are autorecovered during a rebuild of the WMI repository.
Running the following command when deploying your custom mof file will include it in the autorecover list.
MOFCOMP -AUTORECOVER moffile.mof
The autorecover list is located in the following registry entry: HKLM\Software\Microsoft\WBEM\CIMOM\Autorecover MOFs
I'd like to hear your comments on this topic. If you cannot post a comment to this post, then please send them to me via email.
Posted Tuesday, February 08, 2005 12:10 PM by dthomson | with no comments
Our community has a wonderful sense of openness which allows us to not only learn from the experiences of others, but to also freely give back by sharing stuff that we do.
Here are a few tips when sharing files.
These bullets mainly apply when sharing script (bat, vbs, kix, etc.) and registry files.
Posted Monday, February 07, 2005 5:34 PM by dthomson | with no comments
We get a wide range of questions via email and posted to the scripting forums over at www.myTIforum.com regarding how to accomplish various scripting tasks. The Scripting Guys have created a Scripting Techniques section over at the TechNet Script Center. You'll find some nice sample scripts which cover a number of topics.
Here's a list of the current categories
Posted Sunday, February 06, 2005 8:14 PM by dthomson | with no comments
Posted Sunday, February 06, 2005 6:21 PM by dthomson | with no comments
We all know that the TechNet Script Center is loaded with sample VBScripts, but were you aware that there are also a number of sample scripts written in Perl, Python, JScript, Kixtart, and Object REXX? The Scripting Guys put together a quick FAQ in case anyone has questions on these alternate languages.
One thing I found nice while perusing the scripts listed under these other languages, is that there is a master index for each language. This master index lists the available items sorted out into various categories. I would like to see a similar index created for the VScript samples too.
Posted Sunday, February 06, 2005 6:16 PM by dthomson | with no comments
Did you know the TechNet Script Center has sample scripts for working with Microsoft Office?
Excel
Add Data to a Spreadsheet CellAdd Formatted Data to a SpreadsheetCreate User Accounts Based on Information in a SpreadsheetFormat a Range of CellsList Active Directory Data in a SpreadsheetList Excel Color ValuesList Service Data in a SpreadsheetOpen an Excel SpreadsheetRead an Excel Spreadsheet
Word
Add a Formatted Table to a Word DocumentAdd a Table to a Word DocumentAdd Formatted Text to a Word DocumentAppend Text to a Word DocumentApply a Style to a Table in a Word DocumentCreate a New Word DocumentCreate and Save a Word DocumentDisplay Service Information in a Word DocumentList Microsoft Word PropertiesModify Bookmark Text in a Word DocumentOpen and Print a Word DocumentRead a Bookmark in a Word DocumentUse Word to Search for Files
Posted Sunday, February 06, 2005 5:36 PM by dthomson | with no comments
Following is a list of the scripts which the Scripting Guys have posted to their Scripting Guys Webcasts website. These scripts were referenced during their various webcasts.
Scripts listed in the NICs, ACKs & Network Stacks section
dhcp-renewlease.txtdhcp-renewlease.vbsdhcpsettings.txtdhcpsettings.vbsdnssettings.txtdnssettings.vbsgetip.txtgetip.vbsgetip-multi.txtgetip-multi.vbsgetmacip-netconn.txtgetmacip-netconn-assoc.txtgetncmacip.txtgetncmacip.vbsgetncmacip-assoc.txtgetncmacip-assoc.vbsipsettings.txtipsettings.vbsnic-acks-stacks-urls.txtnics-acks-stacks-directorscut.zipscripts.zipsetipcm.txtsetipcm.vbs
Scripts listed in the Documents section
adsi.zipcreating_htas.zipdatabase_webcast.zipdatabases.ziphelpomatic.zipScriptingXPSP2.zipsearching_ad_scripts.zip
Posted Sunday, February 06, 2005 11:25 AM by dthomson | with no comments
Question:
I was hoping to get pointed at a tool or something that already exists. We have a Ghost image which puts the user's profile on the D: drive so that we can reimage the C drive with little impact to user data. Once the box is imaged and the user logs back on it creates a new profile. I can copy data from the old profile into the new after they log in. I was wondering if I could import their user.dat data as well? I haven't put a whole lot of thought into this and I would think it might be a simple process. If you could help point me in the correct direction, that would be very helpful.
Suggested answer:
I would suggest using the USMT (User State Migration Tool). This would copy files and settings. You could do it once to capture everything, then a second time to put it all back. Here are a couple of good links:http://www.microsoft.com/downloads/details.aspx?familyid=4af2d2c9-f16c-4c52-a203-8daf944dd555&displaylang=en http://www.microsoft.com/windowsxp/using/setup/expert/russel_november19.mspx I think that will do what you are looking for.
I would suggest using the USMT (User State Migration Tool). This would copy files and settings. You could do it once to capture everything, then a second time to put it all back. Here are a couple of good links:http://www.microsoft.com/downloads/details.aspx?familyid=4af2d2c9-f16c-4c52-a203-8daf944dd555&displaylang=en http://www.microsoft.com/windowsxp/using/setup/expert/russel_november19.mspx
I think that will do what you are looking for.
Posted Thursday, February 03, 2005 10:01 AM by dthomson | with no comments
What is the good commandline to patch an administrative installation?I have to apply the Sp3 to Access 2000 Runtime and I am not sure about the way to apply the SP to the sources.
http://support.microsoft.com/default.aspx?scid=kb;en-us;314881 Try using:msiexec.exe /p {Path to MSP patch file} /a {Path to MSI to be patched}
Posted Thursday, February 03, 2005 9:57 AM by dthomson | 1 comment(s)
I know how to do this with an integer variable, but I don't know how to do it with a string variable...How can a batch script call a VB script, and have the VB script return the value of a string variable to the same batch script that called the VB script?I need the necessary statements in both VBS and batch scripting.
Basically having the vbs write out a set variable=something line to another batch file and then when focus returns back to the batch, the batch will execute that file and thus set the variable. Scenario: Batch calls vbsVbs writes out set variable=something to getvariable.batVbs exitsBatch calls getvariable.batThe variable should now be available in the original batch.
Basically having the vbs write out a set variable=something line to another batch file and then when focus returns back to the batch, the batch will execute that file and thus set the variable.
Scenario:
Batch calls vbsVbs writes out set variable=something to getvariable.batVbs exitsBatch calls getvariable.batThe variable should now be available in the original batch.
Posted Thursday, February 03, 2005 9:54 AM by dthomson | with no comments
I remember a while back that a few scripts were posted either here or on the SMS mailing list. One nice script was posted by Richard Threlkeld. I cannot find them now. Can someone post a sample on how to read xml files from within vb script? Much appreciated
I remember a while back that a few scripts were posted either here or on the SMS mailing list. One nice script was posted by Richard Threlkeld. I cannot find them now. Can someone post a sample on how to read xml files from within vb script?
Much appreciated
This should also help: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=252876a9.0106280634.a199733%40posting.google.com&rnum=94&prev=/groups%3Fq%3Dparse%2BXML%2BVBScript%26start%3D90%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D252876a9.0106280634.a19973 http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=ObptZWPWCHA.3476%40tkmsftngp08&rnum=122&prev=/groups%3Fq%3Dparse%2BXML%2BVBScript%26start%3D120%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3DObptZWPWCHA.3476%2540tkmsftngp08%26rnum%3D You'll also find a lot of really helpful stuff in the XML SDK. UPDATE (2/3/2005) Richard Threlkeld sent this to me. Hope it makes life a bit easier for those working on this type of project. Thanks Richard! Sample XML File: <?xml version="1.0" ?><labinfo> <aa210> 172.17.23.129 172.17.24.193 172.17.25.129 172.17.26.65 192.168.18.1 192.168.19.1 </aa210> <aa217g> 192.168.201.1 172.17.24.1 </aa217g></labinfo> Sample VBScript: Option Explicit Dim lab,xmlDoc, root, objNodeList, i, strFailure, objQNumber, Attribute lab = "aa210" 'instatiate the XML objectSet xmlDoc = CreateObject("Microsoft.XMLDOM") 'Set to synchronous loadingxmlDoc.async = False 'Load the XML datastore.xmlDoc.load("qctlabs.xml") Set root = xmlDoc.documentElement 'Grab Node information Set objNodeList = xmlDoc.getElementsByTagName(lab) For i = 0 To (objNodeList.length - 1) If xmlDoc.parseError.errorCode <> 0 Then ' the parse failed - take some corrective action strFailure = "Error parsing file" WScript.Echo(strFailure) Else objQNumber = objNodeList.Item(i).text WScript.Echo(objQNumber) End IF NextWScript.Quit
This should also help: http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=252876a9.0106280634.a199733%40posting.google.com&rnum=94&prev=/groups%3Fq%3Dparse%2BXML%2BVBScript%26start%3D90%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3D252876a9.0106280634.a19973 http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=ObptZWPWCHA.3476%40tkmsftngp08&rnum=122&prev=/groups%3Fq%3Dparse%2BXML%2BVBScript%26start%3D120%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3DObptZWPWCHA.3476%2540tkmsftngp08%26rnum%3D You'll also find a lot of really helpful stuff in the XML SDK.
UPDATE (2/3/2005)
Richard Threlkeld sent this to me. Hope it makes life a bit easier for those working on this type of project. Thanks Richard!
Sample XML File:
<?xml version="1.0" ?><labinfo> <aa210> 172.17.23.129 172.17.24.193 172.17.25.129 172.17.26.65 192.168.18.1 192.168.19.1 </aa210> <aa217g> 192.168.201.1 172.17.24.1 </aa217g></labinfo>
Sample VBScript:
Option Explicit
Dim lab,xmlDoc, root, objNodeList, i, strFailure, objQNumber, Attribute
lab = "aa210" 'instatiate the XML objectSet xmlDoc = CreateObject("Microsoft.XMLDOM")
'Set to synchronous loadingxmlDoc.async = False
'Load the XML datastore.xmlDoc.load("qctlabs.xml")
Set root = xmlDoc.documentElement
'Grab Node information Set objNodeList = xmlDoc.getElementsByTagName(lab)
For i = 0 To (objNodeList.length - 1)
If xmlDoc.parseError.errorCode <> 0 Then ' the parse failed - take some corrective action strFailure = "Error parsing file" WScript.Echo(strFailure) Else objQNumber = objNodeList.Item(i).text WScript.Echo(objQNumber) End IF NextWScript.Quit
Posted Wednesday, February 02, 2005 8:26 PM by dthomson | with no comments