Delete User Profiles
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2015 04:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2015 07:10 AM
there are a couple of ways to do this.. the safe long way and the more hazardous faster way....
for safe and long... get a query that JUST shows these bad records and check the coumn to select all and from the bottom list drop down select delete...
in order to make this faster you may want to change your list preference to the maximum available then go find your preference and change it from whatever you selected to a bigger number say 250
this way y ou can see 250 of them on your list scroll through and make sure you have them all... and delete them 250 at a pop.....
the more dangerous way <and i rarely do this unless i have to> is to define a query that will find JUST those records... then in a background script go through finding the records and delete them in the loop using the rec.deleteRecord() command
i don't like deleting records with a back ground script unless you can THOROUGHLY test in a non prod environment because of the potential to wreck your database.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2015 07:23 AM
I would get the query right in the UI, like you have done, then right-click on the breadcrumb and copy the query. I would then use background scripts to write:
var user = new GlideRecord('sys_user');
user.addEncodedQuery('<your copied query here>');
user.deleteMultiple();
This is more dangerous, but the quickest method. Just make sure your encoded query is right, make sure you test it in sub-prod, and go for it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2015 07:27 AM
my problem with doing this in a background script is i am assuming this is ONLY in the production environment and there is no way to test the script and see what br's are activated when you run it etc...
no matter how well thought out.. if you can't test in non prod i am VERY hesitant to run any background script in production because of the potential for the unintended consequences to take down your system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2015 08:03 AM
You can export those records via xml and import them into sub-prod to test.