Skip to content

Instantly share code, notes, and snippets.

@Hashbrown777
Created June 19, 2023 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hashbrown777/89ca1f415d766a13bfe3a979890deb4b to your computer and use it in GitHub Desktop.
Save Hashbrown777/89ca1f415d766a13bfe3a979890deb4b to your computer and use it in GitHub Desktop.
After extracting the needed files, get `New-NetLbfoTeam` working in win10
try {
Switch ($args[0]) {
#entrypoint
$NULL {
if (!(Start-Process `
-FilePath 'PsExec' `
-ArgumentList (
'-s',
'-nobanner',
'-accepteula',
'powershell',
"-File `"$($MyInvocation.MyCommand.Source)`" `"nt authority\system`""
) `
-Verb RunAs `
-Wait `
-PassThru
).ExitCode) {
'A window will open'
"Go to an adapter's properties, install, a service, microsoft's, load balancing/failover"
'You may need to "Have Disk"->"System32\DriverStore\FileRepository\mslbfoprovider.inf*\'
Pause
ncpa
'You should be able to use `New-NetLbfoTeam` now'
}
}
#we are the correct user
(whoami) {
$dir = (Get-Item $MyInvocation.MyCommand.Source).Directory.FullName
Copy-Item `
-Recurse `
"$dir\System32\*" `
-Destination $PWD.ProviderPath `
-ErrorAction SilentlyContinue
reg LOAD 'HKLM\DRIVERS' 'config\DRIVERS'
Get-Item "$dir\*.reg" `
| %{
reg import $_.FullName
if (!$?) {
throw "Failed to import $($_.Name)"
}
}
$err = $False
&"$dir\sigcheck64" `
-accepteula `
-nobanner `
"$env:DriverData\..\mslbfoprovider.sys" `
| Select-String -Context 50 '(Un|)Signed' `
| %{
$_
if ($_.Matches.Value -eq 'Unsigned') {
$err = $True
}
}
if ($err) {
throw 'Unsigned'
}
'Press enter to exit'
Pause
}
#we are not the correct user
Default {
throw (whoami)
}
}
}
catch {
$_ | Write-Error
'Press enter to exit'
Pause
exit 1
}
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\DRIVERS\DriverDatabase\DeviceIds\ms_lbfo]
"mslbfoprovider.inf"=hex:01,ff,00,00
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\DRIVERS\DriverDatabase\DriverInfFiles\mslbfoprovider.inf]
@=hex(7):6d,00,73,00,6c,00,62,00,66,00,6f,00,70,00,72,00,6f,00,76,00,69,00,64,\
00,65,00,72,00,2e,00,69,00,6e,00,66,00,5f,00,61,00,6d,00,64,00,36,00,34,00,\
5f,00,66,00,39,00,64,00,32,00,37,00,61,00,36,00,62,00,30,00,35,00,65,00,66,\
00,32,00,31,00,61,00,61,00,00,00,00,00
"Active"="mslbfoprovider.inf_amd64_f9d27a6b05ef21aa"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\DRIVERS\DriverDatabase\DriverPackages\mslbfoprovider.inf_amd64_f9d27a6b05ef21aa]
"Version"=hex:ff,ff,09,00,00,00,00,00,74,e9,36,4d,25,e3,ce,11,bf,c1,08,00,2b,\
e1,03,18,00,80,8c,a3,c5,94,c6,01,01,00,7c,4f,00,00,0a,00,00,00,00,00,00,00,\
00,00
"Provider"="Microsoft"
"SignerScore"=dword:0d000003
"FileSize"=hex(b):aa,0c,00,00,00,00,00,00
@="mslbfoprovider.inf"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\System\MsLbfoProvider]
"ProviderGuid"=hex(2):7b,00,33,00,38,00,37,00,65,00,64,00,34,00,36,00,33,00,2d,\
00,38,00,62,00,31,00,62,00,2d,00,34,00,32,00,63,00,39,00,2d,00,39,00,65,00,\
66,00,30,00,2d,00,38,00,30,00,33,00,66,00,64,00,66,00,64,00,35,00,64,00,39,\
00,34,00,65,00,7d,00,00,00
$mount = $NULL
&'.\WindowsServer2022x64.iso'
while (!$mount) {
$mount = `
[System.IO.DriveInfo]::GetDrives() `
| %{ if ($_.VolumeLabel -eq 'SSS_X64FRE_EN-US_DV9') { $_.Name } }
}
$root = '4\Windows\System32'
$files = @{
package = (
'CatRoot\*\Microsoft-Windows-Server-Features-Package015~*~amd64~~*.cat',
'drivers\mslbfoprovider.sys'
)
merged = (
'CatRoot\*\Microsoft-Windows-ServerCore-Drivers-merged-Package~*~amd64~~*.cat',
'DriverStore\FileRepository\mslbfoprovider.inf_amd64_*\mslbfoprovider.inf'
)
0 = 'drivers\en-US\mslbfoprovider.sys.mui'
1 = 'DriverStore\en-US\MsLbfoProvider.inf_loc'
}
&'C:\Program Files\7-Zip\7z' `
x `
"$mount\sources\install.wim" `
($files.Values | %{ $_ } | %{ "$root\$_" })
Move-Item $root -Destination '.'
Remove-Item -Recurse '4'
$files.package,$files.merged `
| %{
&'.\sigcheck64' -accepteula -nobanner -f ($_ | %{ Get-Item "System32\$_" })
} `
| Select-String -Context 50 '(Un|)Signed'
(New-Object -ComObject Shell.Application).Namespace(17).ParseName($mount).InvokeVerb('Eject')
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4d36e974-e325-11ce-bfc1-08002be10318}\{FC66A602-B769-4666-A540-CA3DF0E7DF2C}]
"InstallTimeStamp"=hex:e4,07,05,00,01,00,12,00,12,00,1a,00,31,00,80,03
"Characteristics"=dword:00040000
"ComponentId"="ms_lbfo"
"Description"="@mslbfoprovider.inf,%lbfo_desc%;Microsoft Load Balancing/Failover Provider"
"InfPath"="mslbfoprovider.inf"
"InfSection"="Install"
"LocDescription"="@mslbfoprovider.inf,%lbfo_desc%;Microsoft Load Balancing/Failover Provider"
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4d36e974-e325-11ce-bfc1-08002be10318}\{FC66A602-B769-4666-A540-CA3DF0E7DF2C}\Ndi]
"TimeStamp"=hex:e4,07,05,00,01,00,12,00,12,00,1a,00,31,00,80,03
"HelpText"="@%SystemRoot%\\System32\\drivers\\MsLbfoProvider.sys,-500"
"Service"="MsLbfoProvider"
"CoServices"=hex(7):4d,00,73,00,4c,00,62,00,66,00,6f,00,50,00,72,00,6f,00,76,\
00,69,00,64,00,65,00,72,00,00,00,00,00
"FilterClass"="ms_implatform"
"FilterType"=dword:00000002
"FilterRunType"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Network\{4d36e974-e325-11ce-bfc1-08002be10318}\{FC66A602-B769-4666-A540-CA3DF0E7DF2C}\Ndi\Interfaces]
"LowerRange"="nolower"
"UpperRange"="noupper"
"FilterMediaTypes"="ms_implatform"
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MsLbfoProvider]
"Description"="@%SystemRoot%\\System32\\drivers\\MsLbfoProvider.sys,-501"
"DisplayName"="@%SystemRoot%\\System32\\drivers\\MsLbfoProvider.sys,-501"
"ErrorControl"=dword:00000001
"Group"="NDIS"
"ImagePath"=hex(2):53,00,79,00,73,00,74,00,65,00,6d,00,33,00,32,00,5c,00,64,00,\
72,00,69,00,76,00,65,00,72,00,73,00,5c,00,4d,00,73,00,4c,00,62,00,66,00,6f,\
00,50,00,72,00,6f,00,76,00,69,00,64,00,65,00,72,00,2e,00,73,00,79,00,73,00,\
00,00
"Start"=dword:00000001
"Type"=dword:00000001
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MsLbfoProvider\Parameters]
@Hashbrown777
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment