Updating assets with Servlet API and PowerShell Invoke-WebRequest starts to jam after 79 assets updated

Updating assets with Servlet API and PowerShell Invoke-WebRequest starts to jam after 79 assets updated

I'm updating assets through ME Servlet API using PowerShell Invoke-Webrequest cmdlet.
Source material is in XML format where script read assets and updates them to ManageEngine.
I'm logging result codes from Servlet API to see how updates have been performing.

Current problem: When 79 assets have been updated successfully, API starts to update latest succefull asset over and over again, even when source asset has been rolled over to next.
I can see from API result log that it randomly can update few new assets, but it usually stays updating same asset.
I have tried to skip certain source asset where it stops, but that doesn't help either.

Powershell command is currenty with following format:
Invoke-WebRequest -Uri ($Conf.SDurl + "/servlets/AssetServlet?") -Body $PostParams -SessionVariable sdsession -ErrorAction:SilentlyContinue -DisableKeepAlive -TimeoutSec 2 -Method Post }

Is this related to maximium sessions for user?
I have tried to find method to disconnect web session, if that is the case, but I haven't found any methods so far.


                New to ADManager Plus?

                  New to ADSelfService Plus?