Hiya
We have a scheduled task that runs as user stask01 which imports files into the database.
These usualy take a couple of mins.
How ever the stask01 id remains connected so through out the day there are multi sessions of the same user is.
Normally go into promon, shut downdatabase and disconnect the user 1 by 1. by using the usr number.
Thats after i stopped the task above from running otherwise would still be getting logins
Is there a quicker way to mass disconnect this user? say from the user id?
Point out very new to progress :(
So any help would be great
Sounds to me like you need to get the code fixed that connects to the database so that it also disconnects when done rather than trying to fix it from a database perspective. I have maybe disconnected 2 users in the last 6 months and feel that's a bit much.
3rd party sadly who have problems with this.. rarther annoying.. any idea of a work around as above?
Have to remove about 60 users a day (Of the same person)
Sadly using windows...
How do i execute that script from promon for promon to run it? Or as any one got a power shell version of the above please
ahh ok thankyou will give it ago.
Thank you for your help and patience
yup i am rubbish at this....
How do i get the script to execute so that i can disconnect users with the above mentioned ID
Will point out i have had this lumbered onto my self with no formal training of progress so winging it atm so i apologise if i seem like a spanner at time.
ok i have dropped the code into a text doc, stuck it as a file with ext as a .p
Dropped into progress navigated to our db then ran command promon ih (IH being name of our db)
now i get the usual options..
I run (prowin32/_progres) from power shell?
Ok done above and on our test db (I would get shouted at lots if i didnt)
Getting a progress box open saying :-
R-code file not located for "Zap.p" (473)
** unable to run startup procedure zap.p (492)
I have coped the zap.p file i created ito the same folder as the db location
ahh add the -rx bit to it now getting can only compile encrypted
now xcode locks up on me lol
ok ran xcode got it encrypted i then run as above i then the procedure editor box open and it does nothing?
/* zap.p
*
* disconnect self-service users and remote clients with a given name, leaves APWs etc running.
*
*/
find _MyConnection no-lock.
for each _Connect no-lock where ( _Connect-Type = "SELF" or _Connect-Type = "REMC" ) and _Connect-Usr <> _MyConn-UserId and _Connect-Name = "stask01":
/*
display
_Connect-Id
_Connect-Usr
_Connect-Type
_Connect-Name
_Connect-Device
_Connect-Batch
.
*/
os-command silent value(
substitute( "&1 proshut &2 -C disconnect &3 >> /tmp/disconnect.&2.log",
( if opsys = "windows" then "call" else "" ),
pdbname( 1),
string( _Connect-Usr )
)
).
end.
Hope you all had a good weekend
Anyway have done the change to the code above (Thank you) and it now works like a charm
So thank you once again for your patience and time very much appreciated :-0