In my application I need to check if the user is logged into the PTC
I can check the process (si.exe) and conclude that PTC is running. But I cannot verify if the user has logged into PTC.
Is there any batch file to check if user is currently logged into PTC.
Thanks
Solved! Go to Solution.
The simplest approach to check whether the current user already has a running connection Integrity is the "si servers" command.
It lists all running connections to all servers and for all users currently established on this client, like this
<user>@<server>:<port>
If there is no connection it returns an empty string.
so for a batch file:
1. run "si servers" (it also starts the client it necessary)
2. search the resulting output for the correct triple: user, server and port
If it cannot be found, use "si connect" to connect your user to the server. (the "--gui" would enforce an interactive login).
If you you find it, you know the is a runnign connection you can use.
3. go ahead with your batch code
HTH Matthias
Hello Mohd,
Do you mean a CLI command that the user can use to see if a local user connection exists?
Take a look at CS92347 CS119082, which covers some useful commands for these types of situations.
Regards,
Kael
--------
Edited by Kael 2015-03-17EST11:27: Put in the case solution reference I had intended, crossed out and de-linked the complete wrong case solution reference.
Kael,
I could not view this. I got the following error:
Error: Document 92347 is not customer viewable as it is an internal PTC document.
I get the same error when trying to open the link provided.
It looks like that was the incorrect article and was not yet published (which I have just made visible). The better article would probably be CS119082 in my opinion.
Oops! That's actually exactly the article I had intended to reference. Thanks Joe!
The simplest approach to check whether the current user already has a running connection Integrity is the "si servers" command.
It lists all running connections to all servers and for all users currently established on this client, like this
<user>@<server>:<port>
If there is no connection it returns an empty string.
so for a batch file:
1. run "si servers" (it also starts the client it necessary)
2. search the resulting output for the correct triple: user, server and port
If it cannot be found, use "si connect" to connect your user to the server. (the "--gui" would enforce an interactive login).
If you you find it, you know the is a runnign connection you can use.
3. go ahead with your batch code
HTH Matthias
Hello Mohd,
Did any of the posts in this thread provide you with the information you needed? If so, could you mark the post as correct by clicking on the Correct Answer button at the bottom of the post which resolved your issue? You can also mark posts as helpful by going to the bottom of a post and choosing Actions -> Mark as Helpful. These actions let contributors know that you have resolved your issue, and lets everybody know (including future visitors) what actually helped you resolve your issue.
If the issue is still not resolved for you, could you let us know what problems you are still experiencing?
Regards,
Kael