cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
walker164
Engaged Sweeper II
Hi everyone,

Firstly, I'm just now setting up the helpdesk ticket system of LS. We're working on switching over.
Secondly, we have a basic license, one agent (just me) and less than 100 users in the office.

Setting up the helpdesk inbound/outbound email settings, I started with a "helpdesk@domain.com" email address and then I tried using the LS service account I created for authentication. It said there was a login failure to the Exchange server. Thought I would try our domain admin account. That worked! The domain admin account has an email tied to it because of reasons from previous IT peoples. (The LS service account didn't have an email). I rolled with it.

Then I noticed that all of a sudden there were 6000+ helpdesk tickets. They were all of the emails from that domain admin account. It must've synced them for some reason? Then, LS looks to have parsed all of the contacts from these emails and added them to the User Access & Roles area, thus, the 4800+ users.

I unsynced the domain admin account for the inbound/outbound email settings and set it back to the LS service account. Once I created an email address for the service account, it synced instantly with no errors.

With that bit of background, I'm not sure what I should do to get things back to normal? I changed the helpdesk ticket filter to view 1000/page and just deleted all of them. That was easy enough. But users is different and I can't wipe them all out. Do I have to press the red '-' sign 4800 times?



Thanks for your help!
walker
4 REPLIES 4
walker164
Engaged Sweeper II
I assumed the built-in admin was made earlier too since I created the server and everything months ago. I always used the built-in admin to login too. I found that strange, but oh well.
Esben_D
Lansweeper Employee
Lansweeper Employee
The script was indeed only designed to delete helpdesk users which have no tickets related to them. If the built-in admin is in this list I can see how this will give errors. I presumed that the built-in admin was created a day before you added all the other users.

Regardless, good to hear you got them removed.
walker164
Engaged Sweeper II
Thanks Charles. That was really helpful and enlightening. Kinda had a chance to check out how LS's db is laid out and everything.

So, running the select worked out after massaging the dates a bit. It found all 4800 rows. Unfortunately, I couldn't delete them. I got an error. There weren't any useful tickets in the helpdesk, so I deleted all of them, but it still errored. Maybe because my user and the built-in admin were included and it didn't like deleting them?

I'm not very skilled with sql, so I ended up just doing the "edit last 200 rows" thing and manually clicking and deleting all of them. 30 mins of finger workouts later, I'm down to a legit 47 users. The long way, but it'll work.

Also, thank you for the back up instructions. I'll make a script to back those up regularly.

Thanks!
walker
Esben_D
Lansweeper Employee
Lansweeper Employee
At this moment there is not a function in place to mass delete users. Usually users do not need to be deleted since the information is only used when adding users, CC user or other similar actions in the helpdesk.

In your case, the only option to mass delete the user would be to run an SQL script on your database and remove them that way.

Before running any script I would recommend creating a backup of your database as mentioned in this knowledgebase article: https://www.lansweeper.com/kb/94/backing-up-your-installation.html

You can modify the highlighted dates in the script below to delete the users which were added between the indicated dates. As a test to see what data you will be deleting I recommend running the select query first to make sure your selection is correct.

The date format is yyyy/mm/dd.

Select:
select * from htblusers
where added between '2018/03/17' and '2018/03/20'


Delete:
Delete from htblusers
where added between '2018/03/17' and '2018/03/20'


Quick side note: Should you receive errors when trying to run the delete script. It will most likely be because a user you are trying to delete has a ticket linked to them.