PowerShell slow for normal user

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 1 year, 11 months ago.

  • Author
    Posts
  • #28179
    Profile photo of Rene Falkenberg
    Rene Falkenberg
    Participant

    Does anyone have an idea to what could impact the performance of PS when it's run as a normal user VS when running as local admin?

    Normal User Account
    measure-command {Invoke-Command localhost {Get-ChildItem c:\}}

    Days : 0
    Hours : 0
    Minutes : 1
    Seconds : 30
    Milliseconds : 582
    Ticks : 905821714
    TotalDays : 0.00104840476157407
    TotalHours : 0.0251617142777778
    TotalMinutes : 1.50970285666667
    TotalSeconds : 90.5821714
    TotalMilliseconds : 90582.1714

    User in the local Admins group
    measure-command {Invoke-Command localhost {Get-ChildItem c:\}}

    Days : 0
    Hours : 0
    Minutes : 0
    Seconds : 0
    Milliseconds : 664
    Ticks : 6646582
    TotalDays : 7.69280324074074E-06
    TotalHours : 0.000184627277777778
    TotalMinutes : 0.0110776366666667
    TotalSeconds : 0.6646582
    TotalMilliseconds : 664.6582

  • #28186
    Profile photo of Don Jones
    Don Jones
    Keymaster

    At a guess, it's probably some additional authentication overhead since they're coming in without the Administrator token on their credential. You'd need to also measure the command INSIDE the script block to see if IT runs the same speed, which would tell us if Invoke-Command is adding the time.

You must be logged in to reply to this topic.