Well, can't upload the modified VBS..so is bits25mif.vbs file inline. Use this with the free bits detection tool MOF to detect bits 2.5 clients (Windows XP) in your environment.
'=========================================================================='' VBScript Source File -- '' NAME: BITS2MIF.vbs'' AUTHOR: Tim Mintner' Company: SMSUtils' For support information contact support@smsutils.com' DATE : 5/10/2005'' COMMENT: This reads the current BITS settings and creates a MIF file with' all of the BITS settings' Usage: cscript.exe bits2mif.vbs /kick(optional forces a Hardware Inventory)'==========================================================================
Option ExplicitOn Error Resume Next
Dim objFSO, WshShell, objNetDim strQuoteDim blnCreateMIFDim objMIF, strMIFFileName, strNoidmifsFolderDim strComputerName, strUserName, strWinDirDim intErrNum, strErrDescDim strBITSregpath,strEnableBitsMaxBandwidth,strMaxBandwidthValidFrom,strMaxBandwidthValidtoDim strMaxTransferRateoffScheduleValue,strMaxTransferRateonscheduleValueDim strEnableBitsMaxBandwidthValue,strMaxBandwidthValidFromValue,strMaxBandwidthValidtoValueDim strMaxTransferRateoffSchedule,strMaxTransferRateonscheduleDim strWindowsNTCurrentVersionPath,strCSDVersion, strCSDVersionRegValueDim strBitsHotfixRegPath, strBITSHotfixRegValue,strBitsHotfixInstalled, strKickDim cpapplet,actions,actionDim blnRegDim strKeyPath, strValueName, strRegValue
Const ForReading = 1, ForWriting = 2strQuote = Chr(34)blnCreateMIF = False
Set objFSO = CreateObject("Scripting.FileSystemObject")Set WshShell = WScript.CreateObject("WScript.Shell")Set objNet = WScript.CreateObject("WScript.Network")
strComputerName = objNet.ComputerName
strWindowsNTCurrentVersionPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion"strCSDVersionRegValue = "CSDVersion"strBitsHotfixRegPath = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Hotfix\KB923845"strBITSHotfixRegValue = "Installed"
blnReg = GetReg(strWindowsNTCurrentVersionPath,strCSDVersionRegValue)
If strRegValue = "Service Pack 2" Then strCSDVersion = strRegValue
blnReg = GetReg(strBitsHotfixRegPath,strBITSHotfixRegValue) If strRegValue = "0" or strRegValue = "" Then strBitsHotfixInstalled = "False" Else Call GetBitsValues strBitsHotfixInstalled = "True" End if Else strCSDVersion = strRegValueIF strCSDVersion = "Service Pack 3" Then strBitsHotfixInstalled = "True"Else strBitsHotfixInstalled = "NA" End ifCall GetBITSValuesEnd If
strNoidmifsFolder = objFSO.GetSpecialFolder(0) & "\SYSTEM32\CCM\Inventory\noidmifs"strMIFFileName = strNoidmifsFolder & "\BITS-" & strComputerName & ".mif"
Set objMIF = objFSO.CreateTextFile(strMIFFileName, True)Call CreateMif
strKick = WScript.Arguments.Item(0)If strKick = "/kick" Then Call ForceHardwareInventoryEnd if
WScript.Quit
'*************************************************************************************'*********************** END OF SCRIPT **********************************'*************************************************************************************
Sub GetBitsValuesstrBITSregpath = "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\BITS"strMaxTransferRateoffScheduleValue = "MaxTransferRateOffSchedule"strEnableBitsMaxBandwidthValue = "EnableBITSMaxBandwidth"strMaxBandwidthValidFromValue = "MaxBandwidthValidFrom"strMaxBandwidthValidtoValue = "MaxBandwidthValidTo"strMaxTransferRateonscheduleValue = "MaxTransferRateOnSchedule"
blnReg = GetReg(strBITSregpath,strMaxTransferRateoffScheduleValue)If blnReg = True Then strMaxTransferRateoffSchedule = strRegValueElse strMaxTransferRateoffSchedule = ""End If
blnReg = GetReg(strBITSregpath,strEnableBitsMaxBandwidthValue)If blnReg = True Then strEnableBitsMaxBandwidth = strRegValueElse strEnableBitsMaxBandwidth = ""End If
blnReg = GetReg(strBITSregpath,strMaxBandwidthValidFromValue)If blnReg = True Then strMaxBandwidthValidFrom = strRegValueElse strMaxBandwidthValidFrom = ""End If
blnReg = GetReg(strBITSregpath,strMaxBandwidthValidtoValue)If blnReg = True Then strMaxBandwidthValidto = strRegValueElse strMaxBandwidthValidto = ""End If
blnReg = GetReg(strBITSregpath,strMaxTransferRateonscheduleValue)If blnReg = True Then strMaxTransferRateonschedule = strRegValueElse strMaxTransferRateonschedule = ""End If
End Sub
Sub ForceHardwareInventorySet cpApplet = CreateObject("CPAPPLET.CPAppletMgr")Set actions = cpApplet.GetClientActionsFor Each action In actions If Instr(action.Name,"Hardware Inventory") > 0 Then ' WScript.Echo action.Name action.PerformAction End IfNextEnd Sub
Function GetReg(strKeyPath,strValueName)
GetReg = False strRegValue = "" On Error Resume Next strRegValue = WshShell.RegRead(strKeyPath & "\" & strValueName) If Err.Number <> 0 Then intErrNum = Err.Number strErrDesc = Err.Description On Error Goto 0 'WScript.Echo intErrNum & vbTab & strErrDesc Select Case Left(strErrDesc, 28) Case "Invalid root in registry key" 'On Error Goto 0 'wscript.echo "Key doesn't exist" WshShell.LogEvent 0, "Registry key not found - skipping MIF creation" Case "Unable to open registry key " 'On Error Goto 0 'WScript.Echo "Key exists-no value" WshShell.LogEvent 0, "Registry value not found - skipping MIF creation" Case Else 'On Error Goto 0 'WScript.Echo "unknown error" WshShell.LogEvent 0, "Unknown error getting registry value - skipping MIF creation" & _ VbCrLf & intErrNum & ": " & strErrDesc End Select Else GetReg = True End If On Error Goto 0
End Function
Sub CreateMif
'Create Component and objMIF.WriteLine("Start Component") objMIF.WriteLine(" Name = " & strQuote & "Workstation" & strQuote) objMIF.WriteLine(" Start Group") objMIF.WriteLine(" Name = " & strQuote & "BITS" & strQuote) objMIF.WriteLine(" ID = 1") objMIF.WriteLine(" Class = " & strQuote & "SMS Utils|BITS Settings" & strQuote)
objMIF.WriteLine(" Start Attribute") objMIF.WriteLine(" Name = " & strQuote & "ComputerName" & strQuote) objMIF.WriteLine(" ID = 1") objMIF.WriteLine(" Type = String(50)") objMIF.WriteLine(" Storage = Specific") objMIF.WriteLine(" Value = " & strQuote & strComputerName & strQuote) objMIF.WriteLine(" End Attribute") objMIF.WriteLine(" Start Attribute") objMIF.WriteLine(" Name = " & strQuote & "ServicePackLevel" & strQuote) objMIF.WriteLine(" ID = 2") objMIF.WriteLine(" Type = String(50)") objMIF.WriteLine(" Storage = Specific") objMIF.WriteLine(" Value = " & strQuote & strCSDVersion & strQuote) objMIF.WriteLine(" End Attribute") objMIF.WriteLine(" Start Attribute") objMIF.WriteLine(" Name = " & strQuote & "BITSPatchInstalled" & strQuote) objMIF.WriteLine(" ID = 3") objMIF.WriteLine(" Type = String(50)") objMIF.WriteLine(" Storage = Specific") objMIF.WriteLine(" Value = " & strQuote & strBitsHotfixInstalled & strQuote) objMIF.WriteLine(" End Attribute") objMIF.WriteLine(" Start Attribute") objMIF.WriteLine(" Name = " & strQuote & "BitsThrottlingEnabled" & strQuote) objMIF.WriteLine(" ID = 4") objMIF.WriteLine(" Type = String(50)") objMIF.WriteLine(" Storage = Specific") objMIF.WriteLine(" Value = " & strQuote & strEnableBitsMaxBandwidth & strQuote) objMIF.WriteLine(" End Attribute") objMIF.WriteLine(" Start Attribute") objMIF.WriteLine(" Name = " & strQuote & "ThrottleOnHoursStartTime" & strQuote) objMIF.WriteLine(" ID = 5") objMIF.WriteLine(" Type = String(50)") objMIF.WriteLine(" Storage = Specific") objMIF.WriteLine(" Value = " & strQuote & strMaxBandwidthValidFrom & strQuote) objMIF.WriteLine(" End Attribute") objMIF.WriteLine(" Start Attribute") objMIF.WriteLine(" Name = " & strQuote & "ThrottleOnHoursEndTime" & strQuote) objMIF.WriteLine(" ID = 6") objMIF.WriteLine(" Type = String(50)") objMIF.WriteLine(" Storage = Specific") objMIF.WriteLine(" Value = " & strQuote & strMaxBandwidthValidTo & strQuote) objMIF.WriteLine(" End Attribute") objMIF.WriteLine(" Start Attribute") objMIF.WriteLine(" Name = " & strQuote & "ThrottleSpeedOnHours" & strQuote) objMIF.WriteLine(" ID = 7") objMIF.WriteLine(" Type = String(50)") objMIF.WriteLine(" Storage = Specific") objMIF.WriteLine(" Value = " & strQuote & strMaxTransferRateonschedule & strQuote) objMIF.WriteLine(" End Attribute") objMIF.WriteLine(" Start Attribute") objMIF.WriteLine(" Name = " & strQuote & "ThrottleSpeedOffHours" & strQuote) objMIF.WriteLine(" ID = 8") objMIF.WriteLine(" Type = String(50)") objMIF.WriteLine(" Storage = Specific") objMIF.WriteLine(" Value = " & strQuote & strMaxTransferRateoffschedule & strQuote) objMIF.WriteLine(" End Attribute") objMIF.WriteLine(" End Group") objMIF.WriteLine("End Component")