Skip to content

Commit 9ad7cb4

Browse files
Paulsylo25Lacahkmxo
authored
Find the reports assigned to Inactive Users (#1374)
* Create Readme.md * Rename Fix scripts/Readme.md to Fix scripts/Find Reports Assigned to inactive Groups/Readme.md * Update Readme.md * To Check and Retrieve Reports Assigned to Inactive Groups * Rename Report Assigned to Inactive Groups to reportAssignedToInactiveGroups.js @Paulsylo25 the script in this repo should have the .js extension and name accordingly. I have updated it this time. * Create Readme.MD * Update and rename Fix scripts/Readme.MD to Fix scripts/Find the reports assigned to Inactive Users/Readme.MD * Create ReportsAssignedToInactiveusers.js * Rename repoertsassignedtoinactiveusers.js to reportsassignedtoinactiveusers.js * Update Readme.md * Update Readme.MD --------- Co-authored-by: Laszlo <[email protected]> Co-authored-by: Carlos Camacho Junior <[email protected]>
1 parent 5692bb8 commit 9ad7cb4

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
This Fix script will get you the reports assigned to inactive groups so that you can do the cleanup of reports
2+
Required role: itil_admin
3+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This Fix script will get you the reports assigned to inactive Users so that you can do the cleanup of reports
2+
Required role: itil_admin
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
var report = new GlideRecord("sys_report_users_groups");
2+
report.addEncodedQuery('user_id.active=false');
3+
report.query();
4+
while (report.next()){
5+
gs.print("record found: "+report.sys_id);
6+
report.user_id = "";
7+
report.setWorkflow(false);
8+
report.autoSysFields(false);
9+
report.update();
10+
}
11+
ignore = 'true';

0 commit comments

Comments
 (0)