Get SPO Tenant Site Collection Administrators list using CSOM.

Hi All,
I'm trying to get the list of all SCA's for a site collection created in SPO tenant.
using following code, i could able to view few properties of Site Collection but not the SCA's for that site collection.
spp = tenant.GetSiteProperties(startIndex, true);
Any other possibility to get the list of SCA's for a Site Collection created on SPO Tenant.
Thanks,
P

Your can easily adjust the time out limit of the underlying HttpRequest by setting the property ClientRuntimeContext.RequestTimeout (Details: http://msdn.microsoft.com/EN-US/library/office/ee541007(v=office.15).aspx).
I use this method for multiple Sharepoint Online apps and it works well. But be warned, sometimes I get no repsond for requests and so the ExecuteQuery() blocks until the time out occurs. This happend for me regualry while sending simple GetListByTitle()
requests. So set a sane value (e.g. several minutes for long running requests like feature activations) and handle a time out in catch blocks.

Similar Messages

  • Feature not appearing in site collection features list using powershell

    I created a custom web part solution which adds a custom web part to the web part gallery - simple.
    I did this on my dev server and used Visual Studio's deploy button to deploy it, and it all worked. The solution was added to the Solution Store, my feature was now in the Site Collection features list and automatically activated. So I checked my web part
    gallery and it was there as well... great.
    Now I'm ready to migrate my simple web part to my Prod server. I managed to use WSP builder to build my wsp. So now i have my wsp file.
    I used Powershell to add my solution to my Prod server, that worked. So I ran the Install-SPSolution command and looking at the logs, it all seemed to install fine. Here are the commands I used: 
    Add-SPSolution “E:\Deployment WSPs\HRFeedbackForm.wsp“
    Install-SPSolution -Identity "HRFeedbackForm.wsp" -GACDeployment
    However, when I go to my Site Collection Features, I can't see my feature. There is nothing in my 14 hive either and as far as I can see, and there are no errors in my log files.
    So what have I done wrong?
    So I tested adding and deploying the same solution on my dev box using Powershell and I had the same problem as what I've experienced on my Prod server. So what's the difference between deploying solutions via Visual Studio Deploy and using those powershell
    commands??? Is there something else I'm meant to change, somewhere?
    I hope someone can shed some light on this issue.
    Danielle :)

    Hi,
    I wonder whether you have to populate this web part by force in your web part gallery.
    For this, go to your Site's Home page. Then...
    Site Action > Site Settings > Galleries > Web Parts
    From here...
    Under Library Tools go to Documents Tab > Click on New Documents > The New Web Parts popup will open
    Here search for your web part. If you find it, select it and Check "Overwrite if file already exisists" and click on Populate Gallery.
    If the above does not work, I am stumped too. I will be curious what other members of the community have to add.
    Thanks, Soumya | MCITP, SharePoint 2010
    Omg it was there and i've added it to the web parts library and it works.... that was soooo strange.
    Thanks Soumya :)
    Can you explain at all why the web part has been added to the web part gallery, but the feature doesn't appear under site collection features?
    Danielle :)

  • NavigationTerm.GetWebRelativeFriendlyUrl() is slow for Site Collection Administrators or users with Edit Permission

    I have a publishing site on SharePoint 2013. Part of the site requires a custom navigation to replace the quick launch. I've written a UserControl that accesses the NavigationTermSet and uses the term titles and URLs to build a navigation.
    Loading the NavigationTermSet:
    using (SPSite site = new SPSite(SPContext.Current.Site.ID, SPUserToken.SystemAccount))
    using (SPWeb web = site.OpenWeb(SPContext.Current.Web.ID))
    TaxonomySession taxonomySession = new TaxonomySession(site);
    StandardNavigationSettings navigationSettings = new WebNavigationSettings(web).CurrentNavigation;
    TermStore termStore = taxonomySession.TermStores[navigationSettings.TermStoreId];
    TermSet termSet = termStore.GetTermSet(navigationSettings.TermSetId);
    _navTermSet = NavigationTermSet.GetAsResolvedByWeb(termSet, web, StandardNavigationProviderNames.CurrentNavigationTaxonomyProvider);
    I grab the term's friendly URL with the following:
    navTerm.GetWebRelativeFriendlyUrl();
    Pages containing this control load in less than a second for read-only users. Site Collection Administrators or Content Editors take about 8 seconds to load the same page. I've determined that the method in the code block above is the culprit for the long
    load times for admins and content editors. What is the deal with that? Can I do something differently to speed things up for admins?
    Any help is appreciated.

    For anyone who ran into the same issue as me, the fix was to change how the term set was loaded:
    _navTermSet = TaxonomyNavigation.GetTermSetForWeb(SPContext.Current.Web, StandardNavigationProviderNames.CurrentNavigationTaxonomyProvider, false);
    This loads the term set from the navigation cache. The other method I was using would load without making use of the cache, which is why it was slow. I'm guessing the cache was still being used for non-admin users as the loading was not slow for them.

  • How can i add a special user to the "site collection administrators" of the personal site on sharepoint online when the personal site is creating ?

    when a new personal site is created on the sharepoint online 2013, then the administrator of this personal site will be himself. we can add another person to the "site collection administrators", then this person have full control of this personal
    site.
    but my request is : add this personal to the personal site when the personal site is creating, but not after the personal site has created ?
    Is anybody know how to do that?

    Hi,
    According to your post, my understanding is that you want to add a special user to the "site collection administrators" of the personal site on sharepoint online when the personal site is creating.
    Per my knowledge,
    there is no out of the box way to accomplish this with SharePoint.
    This is a forum which is supported for SharePoint On-Premise.
    Regarding SharePoint Online, for quick and accurate answers to your questions, it is recommended that you initial a new thread in Office 365 forum.
    Office 365 forum
    http://community.office365.com/en-us/forums/default.aspx
    Thanks,
    Linda Li                
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Linda Li
    TechNet Community Support

  • Get particular item count in sharepoint list using designer Workflow

    How to get specific item count in sharepoint list using designer Workflow 2013.
    For Example 
    Title  Count
    x        1
    y        1
    x        2
    x        3

    HI Thiru,
    Can you please elaborate your problem. Is that Title and count are your list columns you want to fetch the value of count column based on title?
    If my interpretation in not wrong, then it's not possible in SPD with the case you have mentioned in your question as Title='x' is having 3 different entries and SPD activity will always return first matching item and ignore the rest with warning message.
    Regards,
    Brij K

  • Remove access for site collection administrators from sub sites

    Hi,
    We have site collection with sub sites for departments. Here few departments is having confidential data and they don't want to give access to the site collection administrators also.
    Is this possible to remove site collection administration rights for sub sites? If Yes,please tell me how can i achieve this.
    Regards,
    Saya

    Dear Nadeem,
    Thanks for your information. I have one query on permissions.
    I have created new site collection and has given site collection administrator permissions to the user "ABC" and there is no permissions for Farm administrator also. Except this user there is no other users are having any permissions to this site
    collection. Even though I am able to log in with my Farm administrator (it is displaying as "System Account").
    Any help would be greatly appreciated to resolve this as there is some confidential documents which should not be accessible to any user.
    Regards,
    Saya

  • Any way to get all users's user profile proeprty using CSOM c# for sharepoint online - office 365?

    Any way to get all users's user profile proeprty using CSOM c# for sharepoint online - office 365?

    Since CSOM provides methods for operations related to people per
    user scope, you could retrieve all site users first using SP.Web.siteUsers
    property. and then use SP.UserProfiles.PeopleManager.getUserProfilePropertyFor
    Method to get property.
    [custom.development]

  • How to get hostweb's site collection in SharePoint hosted app?

    I want display SharePoint site collection of host web in my SharePoint hosted app. I have used following code. 
    ExecuteOrDelayUntilScriptLoaded(callSharePoint, "sp.js");
    function callSharePoint() {
    hostweburl = getQueryStringParameter("SPHostUrl");
    appweburl = getQueryStringParameter("SPAppWebUrl");
    hostweburl = decodeURIComponent(hostweburl);
    appweburl = decodeURIComponent(appweburl);
    var scriptbase = appweburl + "/_layouts/15/";
    $.getScript(scriptbase + "SP.Runtime.js",
    function () {
    $.getScript(scriptbase + "SP.js",
    function () {
    //$.getScript(scriptbase + "SP.Taxonomy.js", function () { });
    $.getScript(scriptbase + "SP.RequestExecutor.js", execOperation);
    //Loads context, web and lists....
    function execOperation() {
    try {
    //create context for appweburl.
    context = new SP.ClientContext(appweburl);
    var factory = new SP.ProxyWebRequestExecutorFactory(appweburl);
    context.set_webRequestExecutorFactory(factory);
    //get hostsite reference & load as web.
    appContextSite = new SP.AppContextSite(context, hostweburl);
    web = appContextSite.get_web();
    context.load(web);
    list = web.get_lists();
    context.load(list);
    webs = appContextSite.get_web().get_webs();
    context.load(webs);
    //webs = appContextSite.get_site().get_rootWeb().get_webs();
    //context.load(webs);
    context.executeQueryAsync(onWebsLoaded, onQueryFailed);
    catch (err) {
    alert(err.message);
    function onWebsLoaded(sender, args) {
    alert(list.get_count());
    var webEnum = list.getEnumerator();
    while (webEnum.moveNext()) {
    web = webEnum.get_current();
    alert(web.get_id());
    for (var i = 0; i < webs.get_count() ; i++) {
    subwebs = webs.itemAt(i);
    recursiveAll(subwebs);
    /* recursive call for web */
    function recursiveAll(cweb) {
    debugger;
    alert(cweb.get_title());
    var subwebs = cweb.get_webs();
    context.load(subwebs);
    context.executeQueryAsync(function (sender, args) {
    debugger;
    var webEnum = subwebs.getEnumerator();
    while (webEnum.moveNext()) {
    web = webEnum.get_current();
    alert(web.get_title());
    //recursive call for current web.
    recursiveAll(web);
    }, function () { debugger; alert('err'); });
    In this code I have get all the list of the Host web. But I am not able to get Host webs.
    Any of the when I load the Web it gives me the AppWebUrl not the host web.
    So I tried by using following code
    context = new SP.ClientContext(hostweburl);
    web = appContextSite.get_web();
    context.load(web);
    context.executeQueryAsync(onWebsLoaded, onQueryFailed);
    But it gives me error: unexpected response data from server
    Is there any other way to view all sites and sub sites of the host web in SharePoint hosted app?

    Hi,
    Since you are using a provider Hosted app if you want to get the current logged in name than do not use AppOnlyAccessToken else use AccessToken which is App + user Context AccessToken.
    then 
    Web web = clientContext.Web;
    clientContext.Load(web);
    clientContext.ExecuteQuery();
    clientContext.Load(web.CurrentUser);
    clientContext.ExecuteQuery();
    clientContext.Web.CurrentUser.LoginName;will return proper user Name.
    HttpContext.Current.User.Identity.Name will never return the user as this object is related to IIS server of your App Server not sharepoint.you should set this as Anonymous in case of provider hosted app.you can download the below sample which uses the AccessToken which has user name in it.https://code.msdn.microsoft.com/Working-provider-hosted-8fdf2d95
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • Managed custom properties at site collection level when used as refiner returns no value in search result web part

    I have created certain crawled properties and mapped them to the OOB managed properties( refineable active )  in search schema at site collection level and tried to use them as refiner in the search
    site at farm level but it returns no value.
    But when i use the same crawled property and map it to a service level OOB metadata property ( refineable active ) and use it in search as refiner it returns result , Can you help as to why this difference is there.
    What steps should i do so that site level refiners also work in the enterprise search 
    Thanks in advance

    Hi  Dextar,
    According to your description, my understanding is that you want to create a site level refiner in SharePoint 2013.
    Here is a detailed blog you can refer to:
    http://blogs.technet.com/b/tothesharepoint/archive/2013/11/11/how-to-add-refiners-to-your-search-results-page-for-sharepoint-2013.aspx
    Be aware that any changes in the manage property required full crawl.
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • Is there any REST API to get all the Site and site Collections from Sharepoint Online

    Hi,
    I have one SharePoint Online tenant. We are using REST API to integrate SharePoint to our internal System.
    For my use case I need to get all the SharePoint sites ans Sitecollections. From each SiteCollection I need all the subsites under this.
    I have used below REST Query
    http://<Base site url>/_api/web
    This doesn't give me all the Site collections
    Could any one please give me some way to get all the Site collections and sites from my sharepoint tenant through REST API.
    Thanks,

    Hi Abhiram,
    There seems no such endpoint in SharePoint REST API can retrieve a list of site collections in a SharePoint Online tenant:
    https://msdn.microsoft.com/en-us/library/office/jj860569.aspx#Reference
    If Client Object Model can be an option for you, you can use Tenant object to achieve what you want:
    http://social.technet.microsoft.com/wiki/contents/articles/24050.perform-basic-admin-operations-using-csom-in-sharepoint-online.aspx#Scenario_3_Fetch_All_Site_Collections
    Anyway, I would suggest you submit a feedback to the Office Developer Platform if there any expectation about the future version of REST API of Office 365 SharePoint
    Online:
    http://officespdev.uservoice.com/
    It
    is a place for customers provide feedback about Microsoft Office products. What’s more, if a feedback is high voted there by other customers, it will be promising that Microsoft
    Product Team will take it into consideration when designing the next version in the future.
    Thanks 
    Patrick Liang
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Script to bulk assign 'My Site collection' secondary administrators

    Hi
    Staff in my company have already logged in and created their own My Sites and when they did this it set themselves as the primary administrator but left the secondary administrator blank. I want to add spadmin to the secondary administrator role.
    I know you can set the secondary My Site administrators using
    Set -SPSite -identity https://my.company.org.uk/personal/jamesv -secondaryowneralias DOMAIN\spadmin
    Could someone please help me put this into a loop which would cycle through all of the personal sites in that web application and then set spadmin as secondary administrator for all.
    Id like to learn more about Powershell but not really sure where to look, what courses to do.. if anyone knows of any please also let me know.
    Many Thanks
    James

    Change site collection administrators for all site collections 
    Get-SPWebApplication "http://intranet.crescent.com" | Get-SPSite -Limit All | ForEach-Object { Set-SPSite $_ -OwnerAlias "<domain\user>" -SecondaryOwnerAlias "<domain\user>" }
    Read more: http://www.sharepointdiary.com/2013/01/change-site-collection-primary-secondary-administrators.html#ixzz3AyBN7Taj
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Get Sitecollection and Sub Sites Data Base Size Using PowerShell

    Hi All,
    Currently i am getting the Site collection database size using this powershell
    $SiteCollurl = @{Expression={$_.url};Label="Site Collection URL"}
    $size = @{Expression={[math]::round($_.diskused/1MB, 2)};label="DB Size in MB"}
    $HTML = Get-SPSiteAdministration -Limit All | select $SiteCollurl, $size
    So in this $HTML i am getting all the Site Collection Url's and DB size for each site collection.
    Now i want to get the Sub Sites url and Sub Sites Database size also.
    I tried like this  "$HTML = Get-SPSiteAdministration -Limit All | | Get-SPSite -Limit All | Get-SPWeb -Limit All  | select $SiteCollurl, $size"
    I am getting all the sub site url's but Database size i am getting 0 for all sites and sub sites.
    Can any one help on this.how to get the database size for all site collection's and sub sites.
    Regards,
    Phani.
    Rhys W Edwards Where are you :)

    Hi
    Please try the script below:
    Get-SPSite -Limit ALL | ForEach {
    $_ | Get-SPSiteAdministration | Select $SiteCollurl, $size}
    I hope this helps.

  • Getting access denied when trying to loging to sharepoint 2010 site collection.

    only Site Collection Administrators  are able to logging in to the site,other than that
    If i give any View or read or contribute permission to any user then he is not able to logging in to the site getting Access Denied ERROR.
    Below is the error generated in the LOG folder & attached here with screen shot.
    Request (GET:http://sharepoint-app:2525/_layouts/accessdenied.aspx?closeConnection=01
    vijay kumar designer 2010

    Tanq it solved my problem Fadi
    Abdulwahab
    vijay kumar designer 2010

  • Site collection admin getting access denied!!

    Hello All,
    In my current SPFarm, All users were accessing the environment and all of the sudden some group users are unable to get access to the system.  We have been looking this issue all day long and couldn't figure out what is broken in the system.
    You can take as an example the following user's credential xyz . He has all sort of permission access to the  site collection but unable to access sites within the site collection. He used to access all the sites a couple of days back.
    Not everyone is noticing this issue. If I add this user to web application user policy he is able to access the site.
    Yashwanth Mannem

    This is a published site. superreader and superuser accounts are in web app user policy with appropriate permissions.
    Yashwanth Mannem
    Do you also have them in the Web Application properties in the correct format (classic or claims)?
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • How to get administrations of distribution list using api?

    I want get all administrations of a distribution list using api, how to do that?
    anybody knows? Thank you very much!!

    there is a standard function in mdm wd component
    https://help.sap.com/saphelp_nwmdm71/helpdata/en/loio30bf76947bb64c48a2e835fda42c5183_30bf76947bb64c48a2e835fda42c5183/4…
    "Note The Compare to Original button on the Items Detail component opens a Compare component enabling a user to compare a checked out record with an original record (if the user has authorization for the checked out group).
    If the checked out record is a result of a merge action, then the Compare view displays all the original records prior to the merge. When a merge action is executed on a number of checked out records, the merged record is also checked out."

Maybe you are looking for

  • Nokia lumia phone app cover

    what the hell going on withnokia lumias model htc had already brought the phone cover which covers on phone cover app in windowsphone 8.1  why the heell the leading wp devices manufacturer is laggy behind  bring out the phone cover app on nokia lumia

  • Nokia lumia 710

    I have been on for days trying to set my mms up on the Nokia lumia 10 . I have just been on the o2websight because I had tryed everything else I have put in the iPhone settings and its now sending pictures why hasn't any other setting worked

  • Cumulated amounts in the Query

    Hi Sap Developers, I need some hints to create a query. I haven't found any solutions until now. I've got an infocube with amounts grouped by day, which are gonna be displayed in the query using the cumulated format as follows: 1/jan           2/jan 

  • Dynamic or Static Class

    Dynamic or Static Objects It seems to me there is a big cliff at the point of deciding to instantiate your class at runtime or static load on start-up. My swf apps have a pent-up burst that happens a couple seconds into the run. I think I get this on

  • No such method found...

    Hello everybody, following exception... java.lang.NoSuchMethodError: java/net/URL: method getQuery()Ljava/lang/String; not found was thrown when I tried running a simple test applet in browsers IE 5 and 5.5! the same worked with Netscape 6.2!! here i