Novell Cool Solutions

NCP Remove Trustees Script


November 11, 2011 1:18 pm





gpl v2

Download ncp-remove-trustees

This bash script will parse the trustees kept in the NCP trustee_database.xml file (media/nss/VOLUME/._NETWARE/.trusteee_database.xml) for the supplied NSS volume and create a script that will remove the trustees using the “ncpcon rights” commands.

WARNING: Make sure to backup your trustees before running the script with the “metamig” utility.

Save Example (backs up all NSS VOL1 metadata):

metamig save VOL1 > metamig-bu-VOL1.txt

Restore Example (restores only trustee NSS VOL1 metadata)

metaming restore VOL1 -m t < metamig-bu-VOL1.txt

Steps to use:

  1. Extract the ncp-remove-trustees.tgz file with “tar xzvf ncp-remove-trustees.tgz” Then make executable.
  2. Execute the script as the “root” user and supply the volume name.

    Where you execute the script from will be where the script will be located. Other files needed for processing are /tmp/trusteepath-VOLUME.txt and /tmp/trusteename-VOLUME.txt (delete them when you no longer need them)

    The script will not remove any trustees from the volume. You have to execute that output script for trustees to actually be removed. This lets you see what it is going to do before you execute

  3. Add the execute permission to
  4. Run the script.
0 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 50 votes, average: 0.00 out of 5 (0 votes, average: 0.00 out of 5)
You need to be a registered member to rate this post.

Categories: Uncategorized

Disclaimer: This content is not supported by Novell. It was contributed by a community member and is published "as is." It seems to have worked for at least one person, and might work for you. But please be sure to test it thoroughly before using it in a production environment.

1 Comment

  1. By:hschoene

    If a directory name contains the word “name” like /media/nss/VOL/xxxx/domainnames, the script fails with different lines count:
    Error: …..files do not have the same number of lines….

    Change line 10 from the script:
    cat /media/nss/$VOL/._NETWARE/.trustee_database.xml | egrep “name” | cut -d “>” -f2 | cut -d “< " -f1 | sed s/^.// > /tmp/trusteename-$VOL.txt

    cat /media/nss/$VOL/._NETWARE/.trustee_database.xml | egrep “” | cut -d “>” -f2 | cut -d “< " -f1 | sed s/^.// > /tmp/trusteename-$VOL.txt

    Hope, that nobody has a directory, that containsthe word ““….