Srikant Patil Posted September 10, 2019 Share Posted September 10, 2019 Hi Team, I am planning to monitor users session on each servers from a monitoring tool, So i can trigger email notification if threshold breached. I tried with API and powershell but getting errors , Unable to connect...See below error, Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send. At C:\Users\<>\Desktop\MyFolder\Scripts\PowerShell\Citrix_User\CitrixAPI_test.ps1:29 char:17 + ... $response = Invoke-RestMethod -Uri $trustUrl -Method POST -Body (Conv ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc eption + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send. At C:\Users\<>\Desktop\MyFolder\Scripts\PowerShell\Citrix_User\CitrixAPI_test.ps1:49 char:11 + $result = Invoke-WebRequest -Uri $url -Headers $headers + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc eption + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand Please let me know if there any option to fetch logged users from servers. Thanks in advance Link to comment
0 Dwayne Ryder1709161447 Posted January 22, 2020 Share Posted January 22, 2020 If you need help you will find, that in general, you have to supply more information ie we can see REST API calls are being attempted but no way to advise what might be wrong there as we can't see how you are making that call. Link to comment
Question
Srikant Patil
Hi Team,
I am planning to monitor users session on each servers from a monitoring tool, So i can trigger email notification if threshold breached.
I tried with API and powershell but getting errors , Unable to connect...See below error,
Invoke-RestMethod : The underlying connection was closed: An unexpected error occurred on a send.
At C:\Users\<>\Desktop\MyFolder\Scripts\PowerShell\Citrix_User\CitrixAPI_test.ps1:29 char:17
+ ... $response = Invoke-RestMethod -Uri $trustUrl -Method POST -Body (Conv ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Invoke-WebRequest : The underlying connection was closed: An unexpected error occurred on a send.
At C:\Users\<>\Desktop\MyFolder\Scripts\PowerShell\Citrix_User\CitrixAPI_test.ps1:49 char:11
+ $result = Invoke-WebRequest -Uri $url -Headers $headers
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Please let me know if there any option to fetch logged users from servers.
Thanks in advance
Link to comment
1 answer to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now