From 2b8a6d0f7669519b21d8ce8dc50ecf8c7da395fc Mon Sep 17 00:00:00 2001 From: Mike Sheldon Date: Thu, 20 Apr 2023 09:41:32 -0800 Subject: [PATCH] Add AD User Duplicates App --- .../NIM/config/apps/ADUserDuplicates.json | 327 ++++++++++ .../app_aduserduplicates_list_users.json | 594 ++++++++++++++++++ .../aduserduplicates_duplicateusersbyid.json | 31 + 3 files changed, 952 insertions(+) create mode 100644 ProgramData/Tools4ever/NIM/config/apps/ADUserDuplicates.json create mode 100644 ProgramData/Tools4ever/NIM/config/filters/app_aduserduplicates_list_users.json create mode 100644 ProgramData/Tools4ever/NIM/config/queries/aduserduplicates_duplicateusersbyid.json diff --git a/ProgramData/Tools4ever/NIM/config/apps/ADUserDuplicates.json b/ProgramData/Tools4ever/NIM/config/apps/ADUserDuplicates.json new file mode 100644 index 0000000..26ed102 --- /dev/null +++ b/ProgramData/Tools4ever/NIM/config/apps/ADUserDuplicates.json @@ -0,0 +1,327 @@ +{ + "name": "ADUserDuplicates", + "forms": [ + { + "name": "main", + "form": { + "type": "rows", + "rows": [ + { + "cols": [ + { + "type": "column", + "width": 2, + "cell": { + "type": "unit", + "unit": { + "image": "invoice.svg", + "actions_description": "", + "actions_wait": false, + "alignment": "", + "actions": [], + "cid": 35, + "fuid": "", + "margin": "____", + "padding": "4___", + "shadow": "small", + "styles": "width:72px;margin: auto;display: block;", + "styles_column": "", + "type": "image" + } + } + }, + { + "type": "column", + "width": 8, + "cell": { + "type": "unit", + "unit": { + "text_value": "AD User Duplicates", + "text_eval": { + "javascript": "" + }, + "font_size": "", + "header": "h2", + "color": "", + "background_color": "", + "actions_description": "", + "actions_wait": false, + "alignment": "", + "actions": [], + "cid": 37, + "fuid": "", + "margin": "____", + "padding": "4___", + "shadow": "small", + "styles": "display: flex;\njustify-content: left;\nalign-items: center;\nheight: 100px;\nwidth: 100%;", + "styles_column": "", + "type": "static_text" + } + } + }, + { + "type": "column", + "width": 2, + "cell": { + "type": "unit", + "unit": { + "align_right": false, + "button_text": "Dashboard", + "button_style": "dark", + "button_size": "small", + "background_solid": true, + "disabled": { + "javascript": "" + }, + "fit_column": false, + "icon_left": "", + "icon_right": "", + "disable_form_invalid": false, + "actions_description": "", + "actions_wait": false, + "alignment": "right", + "actions": [ + { + "app_name": "Dashboard", + "cid": 416, + "type": "Start app", + "trigger": "None" + } + ], + "cid": 413, + "fuid": "", + "margin": "44__", + "padding": "", + "shadow": "small", + "styles": "", + "styles_column": "", + "type": "button" + } + } + } + ], + "hide": { + "javascript": "" + } + }, + { + "cols": [ + { + "type": "column", + "width": 12, + "cell": { + "type": "unit", + "unit": { + "margin_left": "", + "margin_right": "", + "margin_top": "", + "margin_bottom": "", + "color": "", + "line_height": "", + "actions_description": "", + "actions_wait": false, + "alignment": "", + "actions": [], + "cid": 170, + "fuid": "", + "shadow": "small", + "styles": "", + "styles_column": "", + "type": "separator" + } + } + } + ], + "hide": { + "javascript": "" + } + }, + { + "cols": [ + { + "type": "column", + "width": 12, + "cell": { + "type": "unit", + "unit": { + "actions_description": "", + "actions_wait": false, + "alignment": "", + "actions": [], + "cid": 419, + "fuid": "", + "margin": "__4_", + "padding": "", + "shadow": "small", + "styles": "", + "styles_column": "", + "type": "table_grid", + "validator": { + "required": true, + "message": "" + }, + "dnd_grid": "", + "dark": false, + "filter_columns": 6, + "filter_enabled": false, + "heavy": true, + "views": { + "table_views": { + "default": { + "table_type": "query", + "table_name": "ADUserDuplicates_DuplicateUsersByID", + "columns": [ + { + "color": "", + "column_show": true, + "column_name": "employeeID", + "column_width": 218, + "display_name": "employeeID", + "data_type": 0, + "key": false, + "variable_name": "" + }, + { + "color": "", + "column_show": true, + "column_name": "givenName", + "column_width": 194, + "display_name": "givenName", + "data_type": 0, + "key": false, + "variable_name": "" + }, + { + "color": "", + "column_show": true, + "column_name": "sn", + "column_width": 251, + "display_name": "sn", + "data_type": 0, + "key": false, + "variable_name": "" + }, + { + "color": "", + "column_show": true, + "column_name": "sAMAccountName", + "column_width": 300, + "display_name": "sAMAccountName", + "data_type": 0, + "key": false, + "variable_name": "" + }, + { + "color": "", + "column_show": true, + "column_name": "mail", + "column_width": 304, + "display_name": "mail", + "data_type": 0, + "key": false, + "variable_name": "" + }, + { + "color": "", + "column_show": true, + "column_name": "userPrincipalName", + "column_width": 387, + "display_name": "userPrincipalName", + "data_type": 0, + "key": false, + "variable_name": "" + } + ], + "params": [], + "variable_input": "" + } + }, + "default_view": "default" + }, + "selection_mode": "single", + "title_columns": 6, + "title_enabled": true, + "title_styles": "font-weight:bold;", + "title_text": "Duplicate Users by ID", + "height": "600px", + "top_height": "2em" + } + } + } + ], + "hide": { + "javascript": "" + } + } + ] + }, + "form_props": { + "form_function": "general", + "actions_description": "", + "actions_wait": false, + "alignment": "", + "actions": [], + "cid": -1, + "fuid": "", + "shadow": "none", + "styles": "", + "styles_column": "", + "type": "empty" + } + } + ], + "props": { + "description": "Report on Duplicate Users in AD by ID", + "display_name": "AD Duplicate Users", + "image": "invoice.svg", + "sort": 1000, + "form_size": "large", + "actions_description": "", + "actions_wait": false, + "alignment": "", + "actions": [], + "cid": -1, + "fuid": "", + "margin": "4___", + "padding": "", + "shadow": "small", + "styles": "", + "styles_column": "", + "type": "empty" + }, + "variables": [ + { + "name": "selected_email", + "type": 0, + "cid": -1, + "initialize": false, + "stop_propagation": false, + "test_only": true, + "data_value": "testemail1", + "data_type": 0 + }, + { + "name": "selected_enabledState", + "type": 1, + "cid": -1, + "javascript": { + "javascript": "let result = '';\n\ntry {\n if(data['selected_enabled'] == '1')\n {\n \treturn 'Enabled' \n }\n \n} catch(e){}\n\nreturn result;" + } + }, + { + "name": "new_enabledState", + "type": 1, + "cid": -1, + "javascript": { + "javascript": "let result = data['selected_enabled'];\n\ntry {\n if(data['Enabled'])\n {\n \treturn 1\n }\n else\n {\n \treturn 0\n }\n \n} catch(e){}\n\nreturn result;" + } + } + ], + "name_generator": { + "name": "", + "delay": 2000, + "input_fields": [], + "output_fields": [] + }, + "nim_version": 1419 +} \ No newline at end of file diff --git a/ProgramData/Tools4ever/NIM/config/filters/app_aduserduplicates_list_users.json b/ProgramData/Tools4ever/NIM/config/filters/app_aduserduplicates_list_users.json new file mode 100644 index 0000000..79f74a2 --- /dev/null +++ b/ProgramData/Tools4ever/NIM/config/filters/app_aduserduplicates_list_users.json @@ -0,0 +1,594 @@ +{ + "filter_name": "App_ADUserDuplicates_List_Users", + "filter_name_parent": "", + "filter_items": [ + { + "system_name": "AD", + "col_name": "Users", + "colrefname": "Users", + "type": "start", + "blocked": false, + "indent": 0, + "inherited": false, + "enabled": true, + "index": 0, + "child_count": 0, + "id": "a16648df-7b24-4f39-a098-84d5db2abd2f" + } + ], + "filter_columns": [ + { + "id": "Users.objectGUID", + "order": 1, + "name": "Users.objectGUID", + "display_name": "objectGUID", + "show": true, + "field_name": "objectGUID", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.accountExpires", + "order": 2, + "name": "Users.accountExpires", + "display_name": "accountExpires", + "show": true, + "field_name": "accountExpires", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.adminDescription", + "order": 3, + "name": "Users.adminDescription", + "display_name": "adminDescription", + "show": true, + "field_name": "adminDescription", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.c", + "order": 4, + "name": "Users.c", + "display_name": "c", + "show": true, + "field_name": "c", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.CannotChangePassword", + "order": 5, + "name": "Users.CannotChangePassword", + "display_name": "CannotChangePassword", + "show": true, + "field_name": "CannotChangePassword", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.canonicalName", + "order": 6, + "name": "Users.canonicalName", + "display_name": "canonicalName", + "show": true, + "field_name": "canonicalName", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.ChangePasswordAtLogon", + "order": 7, + "name": "Users.ChangePasswordAtLogon", + "display_name": "ChangePasswordAtLogon", + "show": true, + "field_name": "ChangePasswordAtLogon", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.cn", + "order": 8, + "name": "Users.cn", + "display_name": "cn", + "show": true, + "field_name": "cn", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.co", + "order": 9, + "name": "Users.co", + "display_name": "co", + "show": true, + "field_name": "co", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.company", + "order": 10, + "name": "Users.company", + "display_name": "company", + "show": true, + "field_name": "company", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.countryCode", + "order": 11, + "name": "Users.countryCode", + "display_name": "countryCode", + "show": true, + "field_name": "countryCode", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.department", + "order": 12, + "name": "Users.department", + "display_name": "department", + "show": true, + "field_name": "department", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.description", + "order": 13, + "name": "Users.description", + "display_name": "description", + "show": true, + "field_name": "description", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.displayName", + "order": 14, + "name": "Users.displayName", + "display_name": "displayName", + "show": true, + "field_name": "displayName", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.distinguishedName", + "order": 15, + "name": "Users.distinguishedName", + "display_name": "distinguishedName", + "show": true, + "field_name": "distinguishedName", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.division", + "order": 16, + "name": "Users.division", + "display_name": "division", + "show": true, + "field_name": "division", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.employeeID", + "order": 17, + "name": "Users.employeeID", + "display_name": "employeeID", + "show": true, + "field_name": "employeeID", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.employeeNumber", + "order": 18, + "name": "Users.employeeNumber", + "display_name": "employeeNumber", + "show": true, + "field_name": "employeeNumber", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.employeeType", + "order": 19, + "name": "Users.employeeType", + "display_name": "employeeType", + "show": true, + "field_name": "employeeType", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.Enabled", + "order": 20, + "name": "Users.Enabled", + "display_name": "Enabled", + "show": true, + "field_name": "Enabled", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.givenName", + "order": 21, + "name": "Users.givenName", + "display_name": "givenName", + "show": true, + "field_name": "givenName", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.homeDirectory", + "order": 22, + "name": "Users.homeDirectory", + "display_name": "homeDirectory", + "show": true, + "field_name": "homeDirectory", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.homeDrive", + "order": 23, + "name": "Users.homeDrive", + "display_name": "homeDrive", + "show": true, + "field_name": "homeDrive", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.homePhone", + "order": 24, + "name": "Users.homePhone", + "display_name": "homePhone", + "show": true, + "field_name": "homePhone", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.initials", + "order": 25, + "name": "Users.initials", + "display_name": "initials", + "show": true, + "field_name": "initials", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.ipPhone", + "order": 26, + "name": "Users.ipPhone", + "display_name": "ipPhone", + "show": true, + "field_name": "ipPhone", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.l", + "order": 27, + "name": "Users.l", + "display_name": "l", + "show": true, + "field_name": "l", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.lastLogon", + "order": 28, + "name": "Users.lastLogon", + "display_name": "lastLogon", + "show": true, + "field_name": "lastLogon", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.lastLogonTimestamp", + "order": 29, + "name": "Users.lastLogonTimestamp", + "display_name": "lastLogonTimestamp", + "show": true, + "field_name": "lastLogonTimestamp", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.mail", + "order": 30, + "name": "Users.mail", + "display_name": "mail", + "show": true, + "field_name": "mail", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.manager", + "order": 31, + "name": "Users.manager", + "display_name": "manager", + "show": true, + "field_name": "manager", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.middleName", + "order": 32, + "name": "Users.middleName", + "display_name": "middleName", + "show": true, + "field_name": "middleName", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.mobile", + "order": 33, + "name": "Users.mobile", + "display_name": "mobile", + "show": true, + "field_name": "mobile", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.name", + "order": 34, + "name": "Users.name", + "display_name": "name", + "show": true, + "field_name": "name", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.objectClass", + "order": 35, + "name": "Users.objectClass", + "display_name": "objectClass", + "show": true, + "field_name": "objectClass", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.objectSid", + "order": 36, + "name": "Users.objectSid", + "display_name": "objectSid", + "show": true, + "field_name": "objectSid", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.pager", + "order": 37, + "name": "Users.pager", + "display_name": "pager", + "show": true, + "field_name": "pager", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.PasswordNeverExpires", + "order": 38, + "name": "Users.PasswordNeverExpires", + "display_name": "PasswordNeverExpires", + "show": true, + "field_name": "PasswordNeverExpires", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.PasswordNotRequired", + "order": 39, + "name": "Users.PasswordNotRequired", + "display_name": "PasswordNotRequired", + "show": true, + "field_name": "PasswordNotRequired", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.path", + "order": 40, + "name": "Users.path", + "display_name": "path", + "show": true, + "field_name": "path", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.physicalDeliveryOfficeName", + "order": 41, + "name": "Users.physicalDeliveryOfficeName", + "display_name": "physicalDeliveryOfficeName", + "show": true, + "field_name": "physicalDeliveryOfficeName", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.postalCode", + "order": 42, + "name": "Users.postalCode", + "display_name": "postalCode", + "show": true, + "field_name": "postalCode", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.postOfficeBox", + "order": 43, + "name": "Users.postOfficeBox", + "display_name": "postOfficeBox", + "show": true, + "field_name": "postOfficeBox", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.profilePath", + "order": 44, + "name": "Users.profilePath", + "display_name": "profilePath", + "show": true, + "field_name": "profilePath", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.proxyAddresses", + "order": 45, + "name": "Users.proxyAddresses", + "display_name": "proxyAddresses", + "show": true, + "field_name": "proxyAddresses", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.roomNumber", + "order": 46, + "name": "Users.roomNumber", + "display_name": "roomNumber", + "show": true, + "field_name": "roomNumber", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.sAMAccountName", + "order": 47, + "name": "Users.sAMAccountName", + "display_name": "sAMAccountName", + "show": true, + "field_name": "sAMAccountName", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.scriptPath", + "order": 48, + "name": "Users.scriptPath", + "display_name": "scriptPath", + "show": true, + "field_name": "scriptPath", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.sn", + "order": 49, + "name": "Users.sn", + "display_name": "sn", + "show": true, + "field_name": "sn", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.st", + "order": 50, + "name": "Users.st", + "display_name": "st", + "show": true, + "field_name": "st", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.streetAddress", + "order": 51, + "name": "Users.streetAddress", + "display_name": "streetAddress", + "show": true, + "field_name": "streetAddress", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.telephoneNumber", + "order": 52, + "name": "Users.telephoneNumber", + "display_name": "telephoneNumber", + "show": true, + "field_name": "telephoneNumber", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.title", + "order": 53, + "name": "Users.title", + "display_name": "title", + "show": true, + "field_name": "title", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.userPrincipalName", + "order": 54, + "name": "Users.userPrincipalName", + "display_name": "userPrincipalName", + "show": true, + "field_name": "userPrincipalName", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.wWWHomePage", + "order": 55, + "name": "Users.wWWHomePage", + "display_name": "wWWHomePage", + "show": true, + "field_name": "wWWHomePage", + "colrefname": "Users", + "source": "data" + }, + { + "id": "Users.primaryGroupID", + "order": 56, + "name": "Users.primaryGroupID", + "display_name": "primaryGroupID", + "show": true, + "field_name": "primaryGroupID", + "colrefname": "Users", + "source": "data" + } + ], + "sort_columns": [], + "group": { + "enabled": false, + "count": 1, + "field": "" + }, + "params": [], + "appends": [], + "exclude": { + "enabled": false, + "field_name": "" + }, + "lookups": [] +} \ No newline at end of file diff --git a/ProgramData/Tools4ever/NIM/config/queries/aduserduplicates_duplicateusersbyid.json b/ProgramData/Tools4ever/NIM/config/queries/aduserduplicates_duplicateusersbyid.json new file mode 100644 index 0000000..b13570a --- /dev/null +++ b/ProgramData/Tools4ever/NIM/config/queries/aduserduplicates_duplicateusersbyid.json @@ -0,0 +1,31 @@ +{ + "name": "ADUserDuplicates_DuplicateUsersByID", + "query": "SELECT employeeID, givenName, sn, sAMAccountName, mail, userPrincipalName\nFROM f_App_ADUserDuplicates_List_Users\nWHERE employeeID IN (\n SELECT employeeID\n FROM f_App_ADUserDuplicates_List_Users\n WHERE length(employeeID) > 0\n GROUP BY employeeID\n HAVING COUNT(*) > 1\n )\nORDER BY employeeID", + "params": [], + "columns": [ + { + "name": "employeeID", + "type": 0 + }, + { + "name": "givenName", + "type": 0 + }, + { + "name": "sn", + "type": 0 + }, + { + "name": "sAMAccountName", + "type": 0 + }, + { + "name": "mail", + "type": 0 + }, + { + "name": "userPrincipalName", + "type": 0 + } + ] +} \ No newline at end of file