Update a network driver through GPO/AD

11,478

Solution 1

Got it scripted, thanks for your input guys.

xcopy "\\fileserver\share$\I217" "C:\I217\"
%SystemRoot%\System32\InfDefaultInstall.exe C:\I217\e1d64x64.inf

Solution 2

I realize you have already figured it out with a similar command, but just as an FYI you can also use the pnputil command to do what you need. Just copy the driver files (.inf, .sys, .cat) into some folder on the system (with a script doing xcopy or Group Policy preferences), and run the following command:

pnputil -i -a "C:\folder\driver.inf"

Note that you want to run the command elevated (e.g. in a Computer Startup script, not a User Logon script).

I have used pnputil in a PowerShell script to iterate through a folder tree and load all of the drivers contained within. This is really handy with a Microsoft Surface, where the drivers are distributed in a single ZIP file.

$ScriptPath = "C:\SurfacePro2_Drivers"
$files = get-childitem -path $Scriptpath -recurse -filter *.inf
foreach ($file in $files)
{
    Write-host "Injecting driver $file"
    pnputil -i -a $file.FullName
}

Solution 3

I know this may be a little late at this point, but you may want to precede your login script with something like:

if exists "C:\I217\e1d64x64.inf" goto :EXIT
xcopy "\\fileserver\share$\I217" "C:\I217\"
%SystemRoot%\System32\InfDefaultInstall.exe C:\I217\e1d64x64.inf  
REM Complete script
:EXIT
exit

That way, you'll only technically run the copy command once. Saving your network resources from extra work. :)

Share:
11,478

Related videos on Youtube

Justin
Author by

Justin

Updated on September 18, 2022

Comments

  • Justin
    Justin over 1 year

    Our organization has just deployed new computers with Windows 8.1. Roughly 50 of them. We've run into an issue with the driver on the new computers which is flooding the network with ipv6/multicast chatter. Acording to this article, disabling ipv6 does not fix the issue.

    I'm looking for a script or GPO to deploy out the patched driver that is supposed to deal with this issue.

    • Nathan C
      Nathan C almost 10 years
      GPO can only deploy .msi installers...which I doubt your driver is. Do you have any other software management (SCCM, etc)? Alternatively, you can make it run a .bat file that executes the installer at logon time.
    • Justin
      Justin almost 10 years
      We've got Dell KACE. Just an INF and accompanying files.
    • Brad Bouchard
      Brad Bouchard almost 10 years
      Depending on what type of driver package you have (i.e. Can it be installed like an exe or MSI or other installable) you could use a simple login script that opens a batch file which has a single line of code that points to the installable somewhere on a shared drive. If you're interested in this let me know and I'll answer with a script for you.
    • Nathan C
      Nathan C almost 10 years
      @BradBouchard He mentioned it's not an installer. In this case, you'd want to package the driver in order to use remote installers with dpinst. Otherwise, you may have to use your IT minions. ;)
    • Justin
      Justin almost 10 years
      If you've got a script I would be eternally grateful :)
    • Brad Bouchard
      Brad Bouchard almost 10 years
      I hadn't seen your comment before I posted mine. If it's just an INF you've got then it wouldn't be nearly as easy. Sorry, but Nathan's right, you'll have to do some footwork or get some interns to go change it.
  • Justin
    Justin almost 10 years
    I did find this command, however I found that the infdefaultinstall updated the driver on the device immediately, where pnputil did not.
  • Justin
    Justin almost 10 years
    Yeah, I did end up implementing a log off script similar to this one.