Select and delete inactive local users

Select and delete inactive local users

Hi all,

 

is there any possibility to select inactive local users which are not connected to MC for 90 days?

Afterwards it would be fine to delete these users automatically.

 

Our MC-Version is 13.3.0.3851

Best regards,

Marcel

  • 07 December 2018
  • SOTI MobiControl
  • 6 Answers
  • 0 Upvote
  • 1 Follower
  • 1.9K Views
    • 6 Answers
    • 0 Upvote
    • 1 Follower

6 Answers

Order By:   Standard | Newest | Votes
christopheBERNARD | posted this 07 December 2018

Hello msc1091,

i'm not an expert but actually i spend all my time in mobicontrol database ...

Go to your server where the app is installed, on database there is a table with a name : LoginLog who contains the login...

For the time connection, actually i haven't find ...but i think this information must be available

 

good weekend

  • 0
  • 0
AJMOD@SOTI | posted this 07 December 2018

Hi MSC1091,

 

Currently there is no alert or feature available in MobiControl to identify users that have not logged into MC for a select period of time and remove those users who have been inactive.

 

What you can do however is see the last time they logged in by going to security tab and viewing the users activity. This should provide the last date and time they have logged in and if you determine they need to be removed from the web console you can select the "manage users" tab and click the red X next to their name to remove them from the system.

 

If this is a feature you would like to see in a future version of MobiControl I would suggest opening a case with support and having them create a feature request on your behalf. Typically the more request we get for features the more likely it is that they will be added in future releases.

 

Technical Support | SOTI Inc. |1.905.624.9828 | support@soti.net | www.soti.net |

  • 1
  • 0
christopheBERNARD | posted this 10 December 2018

 

 

Hello all,

@msc1091 => i've find the table where information about login / logout is stored.

the table is MainLog :

column eventId : 900 => login succes from from table events

column loginId : id of user come from table loginLog

column dateTime : date time of the event

 

with these information, you can have a cmd program who starts every day and perform a query for to find the last connection / disconnection of a user and perform your action you want ...

if i do the same i will do this , it's not perhaps the good way ..

  • 0
  • 0
MSC1091 | posted this 10 December 2018

Unfortunately the MainLog contains only the last 2 days. At the moment I haven't permissions to access MobiControlDB_Archive. I will request this. Afterwards it must be possible. I've just checked out the neccessary joints. It should be no problem.

  • 0
  • 0
christopheBERNARD | posted this 10 December 2018

ahhh ok I haven't see that the table (mainLog) contains only the event for two days ...

 

 

  • 0
  • 0
MSC1091 | posted this 10 December 2018

Hi,

of course I will open a new feature request.

Meanwhile I will use following workaround:

 

SELECT:

select distinct securityprincipal.principalname from LoginLog
inner join securityprincipal on loginlog.principalid = securityprincipal.principalid
where securityprincipal.PrincipalType=1 and LoginLog.LoginID not in (select LoginId from MainLog where EventId=900) and Loginid not in (

Subselect from MobiControlDB_Archive comma-separated-values --> SELECT distinct LoginID from Mainlog where EventId=900 and datetime > current_timestamp - 90

 

);

 

LOCK USER:

update securityprincipal set flags=1 where PrincipalId in (
select distinct securityprincipal.PrincipalId from LoginLog
inner join securityprincipal on loginlog.principalid = securityprincipal.principalid
where securityprincipal.PrincipalType=1 and LoginLog.LoginID not in (select LoginId from MainLog where EventId=900) and Loginid not in (

Paste Subselect from MobiControlDB_Archive comma-separated-values --> SELECT distinct LoginID from Mainlog where EventId=900 and datetime > current_timestamp - 90

 

);

 

Later I will remove these users with another DELETE-statement which remove locked users finally from DB.

 

Best regards,
Marcel

  • 1
  • 1

Give us your feedback
Give us your feedback
Feedback