cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Batch command to check if user his currently logged into PTC

mvard
1-Newbie

Batch command to check if user his currently logged into PTC

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

1 ACCEPTED SOLUTION

Accepted Solutions
mrump
14-Alexandrite
(To:mvard)

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

View solution in original post

7 REPLIES 7
KaelLizak
14-Alexandrite
(To:mvard)

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 CS92347CS119082, 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.


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
DanR.
10-Marble
(To:KaelLizak)

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.

llie
16-Pearl
(To:DanR.)

I get the same error when trying to open the link provided.

JoeBartlett
21-Topaz I
(To:DanR.)

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.

KaelLizak
14-Alexandrite
(To:JoeBartlett)

Oops! That's actually exactly the article I had intended to reference. Thanks Joe!


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
mrump
14-Alexandrite
(To:mvard)

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

KaelLizak
14-Alexandrite
(To:mvard)

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


Kind Regards,
Kael Lizak

Senior Technical Support Engineer
PTC Integrity Lifecycle Manager
Top Tags