Setting SharingCapability property for a Site Collection using CSOM in C#

Hello,
I am trying to deploy multiple site collections in a SharePoint 2013 Online tenant, using CSOM in C#.
I am currently using the SiteCreationProperties to do this, but I miss one crucial parameter : SharingCapability.
Do you guys know a way of activating external sharing for a site collection in CSOM ?

I believe you can set the SharingCapability of the Site after you create it. You can use the Microsoft.Online.SharePoint.TenantAdministration.Tenant.GetSitePropertiesByUrl(siteUrl, true)
This returns SiteProperties object with a SharingCapability property you can set with the appropriate enumeration. Then call the Update method.
http://msdn.microsoft.com/en-us/library/microsoft.online.sharepoint.tenantadministration.tenant.getsitepropertiesbyurl(v=office.15).aspx
Blog | SharePoint Field Notes Dev Tools |
SPFastDeploy | SPRemoteAPIExplorer

Similar Messages

  • How to provision site collection using CSOM in SharePoint on premise

    Hi,
    I need to create site collection using CSOM in SharePoint on premise.
    Most of the forums discuss on provisioning site collection in SharePoint online and that does not work in on premises.
    Is it possible to provision site collection using CSOM in on premise?
    Kindly, share some reference to accomplish this.
    Thanks in advance,
    Dhijit

    Hi,
    According to your description, my understanding is that you want to create a site collection using Client Object Model in SharePoint on-premise environment.
    One option is that you can follow the article below to create the site collection with CSOM.
    Provisioning site collections using SP App model in on-premises with just CSOM 
    Another option,  I suggest you can use admin web service for SharePoint 2013 to create a site collection.
    Here is a detailed article for your reference:
    Admin.CreateSite method
    Thanks
    Best Regards
    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]

  • How to set version limit for entire site collection

    Hi,
    We have more than 500 document libraries in one site collection. I see some of them have more than 50 versions & taking lot of storage space. So planning to limit the version's to 3 Major and 3 Minor for entire site collection. How can we do that? I
    know we can set to individual library by how can we do that for entire site collection?
    Thanks
    Rithu.
    Rithu

    The version limit is a library specific setting, so you'll need to use PowerShell to set the property value on each library in every site in the site collection.  Here's a sample script that sets if for one library.  You'll need to expand the script
    to walk the sites recursively and run this for every library.  
    https://consultantpoint.wordpress.com/2012/06/15/powershell-setconfigure-document-library-with-majorversionlimit-majorwithminorversionslimit-require-to-checkout-before-editing/
    Please Note: Changing these settings won't delete old versions.  That only happens after each item in the list or library is edited.  
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • How to get the user created at and modified at properties for a site collection using powershell

    Hi guys, I Know how to get the list of users of a site collection by Get-SPUser cmdlet but hte problem is that this cmdlet doesnt give me the user Created at and modifed at properties 
    can any one tell me how to get these values via powershell???? 
    ps: ignore the 2013 screenshot.. i just want a way to get those values .. if you provide me solution in either 2010 or 2013 , i will crack the other..
    plz guys help me ...

    Get the User Information list and then get the user from that list
    $web = Get-SPWeb "siteUrl"
    $userInfoList = $web.SiteUserInfoList
    $userItem = $userInfoList.Items[0]; #0 here is just for demonstration. You take the user you want here or loop through all users.
    $created = $userItem["Created"]
    $modified = $userItem["Modified"]

  • How to set security group as primary site collection admin and secondary site collection admin using powershell in sharepoint online site - office 365?

    How to set security group as primary site collection admin and secondary site collection admin using powershell in sharepoint online site - office 365?

    Hi,
    According to your description, my understanding is that you want to set security group as admin of primary and secondary site collection using PowerShell command in office 365.
    I suggest you can use the command below to set the group to site owner, then it will have the site collection admin permission.
    Set-SPOSite -Identity https://contoso.sharepoint.com/sites/site1 -Owner [email protected] -NoWait
    Here are some detailed articles for your reference:
    https://technet.microsoft.com/en-us/library/fp161394(v=office.15)
    http://blogs.realdolmen.com/experts/2013/08/16/managing-sharepoint-online-with-powershell/
    Thanks
    Best Regards
    Jerry Guo
    TechNet Community Support

  • Creating new site collection using wsp template fails

    Hi all,
    I'm creating new site collections using a wsp solution generated by "save as template".
    For site collection creation I select "<Select template later>" then I upload the wsp solution.
    Everything worked until last month, now after CU installation (agoust 2014) I get an error:
    "List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user."
    Does anyone know how to solve it?
    Thanks 
    Maurizio

    ULS contains a lot of those errors:
    System.IO.FileNotFoundException: <nativehr>0x80070002</nativehr><nativestack></nativestack>, 
    StackTrace:
         in Microsoft.SharePoint.SPWeb.GetList(String strUrl)
         in Microsoft.SharePoint.SPWeb.TryGetListByUrl(String url)
         in Microsoft.SharePoint.SPFieldElement.PerformFixUpIfLookUpField(Guid fieldId, XmlNode xmlNodeOfAField, SPWeb web)
         in Microsoft.SharePoint.SPFieldElement.ElementActivated(SPFeaturePropertyCollection props, SPSqlCommand sqlcmdAppendOnly, SPWebApplication webApp, SPSite site, SPWeb webNull, Boolean fForce)
         in Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionFieldsAndContentTypes(SPFeaturePropertyCollection props, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)
         in Microsoft.SharePoint.Administration.SPElementDefinitionCollection.ProvisionElements(SPFeaturePropertyCollection props, SPWebApplication webapp, SPSite site, SPWeb web, SPFeatureActivateFlags activateFlags, Boolean fForce)
         in Microsoft.SharePoint.SPFeature.Activate(SPSite siteParent, SPWeb webParent, SPFeaturePropertyCollection props, SPFeatureActivateFlags activateFlags, Boolean fForce)
         in Microsoft.SharePoint.SPFeatureCollection.AddInternal(SPFeatureDefinition featdef, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean fMarkOnly)
         in Microsoft.SharePoint.SPFeatureCollection.AddInternalWithName(Guid featureId, Int32 compatibilityLevel, String featureName, Version version, SPFeaturePropertyCollection properties, SPFeatureActivateFlags activateFlags, Boolean force, Boolean
    fMarkOnly, Boolean fIgnoreMissing, SPFeatureDefinitionScope featdefScope)
         in Microsoft.SharePoint.SPFeatureManager.EnsureFeaturesActivatedCore(SPSite site, SPWeb web, String sFeatures, Boolean fMarkOnly, Boolean fIgnoreMissing)
         in Microsoft.SharePoint.SPFeatureManager.<>c__DisplayClass7.<EnsureFeaturesActivatedAtWeb>b__6()
         in Microsoft.SharePoint.SPSecurity.RunAsUser(SPUserToken userToken, Boolean bResetContext, WaitCallback code, Object param)
         in Microsoft.SharePoint.SPFeatureManager.EnsureFeaturesActivatedAtWeb(Byte[]& userToken, Guid& tranLockerId, Int32 nZone, Guid databaseid, Guid siteid, Guid webid, String sFeatures, Boolean fIgnoreMissing)
         in Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String&
    bstrWebTemplate, Int32& plWebTemplateId)
         in Microsoft.SharePoint.Library.SPRequestInternalClass.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String&
    bstrWebTemplate, Int32& plWebTemplateId)
         in Microsoft.SharePoint.Library.SPRequest.ApplyWebTemplate(String bstrUrl, String bstrWebTemplateContent, Int32 fWebTemplateContentFromSubweb, Int32 fDeleteGlobalListsWithWebTemplateContent, Int32 fIgnoreMissingFeatures, String& bstrWebTemplate,
    Int32& plWebTemplateId)
         in Microsoft.SharePoint.SPWeb.ProvisionWebTemplate(SPWebTemplate webTemplate, String webTemplateToUse, SPFeatureWebTemplate featureWebTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection`1&
    featureDependencyErrors)
         in Microsoft.SharePoint.SPWeb.ApplyWebTemplate(SPWebTemplate webTemplate, Page page, SPFeatureDependencyErrorBehavior featureDependencyErrorBehavior, ICollection`1& featureDependencyErrors)
         in Microsoft.SharePoint.SPWeb.ApplyWebTemplate(String strWebTemplate)

  • Delete site collection using Client object model

    Is it possible to delete a site collection using Client object model?
    -Prashant

    I don't think you can create or delete a site-collection using SharePoint Client Object Model. You'd need to leverage admin web services (
    http://Site/_vti_adm/Admin.asmx) (or) server-side object model (or) powershell for this task.
    Please mark the replies as answers if they help or unmark if not.

  • How to extract audit log data from every document library in site collection using powershell?

    Hi All,
    I have n number of document library in one site collection,
    My query is- How to extract audit log data from every document library in a site collection using powershell?
    Please give solution as soon as possible?

    Hi inguru,
    For SharePoint audit log data, These data combine together in site collection. So there is no easy way to extract audit log data for document library.
    As a workaround, you can export the site collection audit log data to a CSV file using PowerShell Command, then you can filter the document library audit log data in Excel.
    More information:
    SharePoint 2007 \ 2010 – PowerShell script to get SharePoint audit information:
    http://sharepointhivehints.wordpress.com/2014/04/30/sharepoint-2007-2010-powershell-script-to-get-sharepoint-audit-information/
    Best Regards
    Zhengyu Guo
    TechNet Community Support

  • Is there any way to set a property for all existing Form Fields of a particular type (Che

    In versions of Acrobat prior to version 9, selecting a particular form tool (Textbox, Checkbox), etc. would only display Fields of that particular type in the Acrobat Designer (not LiveCycle).
    If one wanted to change a particular property of all check boxes for example, one would select the Checkbox Tool, Click Edit>Select All>Right Click one of the Checkboxes and Set the Property for all of the Form's Checkboxes.
    Selecting a particular form tool in the Acrobat (not Lifecycle) Designer in version 9 appears to no longer filter the display to that particular form field type. Is there any way to display only 1 particular form field type in or set a particular property for all existing Form Fields of a particular type (Check Box, Text Box, etc.) in Acrobat 9?

    Thanks for the tip..Am aware of this option and have used JavaScript to batch change properties in the past...
    Am looking for a way to replicate the interactive procedure available in previous versions.  Also, want a way to only display certain Form Field types (use this when analyzing forms which I didn't create).

  • Incoming Email for a site collection larger than 25GB

    Hello,
    Incoming emails on a site collection not getting to document library. It stays in drop folder. Uls logs shows below message:
    The Incoming E-Mail service has completed a batch. The elapsed time was 00:00:00. The service processed 2 message(s) in total. Errors occurred processing 2 message(s): Message ID: Message ID: 0511e09c-fe1b-d07e-a534-adcbf7e5cfbe.
    I have researched but haven't found anything. Incoming email works for other site collections in the farm with smaller size compare to that is not working. Site collection that is not receiving incoming email is size larger than 25G. There is no size
    quota restriction.
    Is there any restriction for incoming email for site collection larger than 25G?
    Thanks,
    Hp

    try these links it may be useful:
    https://social.technet.microsoft.com/Forums/office/en-US/510a203e-6ed9-436e-a8d4-f7daaf0e6adb/problem-with-incoming-emails?forum=sharepointadminlegacy
    https://social.technet.microsoft.com/Forums/office/en-US/1e6cf316-ca56-4d9e-a778-938deca5b283/incoming-email-problem-mail-in-drop-and-mailbox-folder-but-not-in-list?forum=sharepointadminlegacy
    http://blogs.technet.com/b/praveenh/archive/2012/06/28/unable-to-send-emails-to-lists-and-document-libraries-in-sharepoint-2010.aspx
    http://serverfault.com/questions/37018/unknown-alias-error-with-sharepoint-incoming-e-mail
    Please mark as answer if you find it useful else vote for it if it is close to answer..happy sharepointing

  • Setting Importance Level for a email message using javax.mail.* API

    Setting Importance Level for a email message using javax.mail.* API
    From what I understand we can set Flag on Email Message. How can we set Importance Leve: High/Low for an email message?
    Thanks
    Purvi

    Most of the message Flags work only for IMAP mailboxes. POP3 supports only the DELETED flag. It must be understood that Javamail is a framework which provides all the features available in a standard mailing system. But whether or not a particular feature works is a functionality of the particular implementation being used.
    Thus for example POP3 cannot differentiate read from unread messages in a mailbox though Javamail provides that feature.

  • Creating multiple subscriptions for collaborative site collections under same OU in multi-tenancy

    Hi,
    We have an application that creates host based collaborative site collections and MySite Host site collections. We have created two separate web applications for hosting collaborative site collections and Mysite host based site collections as recommended
    by MS.
    For creation of collaborative site collections, we are creating separate site subscriptions for separate site collections. For example, if a tenant has two collaborative site collections as CSC1 and CSC2, then two site subscriptions are created for two CSCs
    under the same tenant. The reason behind the implementation is as follows:
    There is a 1:1 mapping with the featurepack and site subscription. Now if two site collections are created under the same site subscription, then altering the feature pack of any site collection will affect the other one. Whereas, if separate subscriptions
    are created fro separate site collections, then altering the featurepack of any site collection will not affect the other site collections.
    Now, my concern is, will the basic functionalities of SharePoint, like search, user profile, etc, will break for the above implementation. Is there any technical hazard for the above implementation.
    A quick response is appreciated, as we need to deliver a customer  ASAP.
    Thanks in advance,
    Arnab

    Search and UPSA would be part of the Site Subscription, so I'm unsure as to what you're specifically asking.
    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.

  • Powershell script to get Audit log settings for all site collections.

    Hi all,
    I am facing issue to get audit log details for all site collection across the farm with the below script. Could someone help me change the script.
    Function AuditValue($url)
    $site=Get-SPSite $url
    auditMask = $site.audit.auditflag
    return auditMask
    Get-SPSite -Limit All | Get-SPWeb -Limit All |
    Select Title,Url,AuditValue(Url)| export-csv "D:\scripts\Test\AuditDetails.csv" -notypeinformagettion
    Thanks Basva

    What errors are you getting? That is if any.
    Scrap that I see a few.
    Not had time to fix it fully. As I am now done at work, but this will help you on your way. It gets back only the audit flag value at the moment.
    Function AuditValue
    $site = Get-SPWeb "http://server" -limit ALL
    foreach($i in $site)
    $auditMask = $site.audit
    $list = $auditMask
    $list | Select-object auditflags
    AuditValue | out-file "C:\temp\AuditDetails.csv"
    EDIT::
    Function AuditValue
    $site = Get-SPWeb "http://SERVER" -limit ALL
    foreach($i in $site)
    $auditMask = $site.audit
    $list = $auditMask
    $list | Select-object @{Name="URL"; Expression ={$site.url}}, auditflags
    AuditValue | out-file "C:\temp\AuditDetails.csv"
    The above will also put URL 
    If this is helpful please mark it so. Also if this solved your problem mark as answer.

  • Set layout property for dynamic group element

    hi ,
         I am creating group ui element dynamically . can any one plz tell me how to set layout property for group as gridlayout DYNAMICALY??
    Kavita

    Hi,
    Following is the skeleton of the code you need.
    IWDTransparentContainer container = view.getElement("<Your container>");
           IWDGridLayout gridLayout = container.createLayout(IWDGridLayout.class);
           gridLayout.setCellPadding(cellPadding);
           gridLayout.setCellSpacing(cellSpacing);
           IWDTransparentContainer container = null;
           IWDGridData grid = container.createLayoutData(IWDGridData.class);
           grid.setHAlign(hAlign);
           grid.setVAlign(vAlign);
           grid.setPaddingRight(paddingRight)
           grid.setPaddingRight(paddingRight)
           grid.setWidth(width)
    Regards
    Ayyapparaj

  • Is it possible to update standard rate for an enterprise resource using CSOM

    We are facing issues while updating standard rate for any enterprise resource using CSOM. The field standard rate is not available in the enterprise resource. Is it possible to update the standard rate for any resource using CSOM ? 
    Thanks in advance for any help.

    Hi Vikas,
    You can do it via the PSI.
    Please find below a blog post with a PSI code sample for updating the resources standard rate:
    https://epmxperts.wordpress.com/2011/01/30/update-resource-cost-rate-using-psi/
    In addition, here is a blog post by Brian about a PSI bug while updating the resource rate:
    http://blogs.technet.com/b/projectsupport/archive/2013/02/12/project-server-resource-rates-changed-with-psi-not-seen-in-project-professional.aspx
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

Maybe you are looking for

  • Retention Scenario

    Hi Here we hv a scenario as Retention. Client will order a service to vendor for Rs. 10000/- in this the retention amount is 10% that is Rs 1000/- is the retention money. In the PO we need to mention that. Client will pay to vendor upto Rs 9000/- the

  • Can LR 4 use Bridge CS5 Metadata Templates?

    I have generated approx 30 + Metadata Templates in Bridge CS5 and I want to see if I can speed up my work flow when working in Lightroom 4. So I suppose the question is ; is it possible to achieve the apparent impossible or is there a solution? Thank

  • Scope when using a JavaBean with JSP

    what is the meaning of this question .....? "Which of the following can not be used as the scope when using a JavaBean with JSP? " question 4 site :http://java.sun.com/developer/Quizzes/jsptut/

  • Audit View Count (By opening, by Running,By Clicking a link)

    Hi, Running the query below and need to know if this one would give the exact count of any report viewed by running manually the report or view from instance or view by clicking a viewer link sent via email. Any help or ideas appreciated. I'm assumin

  • Captivate 3 - Assessment Mode

    I've recorded an assessment mode of a software simulation but cannot get the user results ("the grade") to display. Is this even possible or are grades only reflected from quiz slides?