Need some help : working on a script to measure GP performance

Welcome Forums General PowerShell Q&A Need some help : working on a script to measure GP performance

This topic contains 2 replies, has 2 voices, and was last updated by

 
Keymaster
1 year, 3 months ago.

  • Author
    Posts
  • #78326
    Del

    Participant
    Points: 0
    Rank: Member

    I am working on a script to measure the GPO's login duration using Event Log (5061)

    $events = get-winevent -FilterHashTable @{LogName="Microsoft-Windows-GroupPolicy/Operational";ID=5016}
    Foreach($event in $events){ .... }

    I need to loop through each ID and get each GPO duration and then the total value for all.
    Please Help

  • #78338

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    I'm not sure how the event is formatted – does the event data contain a duration?

  • #78340

    Keymaster
    Points: 1,704
    Helping HandTeam Member
    Rank: Community Hero

    I think you might need to get both Events 4016 and 5016 show the start and end of processing of groups of policies, including how long it took to apply each one in the end event. You'd get a DateWritten for each, and you'd need to calculate the difference. Unless 5016 does in fact have a duration, which you'd need to extract somehow.

    But, if you get the duration, and you emit that as an object:

    [pscustomobject]@{Duration=$whatever}

    Then you can pipe your ForEach to Measure-Object and ask it to -Sum the -Property Duration for you.

The topic ‘Need some help : working on a script to measure GP performance’ is closed to new replies.