Automatic BITS 2.5 installation for SCCM 2012 on Windows Server 2003

It seems the SCCM 2012 client will no longer install BITS 2.5 automatically. I’ve put this vbscript together to allow you to force BITS 2.5 onto Windows Server 2003 x86 or x64 without requiring multiple reboots/logons. If you don’t have an existing deployment infrastructure this eliminates a lot of extra work.

You will need to place this script in a folder, the client files in a source subfolder, and the BITS 2.5 hotfixes and a copy of pskill.exe in the bits25 subfolder. Modify the ccmsetup line of the script to suit your infrastructure.

This was written as a quick and dirty solution. It isn’t elegant but it works.

The script performs the following actions:

1. Install the correct BITS 2.5 patch depending on the platform.
2. Launch the BITS service if it isn’t running.
3. Use tasklist /svc output to identify the PID of the netsvc.exe instance BITS is running under.
4. Kill that instance of netsvc.exe. I had to use pskill because WMI wasn’t cutting it.
5. Update the required .dll files.
6. Restart BITS. SCCM will now recognize BITS 2.5 as being installed.
7. Execute ccmsetup.exe to complete the SCCM 2012 client installation.


20 Responses to “Automatic BITS 2.5 installation for SCCM 2012 on Windows Server 2003”

  1. aXcelio Says:

    to whom it may concern,

    i know absolutely nothing about scripting….and am a little confused around how this process would work….would you be so kind as to provide me with a step by step on using your script and where certain files and folders should be placed?

  2. Mikkel Says:

    This solution will kill the “Server” (lanmanserver) service, and this service can not be restarted manually. So then using this be aware that your server will not be able to share any files or printers until restarted.
    Unless I am missing something… ?

    lanmanserver is in the name netsvc.exe process as BITS.

  3. jtcheah Says:

    Great script. But I did notice that when you kill the BITS service it also takes out the Server and Workstation services, which is highly undesirable. I have appended net start commands to restart both services as well, otherwise this saves us a reboot.

    • ruhle Says:

      Good point. I actually have a newer version of the script that automatically records all the services running under the BITS’ netsvc.exe context that gets terminated and then restarts all those as well. I will post ASAP once I get a chance to clean it up.

      • Mikkel Says:

        You cannot start the “Server” (lanmanserver) with net start or manually in services.msc.
        Access denied in both cases.

        I have tried both in the context of an account in local administrators and in the context of local system (psexec -s net start lanmanserver).
        Access denied in all cases.

        I do not think you can start the “Server” service in any way once it has been killed.

        Tried to work out a solution to this for days.
        Let me know if some of you have some other insight.

  4. ruhle Says:

    IIRC lanmanserver is dependent on another service. The new version handles dependency nesting up to 3 levels deep so it is able to start it properly.

  5. ruhle Says:

    The new version that properly restarts the services is now available.

  6. Mikkel Says:

    Tried the new script on a couple of servers. It still leaves “Server” (lanmanserver) and “Computer Browser” (browser) services in stopped state. And I am still unable to start these manually.
    The /forcereboot switch on ccmsetup ofcause rebooted the system, and then everything worked. But we still had to reboot so this was not really any different than just running ccmsetup followed by BITS installation and then reboot. 😦
    Still stuck with 250+ servers needing to be rebotted because they are missing bits 2.5. Now I have the choice of installing client and leaving them with Server service stopped. Or installing bits with /noreboot option and then installing client and waiting for servers to be restarted so client install will complete. 😦

  7. Scott Says:

    I might be stupid, but I can’t figure out how to auto deploy this script without an existing deployment infrastructure. I can connect to a machine and run it manually, but that doesn’t help me get BITS deployed automatically.

    • ruhle Says:

      There’s actually a number of viable options here that I don’t have the time to go into. psexec is one we used extensively, but you could also use GPOs, a legacy systems management infrastructure, etc.

  8. Russ Says:

    Just curious if you’ve tried using psexec to push bits and then stop/start the bits service to prevent needing a reboot

    • ruhle Says:

      Yes, we would typically do large batches of servers w/ psexec, monitor what became active in the console, and then remediate the inevitable small % of servers that had issues preventing one or more prereqs or the client to install.

  9. ScriptCoder Says:

    You never define “ScriptDir” or “TempFolder and such. These are not keywords in vbscript, they mean nothing.

  10. Russ Says:

    You can actually use ConfigMgr 2012 to install the 2012 client using the /skippreq switch to not install BITS, then deploy BITS with ConfigMgr to the clients (they will use SMB for this first package) and then have BITS from then on.

    • Greg Says:

      Have you verified that the /skipreq switch works for BITs 2.5? I was under the impression that this switch was only for prereq’s that were in stalled by the client installation itself, so something like BITs 2.5 that is required prior to even initiatiing the client install would seem to not be applicable to the /skippreq switch. I’m hoping I am wrong, because this would be ideal for me. Any help in verifying this would be appreciated.

  11. g00ner73 Says:

    The syntax of the command line switch is /skipprereq:bits

    You can set this in the SCCM 2012 SP1 Console in “Administration\Sites\Client Installation Settings\Client Push Installation\Installation Properties”

  12. romulus15 Says:

    Just have to post that /skippreq switch does not exist and will not allow the client to deploy without BITS installed. Also, use caution when using the script on DC’s. The script worked in a few instances, and even on a few DC’s, on others, the Server service didn’t restart and therefore required a reboot of the DC.

  13. Preparing a Windows Server 2003 R2 system to be a System Center Configuration Manager 2012 Distribution Point | Phil's Tech Blog Says:

    […] SCCM client and used this for the BITS installation.  You can find the original blog post here at Ruhle’s Blog.  You’ll want to remove lines 135-151 to remove the SCCM client install.  This script […]

  14. Evgen Says:

    Thanks,great job!!!
    Need to edit script in line 254:
    BAD – If strVersion < 6.7 Then
    WRIGHT – If strVersion < "6.7" Then

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: