This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Unable to delete Node after Import

We Exported the Script Modules Node and the Access Templates Node before doing a new installation of ARS (7.3.1).

After the Import I noticed that the Import duplicated the nodes....now there is a "Script Modules" Node under the default "Script Modules" Node. Same thing with Access Templates....

Is there a way to delete those duplicate subnodes ? It seems they are tagged as "System" Nodes and I am not  able to get rid of them.

  • Hi Renato,

    You can use the Active Roles Management Shell to correct this. Make sure you're logged in as an Active Roles administrator account and use the following example, where I've exported my 'Access Templates' container and then imported it to the original one so it's now a child of it. As in your case, I can't delete it from the MMC.

    Be very careful that you have the correct path to the offending object and not running it against the actual default object.

    Get-QADObject 'Configuration/Access Templates/Access Templates' -Proxy | Remove-QADObject -Force -Proxy

  • Thanks Nick,

    tried it and got this: 

    Remove-QADObject : You do not have sufficient privileges to delete 'CN=Access Templates,CN=Access
    Templates,CN=Configuration', or this object is protected from accidental deletion.
    Cannot perform the requested operation because the processed object has child objects. This operation can only be
    performed on a leaf object.

    then I tried it this way:

    Get-QADObject "CN=Access Templates,CN=Access Templates,CN=Configuration" -proxy | Remove-QADObject -Force -Proxy -DeleteTree

    then I got this:

    Remove-QADObject : Exception from HRESULT: 0x80041266

    The account has the highest privileges, so that should not be the problem....

  • Hi Renato,

    When I did my export, I only exported the container and no child objects. You many need to do each child object (access template and sub container) individually from the bottom, up.

  • Hi Renato,

    I reproduced what you're seeing by exporting the entire container and importing it. I performed the following steps that ended up working.

    # Remove the system flag on all the access templates (there are 2 that have it set that will stop it from being deleted via PowerShell)
    Get-QADObject -SearchRoot 'Configuration/Access Templates/Access Templates' -Type 'edsAccessTemplate' -SearchAttributes @{SystemFlags='*'} -Proxy | Set-QADObject -ObjectAttributes @{SystemFlags=''} -Proxy

    # Delete all the child access templates
    Get-QADObject -SearchRoot 'Configuration/Access Templates/Access Templates' -Type 'edsAccessTemplate' -Proxy | Remove-QADObject -Force -Proxy

    # Delete all the access template containers
    Get-QADObject 'Configuration/Access Templates/Access Templates' -Proxy | Remove-QADObject -Force -DeleteTree -Proxy

    EDIT: Removed the last command as it was redundant to the previous.
    EDIT 2: Optimized the first command to it only updates the objects that need to be updated (much faster)

  • Hello Nick,

    before leaving for the weekend I thought of a similar way, but now that you did it for me I'm not going to complain....;-))

    Thank you very much for your help. Now the duplicated entries are gone for good.