locked
Improve command for getting moverequest statistics RRS feed

  • Question

  • Hello,

    im trying to save all moverequest informations (with includereport parameter) before i delete them (over 3k)

    $requests = Get-MoveRequest -ResultSize unlimited
    foreach ($request in $requests)
     {
      $username = ($request.distinguishedname -split ",*..=")[1]
      get-moverequeststatistics -identity $username -includereport |
       select * |
       out-file "c:\tmp\$($username).txt"
      }

    Problem is.. it exported correctly like 500 files and then i got error messages

    Starting a command on the remote server failed with the following error message : Error occurred during the Kerberos
    reponse.
    [Server=server1, TimeStamp = 1122/2018 12:15:25]
     For more information, see the about_Remote_Troubleshooting Help topic.
        + CategoryInfo          : OperationStopped: (server1.domain.com:String) [], PSRemotingTransportException
        + FullyQualifiedErrorId : JobFailure
        + PSComputerName        : server1.comain.com

    Rest of the files were created, but with zero length.

    What could couse this?  How to prevent it?  

    Thank you


    • Edited by Mekac Thursday, November 22, 2018 12:06 PM
    Thursday, November 22, 2018 12:06 PM

Answers

  • I added "start-sleep 1" to my loop. So far it exported 300+ moverequests and no red warning (yet)

    That indicates an issue with the remote.  I would post to support so they can look at that. 

    \_(ツ)_/

    • Marked as answer by Mekac Thursday, November 22, 2018 1:21 PM
    Thursday, November 22, 2018 1:12 PM

All replies

  • You have to add error control as network links can get disconnected or there can be net outages. 


    \_(ツ)_/

    Thursday, November 22, 2018 12:19 PM
  • so .. basically u saying  "improve the command with try/catch" .. if it fails try it again. (when export failed requests one by one, no problem at all) ..   

    Simple get-moverequest | get-moverequeststatistics   is fast on response,   when -includereport parameter is added, that is when all things are slowed down and I get like 1-2 reports / sec

    Its weird though, server is on 10Gbit optic fibre connected to SAN. 

    Thursday, November 22, 2018 12:26 PM
  • It appears that you session is timing out on long running requests. 


    \_(ツ)_/

    Thursday, November 22, 2018 12:29 PM
  • Set session options timeout?


    \_(ツ)_/

    Thursday, November 22, 2018 12:30 PM
  • get-Item -path WSMan:\localhost\Shell\IdleTimeout  ..  7200000  ..  2 hours ..  script failed after ~10 min.  Ive run scripts which took longer than that already

    If I don't resolve this, I will make some jobs, each contain around 200 requests and export/delete them one by one..

    Thursday, November 22, 2018 12:40 PM
  • I added "start-sleep 1" to my loop. So far it exported 300+ moverequests and no red warning (yet)
    Thursday, November 22, 2018 12:54 PM
  • That is the client.  The server can also timeout.  The idle time for the session is set to timeout after 3 minutes of no activity.

    New-PSSessionOption -MaxConnectionRetryCount 3


    \_(ツ)_/


    • Edited by jrv Thursday, November 22, 2018 1:15 PM
    Thursday, November 22, 2018 1:09 PM
  • I added "start-sleep 1" to my loop. So far it exported 300+ moverequests and no red warning (yet)

    That indicates an issue with the remote.  I would post to support so they can look at that. 

    \_(ツ)_/

    • Marked as answer by Mekac Thursday, November 22, 2018 1:21 PM
    Thursday, November 22, 2018 1:12 PM
  • Yep.. I will notify our support - so far it seems its the only thing I can do right now..
    Thursday, November 22, 2018 1:22 PM
  • I on-premise then it can be an issue with the take down of the current report.  Only one report is allowed per session.  The delay may allow more time for the system to cleanup the last report.  That may just be a result of a busy system or lack of resources.  The system support techs can use the system perf monitor to detect that.


    \_(ツ)_/

    Thursday, November 22, 2018 1:28 PM
  • Something similar according to this .. ?

    Another thread


    • Edited by Mekac Thursday, November 22, 2018 1:34 PM
    Thursday, November 22, 2018 1:33 PM
  • Maybe.  Many Exchange CmdLets have odd behaviors because they run on a background thread.


    \_(ツ)_/

    Thursday, November 22, 2018 1:48 PM