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

Delete potected object after using REST-API

Hi, I have tried to automate the deployment of the VPN client and config. I tried to download the user config via rest api. While doing this, i messed up my ad-connected user. I deleted the user via rest but the "network" object seems to be kept.

Trying to authenticate with this user or prefetching all users fails with something like:

user_prefetch[1939]: 'oldref' => 'REF_NetAaaUSERNAMEUserNetwo',
user_prefetch[1939]: 'name' => 'The user or group network object with the name \'USERNAME (User Network)\' already exists.',

I can not delete it via WebAdmin, so i connected via SSH and tried to locate and delete it with cc: cc del_object 'REF_NetAaaUSERNAMEUserNetwo'
Error is 'The user or group network object \'USERNAME (User Network)\' is protected from deletion.'.

Tried to remove the protection but failed... how can i do this? How can i remove this protected object?

Thank you! Florian

 

PS.: The object looks like this: (yes, i have seen the 'lock' => 'user', but how do i modify it?

          {
            'autoname' => 0,
            'class' => 'network',
            'data' => {
                        'addresses' => $VAR1->[16]{'data'}{'addresses'},
                        'addresses6' => $VAR1->[16]{'data'}{'addresses6'},
                        'comment' => 'Known IP addresses of user \'USERNAME\'',
                        'name' => 'USERNAME (User Network)',
                        'resolved' => 0,
                        'resolved6' => 0
                      },
            'hidden' => 0,
            'lock' => 'user',
            'nodel' => '',
            'ref' => 'REF_NetAaaUSERNAMEUserNetwo',
            'type' => 'aaa'
          },



This thread was automatically locked due to age.
  • Hallo Florian and welcome to the UTM Community!

    Deleting the user via REST wasn't a good idea.  When you delete a user in WebAdmin, there are a lot of other things that happen.

    Did you try the following before attempting to delete?

    cc change_object 'REF_NetAaaUSERNAMEUserNetwo' lock ""

    Cheers - Bob

     
    Sophos UTM Community Moderator
    Sophos Certified Architect - UTM
    Sophos Certified Engineer - XG
    Gold Solution Partner since 2005
    MediaSoft, Inc. USA