Thanks a lot!!
The tool is the one.
I have been reading the code of the tool and generate a tool like that, requires a really deep knowledge of the Portal/AGOL services structure. Naive of me that think that I would produce something similar in two weeks.
Again my most sincere appreciation.
This tool should be included in the portalpy , or in the arcgis module