I have a site collection. https://rocket.sharepoint.com/sites/developing

I have tenant : https://rocket-admin.sharepoint.com

Now i want to get tenant URL using java script object modal from the site collection URL which is mention above.

Is there any method in SP.Web object to fetch the information of respective tenant?


1 Answer 1


SP.Web doesn't contain admin URL (tenant URL), but you can do this with a simple JavaScript split method:

var str = "https://rocket.sharepoint.com/sites/developing";
var res = str.split(".sharepoint.com");
var adminUrl = res[0] + "-admin.sharepoint.com";

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.