Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: Remove ActiveSetup StubPath #373

Open
matthias-schlimm opened this issue Feb 8, 2023 · 2 comments
Open

[Feature request]: Remove ActiveSetup StubPath #373

matthias-schlimm opened this issue Feb 8, 2023 · 2 comments

Comments

@matthias-schlimm
Copy link
Collaborator

matthias-schlimm commented Feb 8, 2023

Is your feature request related to a problem? Please describe.

User logon duration increased with ActiveSetup StubPath entries

Describe the solution you'd like

Remove Active Setup StubPath to boost the logon performance as described here https://james-rankin.com/features/the-ultimate-guide-to-windows-logon-time-optimizations-part-7/

Describe alternatives you've considered

Use Powershell instead of batch, snippset below is not BIS-F ready but it works too

clear-host
$Repath = @("HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components","HKLM:\SOFTWARE\WOW6432Node\Microsoft\Active Setup\Installed Components")

ForEach ($Path in $Repath) {
    Write-Host "- - - Processing $Path - - -" -ForegroundColor White 
    get-childitem $Path -Recurse -ErrorAction SilentlyContinue | 
        where-object {
            if ((Get-ItemProperty -Path $_.PsPath) -match "StubPath") {$_.PsPath}
                $test = (Get-ItemProperty  $_.PsPath).PSObject.Properties.Name -contains "StubPath"
                IF ($test -eq $true) {
                    Write-Host "Remove Stubpath in $($_.PsPath)" -ForegroundColor Green
                    Remove-ItemProperty $_.PsPath -Name "StubPath"
                } else {
                    Write-Host "Stubpath in $($_.PsPath) doesn't exist" -ForegroundColor Yellow
                }

           }
 }

Screenshots

No response

Additional context

No response

@matthias-schlimm
Copy link
Collaborator Author

Here is a BIS-F Custom Script for it
copy it to the folder C:\Program Files (x86)\Base Image Script Framework (BIS-F)\Framework\Subcall\Preparation\Custom

20_PrepBISF_ActiveSetup.txt

@BalintOberrauch
Copy link

I use the following script as a custom script:

Write-Host "Querying and deleting 32bit STUB paths..."
$path = "HKLM:\Software\Microsoft\Active Setup\Installed Components"

$keys = Get-ChildItem $path -Recurse | Where-Object { $_.Property -eq 'STUBPATH' }

foreach ($key in $keys) {
Write-Host "Deleting STUBPATH from $key"
Remove-ItemProperty -Path $key.PSPath -Name 'STUBPATH' -ErrorAction SilentlyContinue -Verbose
}

Write-Host "Querying and deleting 64bit STUB paths..."
$path = "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Active Setup\Installed Components"

$keys = Get-ChildItem $path -Recurse | Where-Object { $_.Property -eq 'STUBPATH' }

foreach ($key in $keys) {
Write-Host "Deleting STUBPATH from $key"
Remove-ItemProperty -Path $key.PSPath -Name 'STUBPATH' -ErrorAction SilentlyContinue -Verbose
}

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

No branches or pull requests

2 participants