IT Management Suite

 View Only
  • 1.  How to delete User and Department record

    Posted Jan 17, 2023 01:21 AM
    Hi all,

    User and Department entries are imported from an external data source. For some reason, need to delete 120K entries from User.
    Tried selecting all users and click Delete. The deletion is not progressing and stuck at 0%. 

    Question:
    Is there a way to delete bulk entries from User and Department? If this can't be done from console, how to perform the bulk deletion?

    Regards,
    Ain


  • 2.  RE: How to delete User and Department record
    Best Answer

    Broadcom Employee
    Posted Jan 17, 2023 02:49 AM
      |   view attached

    Hi Ain Abdullah!

    There is a KB Article, how to use custom script to bulk delete required resources

    https://community.broadcom.com/symantecenterprise/communities/community-home/librarydocuments/viewdocument?DocumentKey=2b5a7b37-d69b-47a8-a828-eeb8baf129c4&CommunityKey=ef59d715-7ea1-41c6-97f3-dd1bcc10d0c3&tab=librarydocuments

    I modified cs files to delete all "User" resources
    Open CMD "Run as Administrator" and execute this command line C:\Program Files\Altiris\Notification Server\Bin>NScript.exe C:\DeleteItems\DeleteUsers.cs

    Note: If only appropriate users should be deleted, then please modify SQL query in "DeleteUsers.cs" file to include there guids of required users, since by default now it deletes all available "User" resources from database.


    To delete "Department" resources, please use this command line  C:\Program Files\Altiris\Notification Server\Bin>NScript.exe C:\DeleteItems\DeleteDepartments.cs
    Note: Change current SQL query to include only required Departments for deletion or use SELECT _ResourceGuid FROM vDepartment to delete all available Departments.


    Download attached "DeleteItems.zip", unzip "DeleteItems" folder to C:\
    Modify SQL queries if required in .cs files and then run scripts from command line on NS Server.

    Best regards,
    IP.



    ------------------------------
    [JobTitle]
    [CompanyName]
    [State]
    ------------------------------

    Attachment(s)

    zip
    DeleteItems.zip   2 KB 1 version