none
Using Powershell to change the HTML Field Security RRS feed

  • Question

  • I am working on a Powershell script that will allow us to, via request provision site collections to the various BI teams within our institution.  As part of our provisioning we need to disable the ability of contributors to be able to insert iframes from external domains into pages on their site.

    I have looked everywhere for this info and have not had any luck finding it.  The closest I came to it was powershell code on how to add add allowable domains to the list.  I am looking to, via Powershell, be able to change the setting to be disabled.

    Any assistance would greatly appreciated!

    Thanks!

    Thursday, November 20, 2014 3:56 PM

Answers

  • You can enable and disable external domain using SPSite.AllowExternalEmbedding property

    $site = Get-SPSite -Identity <URL>;
    $site.AllowExternalEmbedding = 
    [Microsoft.SharePoint.ScriptSafeExternalEmbedding]::None;
    
    $site.AllowExternalEmbedding = [Microsoft.SharePoint.ScriptSafeExternalEmbedding]::AllowedDomains;
    


    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

    • Marked as answer by jschuhdodge Monday, November 24, 2014 2:52 PM
    Friday, November 21, 2014 6:55 AM

All replies

  • You can enable and disable external domain using SPSite.AllowExternalEmbedding property

    $site = Get-SPSite -Identity <URL>;
    $site.AllowExternalEmbedding = 
    [Microsoft.SharePoint.ScriptSafeExternalEmbedding]::None;
    
    $site.AllowExternalEmbedding = [Microsoft.SharePoint.ScriptSafeExternalEmbedding]::AllowedDomains;
    


    This post is my own opinion and does not necessarily reflect the opinion or view of Slalom.

    • Marked as answer by jschuhdodge Monday, November 24, 2014 2:52 PM
    Friday, November 21, 2014 6:55 AM
  • Thanks Guru Karnik, worked like a champ!

    -Jason


    J. Schuh-Dodge

    Monday, November 24, 2014 2:52 PM