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

Grant-ISHUserLogOnAsService improve performance in containers #23

Closed
Sarafian opened this issue Mar 21, 2017 · 1 comment
Closed

Grant-ISHUserLogOnAsService improve performance in containers #23

Sarafian opened this issue Mar 21, 2017 · 1 comment

Comments

@Sarafian
Copy link
Collaborator

Sarafian commented Mar 21, 2017

Grant-ISHUserLogOnAsService gets seriously stack when executing within a container. It takes up to 10 minutes to execute. There are two options:

NTRights.exe - Option 1
The faster alternative by a margin (less than 1sec) is ntrights.exe included in Windows Server 2003 Resource Kit Tools
.

The toolkit is not supported officially for higher versions but ntrights.exe seems to do the job well for what ISHServer is interested in.

PoshPrivilege - Option 2
PoshPrivilege seems to be a very fast replacement. When tested inside a container with this script it worked very fast

& C:\GitHub\ISHBootstrap\Source\Server\PackageManagement\Install-NugetPackageProvider.ps1
Write-Host "Initialized NugetPackageProvider"
if(-not (Get-Module -Name PoshPrivilege -ListAvailable))
{
    Install-Module -Name PoshPrivilege -Force -Scope CurrentUser
    Write-Host "Installed PoshPrivilege"
}


$password="Password123"
$username="Alex"
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force

Remove-LocalUser -Name $username -Confirm:$false -ErrorAction SilentlyContinue
Write-Host "$username removed"

New-LocalUser -Name $username -Password $securePassword
Write-Host "$username created"

$accountName=$env:COMPUTERNAME+"\"+$username
Write-Host "accountName=$accountName"

Add-Privilege -AccountName $accountName -Privilege SeServiceLogonRight
@Sarafian
Copy link
Collaborator Author

Sarafian commented Apr 6, 2017

PoshService works and since it has become a requirement by issue RWS/ISHBootstrap#54 it will be a pre-requisite. It also solves GH-25

Sarafian added a commit that referenced this issue Apr 6, 2017
Sarafian added a commit that referenced this issue Apr 6, 2017
@Sarafian Sarafian self-assigned this Apr 6, 2017
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

1 participant