Remove Users via code Portal 10.5.1

334
2
12-26-2018 08:35 AM
RoberthSanchez
New Contributor III

Hi, I need delete users from portal (previously added with LDAP) via code, i can see there is a way to remove users using the web service https://domain.com/arcgis/sharing/rest/portals/xxx789ABCDEF/removeUsers but only works to remove built-in users, not for enterprise users added with LDAP. There is a way to remove this kind of users via code?

i'll be gratefull if anyone can help me.

Thanks.

0 Kudos
2 Replies
JeffSmith
Esri Contributor

Hi Roberth,

This can be done through https://portal.domain.com/arcgis/sharing/rest/community/users/*username*/delete where *username* is replaced with the enterprise username you are trying to delete.

RoberthSanchez
New Contributor III

It Works!.

BTW: i found that if i try to delete a user via POST with this service and the user does not exist, the message that return is wrong:

{"error":{"code":403,"messageCode":"GWM_0003","message":"You do not have permissions to access this resource or perform this operation.","details":[]}}

Thanks for your help Jeff.