How to add the Note board web part to a page with powershell

Hi everyone,
I've been looking around everywhere but haven't seen it explicitly mentioned. 
Does anyone know how to add the Note Board web part to a Team Site page, e.g. Non-publishing site, Left Zone, First webpart in the zone in powershell?
Examples like this one http://adicodes.com/adding-web-part-to-page-with-powershell/ only talk about custom web parts uploaded from a local drive.
The example here looks good - http://spcrew.com/blogs/lists/posts/post.aspx?id=21 but is it for the Page Viewer Web Part. How would you go about getting the correct name for the note board web part and configuring it? 
Many Thanks,
Ashley
function main(){
[void][System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
$url = "http://sp2010dev1/sites/test1"
$OpenWeb = Get-SPWeb $url
$OpenWeb
$OpenSite = Get-SPSite $url
$file = $OpenWeb.GetFile("http://sp2010dev1/sites/test1/SitePages/test1.aspx")
$WebPartManager = $file.GetLimitedWebPartManager([System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
Add-PageViewerWebPart "http://sp2010dev1/sites/test1" "http://sp2010dev1/sites/test1/SitePages/test1.aspx" "Body" 0 "SPCrew Site" "sp2010dev"
$OpenWeb.Dispose()
function Add-PageViewerWebPart($SiteURL, $pageUrl, $webpartzone, $index, $title, $content)
    $site = new-object Microsoft.SharePoint.SPSite($SiteURL)
    $web=$site.OpenWeb()
    $webpartmanager=$web.GetLimitedWebPartManager($pageUrl, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
    $webpart = new-object Microsoft.SharePoint.WebPartPages.PageViewerWebPart
    $webpart.ChromeType = [System.Web.UI.WebControls.WebParts.PartChromeType]::TitleOnly;
    $webpart.Title = $title
    $webpart.ContentLink = "http://www.spcrew.com";
    $webpartmanager.AddWebPart($webpart, $webpartzone, $index);    
    $web.Close()
    $site.Close()
function Get-SPSite([string]$url) {
    New-Object Microsoft.SharePoint.SPSite($url)
function Get-SPWeb([string]$url) {
    $SPSite = Get-SPSite $url
    return $SPSite.OpenWeb()
    $SPSite.Dispose()

Hi,
According to your post, my understanding is that you wanted to add the Note board web part to a page with PowerShell.
The name of the Note Board web part is SocialCommentWebPart.
I recommend to use the powershell code below:
$pageUrl="http://sitename/SitePages/test.aspx"
$SiteURL="http://sitename"
$site = new-object Microsoft.SharePoint.SPSite($SiteURL)
$web=$site.OpenWeb()
$webpartmanager=$web.GetLimitedWebPartManager($pageUrl, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
$webpart = new-object Microsoft.SharePoint.Portal.WebControls.SocialCommentWebPart
$webpart.title="Note Board"
$webpartmanager.AddWebPart($webpart, "MiddleZone", 0);
$web.Close()
Then the Note board web part will be added to the page.
Best Regards,
Linda Li
Linda Li
TechNet Community Support

Similar Messages

  • How to add a list views web part to a page?

    Hello,
    I have web parts on a page that are "List Views".  The show links as menu from a custom list of links on a page.  However, I don't know how the developer added them to page and how they work.  I like to add other list views
    that list links from lists.
    Paul

    Hi,
    Your query is to configure a webpart in a page which will display all the links to lists (within the site)? If this is the requirement you can configure a dataformwebpart and configure the Data
    Source Mode as CrossList.
    Let me know if you have any further questions.
    Thanks!

  • Where is the SharePoint 2013 Note Board Web Part?

    Was the Note Board web part deprecated in SP 2013? I don't see it under Social Computing web parts.
    Thanks,
    Chuck

    Hi Jasper - I added a newfeed webpart on the blank web part page. It is working fine in Post and Replies. But the news feeds are not appearing on my site. I explored that were is it storing data and found it is going in the Microblog list. How can I see
    the news feed on my site? I checked the my-site is configured and working. Other Ideas and Opinions ect.. I can see on my-site. 
    Any thoughts.
    Regards,
    Khushi
    I found out that my-site also has Microblog List. Each site collection has it's microblog list. Site Feed webpart stores data in their respective list. I am wondering if we can show my-site's news feed on my homepage which is in my root site collection.
    Any thoughts.
    Regards,
    Kausar

  • Note Board web part to display comments for explicit Document Set

    I guess my question falls under 'Other customization' hence my post here.
    Scenario:
    I have a Document Set content type enabled for a library. At the moment I have a few "folders" [document sets] that contain their respective documents.
    I edited a Document Set welcome page to include a Note Board web part. I edited the Note Board web part by adding a 'URL for note' to be a URL of a random Document Set welcome page while in edit mode.
    (Basically, I went to a 'ABC' document set page, clicked edit page, copied URL from address bar, closed that page, went to 'Customize Welcome Page' for all document sets in that library, edited Note Board web part by pasting the link into its 'URL for note'
    field) 
    Problem:
    Currently, all comments are shared between all document sets (folders). When I go to 'ABC' document set and post a comment, I can see my ABC specific comments in e.g. 'XYZ' document set.
    I want to have comments specific to each document set displayed on a respective page for that document set.
    Solution?
    I realize that I must have gotten an URL for a Note Board web part wrong and it does not filter comments explicit to each document set but fetches the comments from whole the library. My url is currently:
    https://intranet.domain/sitecollection/library/Forms/Machine%20Process%20Pack/docsethomepage.aspx?ID=2&FolderCTID=0x0120D520009EDF2E3A3112B041AC6EC1D4133D77550000C297D6CB32E349A435E04924DC6C58&List=7b052f9c-7e35-4251-b66d-3bcdd2950014&RootFolder=%2Fuk%5Fqhse%2FProcess%20Packs%2FSigma%202345&RecSrc=%2Fuk%5Fqhse%2FProcess%20Packs%2FSigma%202345&PageView=Shared&InitialTabId=Ribbon.WebPartPage&Visi
    I know I have to strip this URL from some parameters, presumably leaving just ID, FolderCTID, List and RootFolder.
    Could someone actually tell me exactly how my URL should look like if I want to display comments only for a given document set on its welcome page?
    Thanks!

    Hi,
    According to your post, my understanding is that you wanted to display comments only for a given document set on its welcome page, not display for all the document sets.
    If so, you should not set the “URL for note” field in the Note Board web part, you can just leave it blank, then when you post a comment in one document set, the others would not display the comment.
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to Resolve Can not Display Web part error using CQWP and a blog

    I have  a SharePoint 2010 site with a home page that has a  CQWP (content Query Web Part) tied to the most recent blog of blog site with a list of blogs.  Randomly, some clients will experience a "Unable to display
    a web part". Our client machines are set up with Roaming profiles that are PKI enabled.  Some users are always able to see the resulting blog on the home page, while other users, experience sporadic ability to see the blog ----getting a
    "Unable to display web part".  Also a client can be on one machine and get the error and then log on to another machine and not get the error. Its also seems that when a new blog is added to the blog list this is when the
    ability to see the blog on the home page may come up as an error.  Our setup is simple:   show items= list/posts, List type=Posts, Content Type Group= List Content Type, Content type=Posts,  no audience targeting, not additonal filters,
    group items by = None Descending,  #columns =1, sort items by =published -descending   Limit # display items = 1,  Gropup style = Default,  itemstyle= image on left,  yes play media links,  Fields to display = titlt
    and Description (body)
     What kind of things could cause the random behavior?  

    Hi,
    According to your description, my understanding is that the error occurred occasionally with the Content Query web part.
    I tested the same scenario in my environment, and the web part worked fine.
    I recommend to verify the things below:
    Did this issue occur with all the Content Query web part? I recommend to create a new Content Query web part to see if the issue still occurs.
    Did this issue occur with all the users who have permission to view the web part?
    Deactivate the Publish feature and then re-activate it to see if the issue still occurs.
    Check the ULS log for detailed error message.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • How to add drop down list through personalization on seeded page with value

    Hi All
    I am trying add add drop down list through personalization on seeded page with value
    I have go through with anill passi's block
    still I am getting problem to create

    I have download that page from server via mds
    but when I open that page in Jdev it doesnt shows any options like
    status
    even I have open that page in xml also but still doesnt shows any options like status
    following is xml file
    <?xml version="1.0" encoding="UTF-8" ?>
    - <!-- dbdrv: exec java oracle/jrad/tools/xml/importer XMLImporter.class java &phase=dat+24 checkfile:~PROD:~PATH:~FILE &fullpath_~PROD_~PATH_~FILE -username &un_apps -password &pw_apps -dbconnection &jdbc_db_addr -userId "1" -rootPackage /oracle/apps/~PROD -rootdir &fullpath_~PROD_mds_directory
    -->
    - <page xmlns="http://xmlns.oracle.com/jrad" xmlns:ui="http://xmlns.oracle.com/uix/ui" xmlns:oa="http://xmlns.oracle.com/oa" xmlns:user="http://xmlns.oracle.com/jrad/user" file-version="$Header: VacSrchPG.xml 120.3 2006/04/27 09:08:34 gganesan noship $" version="9.0.3.8.7_942" xml:lang="en-US">
    - <content>
    - <oa:pageLayout helpTargetAppShortName="per" id="IRC_VAC_SEARCH_PAGE" akRegionCode="IRC_VAC_SEARCH_PAGE" regionName="Vacancy Search Page" shortDesc="Page to enable managers to search for vacancies" amDefName="oracle.apps.irc.vacancy.server.VacancySearchAM" controllerClass="oracle.apps.irc.vacancy.webui.IrcVacSearchCO" helpTarget="PER_vacancy_VacSrchPG" function="IRC_CM_VACANCY_SEARCH" windowTitle="Vacancies" title="Vacancies">
    - <ui:corporateBranding>
    <oa:image id="corporateBranding" source="/OA_MEDIA/FNDSSCORP.gif" />
    </ui:corporateBranding>
    - <ui:productBranding>
    <oa:image id="productBranding" source="/OA_MEDIA/IRCBRAND.gif" />
    </ui:productBranding>
    - <ui:contents>
    <oa:query mode="autoCustomizationCriteria" dispSimple="true" dispCustomized="true" prompt="Search" id="VacancySearchQuery" user:akAttributeCode="FND_NESTED_REGION1" user:akAttributeApplicationId="0" extends="/oracle/apps/irc/vacancy/webui/VacSrchQueryRN" />
    <oa:formParameter id="IrcAction" adminCustomizable="false" user:akAttributeCode="FND_ACTION_NAME" user:akAttributeApplicationId="0" />
    <oa:formParameter id="IrcActionValue" adminCustomizable="false" user:akAttributeCode="FND_PRIMARY_KEY_VALUE" user:akAttributeApplicationId="0" />
    <oa:formParameter id="IrcActionType" adminCustomizable="false" user:akAttributeCode="FND_ACTION_TYPE" user:akAttributeApplicationId="0" />
    <oa:formParameter id="IrcFunction" adminCustomizable="false" user:akAttributeCode="FND_FUNCTION_NAME" user:akAttributeApplicationId="0" />
    <oa:formValue prompt="IRC_VAC_SEARCH_FLEX_PAGE" id="VacancyIdFlexDrill" promptTranslationExpansion="100%" user:akAttributeCode="FND_LINK_1" user:akAttributeApplicationId="0" />
    <oa:formValue id="IRC_SEARCH_INSTR_TEXT" rendered="false" />
    </ui:contents>
    - <ui:copyright>
    <oa:messageStyledText id="ICX_COPYRIGHT" extends="/oracle/apps/irc/common/webui/StandardFooterRN.ICX_COPYRIGHT" />
    </ui:copyright>
    - <ui:privacy>
    <oa:link id="ICX_PRIVACY" extends="/oracle/apps/irc/common/webui/StandardFooterRN.ICX_PRIVACY" />
    </ui:privacy>
    </oa:pageLayout>
    </content>
    </page>

  • "One or more field types are not installed properly" when I try to add a second discussion board web part to a page

    I have a SharePoint 2010 site with two discussion boards. I added one additional field to each of the boards: a lookup to another list to link the discussions to individual projects. I need 2 different boards because they have different posting permissions
    (one is open to all for comments, and one is open only to the project team to post but everyone can read).
    When I go to the pages for each of the discussion boards, they work fine.
    But I'm putting together a page for individual projects, and want to have web parts for both discussion boards on the same page, showing the discussions related to the selected project.
    I am able to add one of the discussion boards to a web part in the page, but when I add the second discussion board to the page, the new web part contains:
    One or more field types are not installed properly. Go to the list settings page to delete these fields.
    Correlation ID: blah blah blah
    I've searched for similar postings, but mostly I see this error message related to migration from 2007 to 2010 -- this is not the case here: I created both discussion boards, and the whole site, in SP 2010. I've also found this message related
    to coding errors using SPQuery. I am not doing any coding here, just using the built-in SharePoint 2010 Edit Page -> add a web part -> select the discussion list.  I tried doing it from SPD with the same result. 

    I figured it out. I was using ?FilterField1=fieldname&FilterValue1=value on the URL to the page to pick out one project number. The web part I was trying to add was for a list that did not have that particular fieldname. I didn't realize that would matter
    since I was using the Connections -> Get Filter Values From to get my filter values from the main web part, which does have that fieldname.
    I added a field with that fieldname to the other list and set a workflow to copy the lookup value of the project number lookup field into the new field. Now all is working fine.  Sorry for the wild geese in my original question.

  • How to add connection between two Web Part Data Views in sharepoint designer 2013

    Hi I have problems with connect two data view
    I have a SQL server database named Mini
    In Mini database I have two tables:  dbo.Table_A and dbo.Table_B
    Table_A design and Table_B design
    In the internet browser it look like this after I add the connections, the problem is there is no connection when I click at the Blue link id 2 and 3 ??? John's and Jes's Lastname did not show up, the links is dead. that's my problem
    The must strange is that, if I do the same below, in sharepoint 2010 designer it do well ?? so what in the .....
    Here is my code
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <%@ Page Language="C#" inherits="Microsoft.SharePoint.WebPartPages.WebPartPage, Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register tagprefix="SharePoint" namespace="Microsoft.SharePoint.WebControls" assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register tagprefix="WebPartPages" namespace="Microsoft.SharePoint.WebPartPages" assembly="Microsoft.SharePoint, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <html dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
    <meta name="ProgId" content="SharePoint.WebPartPage.Document" />
    <meta name="WebPartPageExpansion" content="full" />
    <meta http-equiv="X-UA-Compatible" content="IE=10" />
    <SharePoint:CssRegistration Name="default" runat="server"/>
    </head>
    <body>
    <form id="form1" runat="server">
    <table width="10%"><tr><td>
    <WebPartPages:SPWebPartManager runat="server" id="SPWebPartManager">
    <SPWebPartConnections>
    <WebPartPages:spwebpartconnection ID="g_1660BB6ADC7243088A1BB7F5C196203A" ConsumerConnectionPointID="DFWP Filter Consumer ID" ConsumerID="g_2abfc8f5_0eb3_4711_a5b0_7e7518f56881" ProviderConnectionPointID="DFWP Row Provider ID" ProviderID="g_b70a05bb_a849_423d_8e53_c7ad9ccc18ad">
    <WebPartPages:sprowtoparameterstransformer ProviderFieldNames="@ID" ConsumerFieldNames="@ID" />
    </WebPartPages:spwebpartconnection>
    </SPWebPartConnections>
    </WebPartPages:SPWebPartManager>
    <asp:ScriptManager runat="server" id="ScriptManager"></asp:ScriptManager>
    <WebPartPages:DataFormWebPart runat="server" IsIncluded="True" AsyncRefresh="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="8" Title="Table_A on Mini" PageType="PAGE_NORMALVIEW" __markuptype="vsattributemarkup" __WebPartId="{B70A05BB-A849-423D-8E53-C7AD9CCC18AD}" id="g_b70a05bb_a849_423d_8e53_c7ad9ccc18ad" pagesize="10">
    <DataSources>
    <asp:SqlDataSource id="Table_A_x0020_on_x0020_Mini2" runat="server" __designer:commandsync="true" ProviderName="System.Data.SqlClient" ConnectionString="Data Source=TestMSSQL;User ID=SQLADMIN;Password=079130;Initial Catalog=Mini;" SelectCommand="SELECT * FROM [Table_A] ORDER BY [ID] ASC "/>
    </DataSources>
    <ParameterBindings>
    <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
    <ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/>
    <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
    <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
    <ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
    <ParameterBinding Name="dvt_nextpagedata" Location="Postback;Connection"/>
    <ParameterBinding Name="dvt_curselkey" Location="Postback;Connection" DefaultValue="##init##"/>
    </ParameterBindings>
    <datafields>@ID,ID;@ForeName,ForeName;</datafields>
    <XSL>
    <xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:decimal-format NaN=""/>
    <xsl:param name="dvt_curselkey">##init##</xsl:param>
    <xsl:param name="dvt_apos">'</xsl:param>
    <xsl:param name="ManualRefresh"></xsl:param>
    <xsl:param name="dvt_firstrow">1</xsl:param>
    <xsl:param name="dvt_nextpagedata" />
    <xsl:variable name="dvt_1_automode">0</xsl:variable>
    <xsl:template match="/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
    <xsl:choose>
    <xsl:when test="($ManualRefresh = 'True')">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td valign="top">
    <xsl:call-template name="dvt_1"/>
    </td>
    <td width="1%" class="ms-vb" valign="top">
    <img src="/_layouts/15/images/staticrefresh.gif" id="ManualRefresh" border="0" onclick="javascript: {ddwrt:GenFireServerEvent('__cancel')}" alt="Click here to refresh the dataview."/>
    </td>
    </tr>
    </table>
    </xsl:when>
    <xsl:otherwise>
    <xsl:call-template name="dvt_1"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template name="dvt_1">
    <xsl:variable name="dvt_StyleName">Table</xsl:variable>
    <xsl:variable name="Rows" select="/dsQueryResponse/NewDataSet/Row"/>
    <xsl:variable name="dvt_RowCount" select="count($Rows)"/>
    <xsl:variable name="RowLimit" select="10" />
    <xsl:variable name="FirstRow" select="$dvt_firstrow" />
    <xsl:variable name="LastRow">
    <xsl:choose>
    <xsl:when test="($FirstRow + $RowLimit - 1) &gt; $dvt_RowCount"><xsl:value-of select="$dvt_RowCount" /></xsl:when>
    <xsl:otherwise><xsl:value-of select="$FirstRow + $RowLimit - 1" /></xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
    <xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0"/>
    <xsl:choose>
    <xsl:when test="$dvt_IsEmpty">
    <xsl:call-template name="dvt_1.empty"/>
    </xsl:when>
    <xsl:otherwise>
    <table border="0" width="100%" cellpadding="2" cellspacing="0">
    <tr valign="top">
    <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
    <th class="ms-vh" width="1%" nowrap="nowrap"></th>
    </xsl:if>
    <th class="ms-vh" nowrap="nowrap">ID</th><th class="ms-vh" nowrap="nowrap">ForeName</th></tr>
    <xsl:call-template name="dvt_1.body">
    <xsl:with-param name="Rows" select="$Rows[position() &gt;= $FirstRow and position() &lt;= $LastRow]"/>
    <xsl:with-param name="FirstRow" select="1" />
    <xsl:with-param name="LastRow" select="$dvt_RowCount" />
    </xsl:call-template>
    </table>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:call-template name="dvt_1.commandfooter">
    <xsl:with-param name="FirstRow" select="$FirstRow" />
    <xsl:with-param name="LastRow" select="$LastRow" />
    <xsl:with-param name="RowLimit" select="$RowLimit" />
    <xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
    <xsl:with-param name="RealLastRow" select="number(ddwrt:NameChanged('',-100))" />
    </xsl:call-template>
    </xsl:template>
    <xsl:template name="dvt_1.body">
    <xsl:param name="Rows"/>
    <xsl:param name="FirstRow" />
    <xsl:param name="LastRow" />
    <xsl:for-each select="$Rows">
    <xsl:variable name="CurrentRowKey">
    <xsl:call-template name="dvt.gencurselkey">
    <xsl:with-param name="RowPath" select="." />
    </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="dvt_KeepItemsTogether" select="false()" />
    <xsl:variable name="dvt_HideGroupDetail" select="false()" />
    <xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow) or $dvt_KeepItemsTogether">
    <xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">
    <xsl:call-template name="dvt_1.rowview" >
    <xsl:with-param name="CurrentRowKey" select="$CurrentRowKey" />
    </xsl:call-template>
    </xsl:if>
    </xsl:if>
    </xsl:for-each>
    </xsl:template>
    <xsl:template name="dvt_1.rowview">
    <xsl:param name="CurrentRowKey" />
    <tr>
    <xsl:if test="position() mod 2 = 1">
    <xsl:attribute name="class">ms-alternating</xsl:attribute>
    </xsl:if>
    <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
    <td class="ms-vb" width="1%" nowrap="nowrap">
    <span ddwrt:amkeyfield="" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(''))" ddwrt:ammode="view"></span>
    </td>
    </xsl:if>
    <td class="ms-vb">
    <a target="_self">
    <xsl:attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="href">
    <xsl:variable name="cursel">dvt_curselkey={
    <xsl:call-template name="dvt.gencurselkey">
    <xsl:with-param name="RowPath" select="." />
    </xsl:call-template>
    }</xsl:variable>
    <xsl:variable xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="fields">@ID=<xsl:value-of select="ddwrt:ConnEncode(string(@ID))" /></xsl:variable>
    <xsl:text>javascript:</xsl:text>
    <xsl:value-of select="ddwrt:GenFireConnection(concat('g_2abfc8f5_0eb3_4711_a5b0_7e7518f56881*',$fields),string($cursel))"></xsl:value-of>
    </xsl:attribute>
    <xsl:attribute name="style">
    <xsl:if test="$CurrentRowKey = $dvt_curselkey">font-weight: bold;</xsl:if>
    </xsl:attribute>
    <xsl:value-of select="format-number(@ID, '#,##0.#;-#,##0.#')" />
    </a></td><td class="ms-vb">
    <xsl:value-of select="@ForeName" /></td></tr>
    </xsl:template>
    <xsl:template name="dvt_1.empty">
    <xsl:variable name="dvt_ViewEmptyText">There are no items to show in this view.</xsl:variable>
    <table border="0" width="100%">
    <tr>
    <td class="ms-vb">
    <xsl:value-of select="$dvt_ViewEmptyText"/>
    </td>
    </tr>
    </table>
    </xsl:template>
    <xsl:template name="dvt_1.commandfooter">
    <xsl:param name="FirstRow" />
    <xsl:param name="LastRow" />
    <xsl:param name="RowLimit" />
    <xsl:param name="dvt_RowCount" />
    <xsl:param name="RealLastRow" />
    <table cellspacing="0" cellpadding="4" border="0" width="100%">
    <tr>
    <xsl:if test="$FirstRow &gt; 1 or $LastRow &lt; $dvt_RowCount">
    <xsl:call-template name="dvt_1.navigation">
    <xsl:with-param name="FirstRow" select="$FirstRow" />
    <xsl:with-param name="LastRow" select="$LastRow" />
    <xsl:with-param name="RowLimit" select="$RowLimit" />
    <xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
    <xsl:with-param name="RealLastRow" select="$RealLastRow" />
    </xsl:call-template>
    </xsl:if>
    </tr>
    </table>
    </xsl:template>
    <xsl:template name="dvt_1.navigation">
    <xsl:param name="FirstRow" />
    <xsl:param name="LastRow" />
    <xsl:param name="RowLimit" />
    <xsl:param name="dvt_RowCount" />
    <xsl:param name="RealLastRow" />
    <xsl:variable name="PrevRow">
    <xsl:choose>
    <xsl:when test="$FirstRow - $RowLimit &lt; 1">1</xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$FirstRow - $RowLimit" />
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:variable name="LastRowValue">
    <xsl:choose>
    <xsl:when test="$LastRow &gt; $RealLastRow">
    <xsl:value-of select="$LastRow"></xsl:value-of>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$RealLastRow"></xsl:value-of>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:variable name="NextRow">
    <xsl:value-of select="$LastRowValue + 1"></xsl:value-of>
    </xsl:variable>
    <td nowrap="nowrap" class="ms-paging" align="right">
    <xsl:if test="$dvt_firstrow &gt; 1" ddwrt:cf_ignore="1">
    <a>
    <xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent('dvt_firstrow={1}')" />;</xsl:attribute>
    Start</a>
    <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
    <a>
    <xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={',$PrevRow,'}'))" />;</xsl:attribute>
    <img src="/_layouts/15/images/prev.gif" border="0" alt="Previous" />
    </a>
    <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
    </xsl:if>
    <xsl:value-of select="$FirstRow" />
    - <xsl:value-of select="$LastRowValue" />
    <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
    <xsl:if test="$LastRowValue &lt; $dvt_RowCount or string-length($dvt_nextpagedata)!=0" ddwrt:cf_ignore="1">
    <a>
    <xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={',$NextRow,'}'))" />;</xsl:attribute>
    <img src="/_layouts/15/images/next.gif" border="0" alt="Next" />
    </a>
    </xsl:if>
    </td>
    </xsl:template>
    <xsl:template name="dvt.gencurselkey">
    <xsl:param name="RowPath" />
    <xsl:choose>
    <xsl:when test="$dvt_curselkey = '##init##' and position() = $dvt_firstrow">##init##</xsl:when>
    <xsl:otherwise><xsl:value-of select="ddwrt:ConnEncode(string($RowPath/@ID))" /></xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    </xsl:stylesheet> </XSL>
    </WebPartPages:DataFormWebPart>
    </td></tr><tr><td>
    <WebPartPages:DataFormWebPart runat="server" IsIncluded="True" AsyncRefresh="True" FrameType="None" NoDefaultStyle="TRUE" ViewFlag="8" Title="Table_B on Mini" PageType="PAGE_NORMALVIEW" __markuptype="vsattributemarkup" __WebPartId="{2ABFC8F5-0EB3-4711-A5B0-7E7518F56881}" id="g_2abfc8f5_0eb3_4711_a5b0_7e7518f56881" pagesize="10">
    <DataSources>
    <asp:SqlDataSource id="Table_B_x0020_on_x0020_Mini1" runat="server" __designer:commandsync="true" ProviderName="System.Data.SqlClient" ConnectionString="Data Source=TestMSSQL;User ID=SQLADMIN;Password=079130;Initial Catalog=Mini;" SelectCommand="SELECT * FROM [Table_B] ORDER BY [ID] ASC "/>
    </DataSources>
    <ParameterBindings>
    <ParameterBinding Name="dvt_apos" Location="Postback;Connection"/>
    <ParameterBinding Name="ManualRefresh" Location="WPProperty[ManualRefresh]"/>
    <ParameterBinding Name="UserID" Location="CAMLVariable" DefaultValue="CurrentUserName"/>
    <ParameterBinding Name="Today" Location="CAMLVariable" DefaultValue="CurrentDate"/>
    <ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
    <ParameterBinding Name="dvt_nextpagedata" Location="Postback;Connection"/>
    </ParameterBindings>
    <datafields>@ID,ID;@LastName,LastName;</datafields>
    <XSL>
    <xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal">
    <xsl:output method="html" indent="no"/>
    <xsl:decimal-format NaN=""/>
    <xsl:param name="dvt_apos">'</xsl:param>
    <xsl:param name="ManualRefresh"></xsl:param>
    <xsl:param name="dvt_firstrow">1</xsl:param>
    <xsl:param name="dvt_nextpagedata" />
    <xsl:variable name="dvt_1_automode">0</xsl:variable>
    <xsl:template match="/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
    <xsl:choose>
    <xsl:when test="($ManualRefresh = 'True')">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
    <td valign="top">
    <xsl:call-template name="dvt_1"/>
    </td>
    <td width="1%" class="ms-vb" valign="top">
    <img src="/_layouts/15/images/staticrefresh.gif" id="ManualRefresh" border="0" onclick="javascript: {ddwrt:GenFireServerEvent('__cancel')}" alt="Click here to refresh the dataview."/>
    </td>
    </tr>
    </table>
    </xsl:when>
    <xsl:otherwise>
    <xsl:call-template name="dvt_1"/>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template name="dvt_1">
    <xsl:variable name="dvt_StyleName">Table</xsl:variable>
    <xsl:variable name="Rows" select="/dsQueryResponse/NewDataSet/Row"/>
    <xsl:variable name="dvt_RowCount" select="count($Rows)"/>
    <xsl:variable name="RowLimit" select="10" />
    <xsl:variable name="FirstRow" select="$dvt_firstrow" />
    <xsl:variable name="LastRow">
    <xsl:choose>
    <xsl:when test="($FirstRow + $RowLimit - 1) &gt; $dvt_RowCount"><xsl:value-of select="$dvt_RowCount" /></xsl:when>
    <xsl:otherwise><xsl:value-of select="$FirstRow + $RowLimit - 1" /></xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />
    <xsl:variable name="dvt_IsEmpty" select="$dvt_RowCount = 0"/>
    <xsl:choose>
    <xsl:when test="$dvt_IsEmpty">
    <xsl:call-template name="dvt_1.empty"/>
    </xsl:when>
    <xsl:otherwise>
    <table border="0" width="100%" cellpadding="2" cellspacing="0">
    <tr valign="top">
    <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
    <th class="ms-vh" width="1%" nowrap="nowrap"></th>
    </xsl:if>
    <th class="ms-vh" nowrap="nowrap">ID</th><th class="ms-vh" nowrap="nowrap">LastName</th></tr>
    <xsl:call-template name="dvt_1.body">
    <xsl:with-param name="Rows" select="$Rows[position() &gt;= $FirstRow and position() &lt;= $LastRow]"/>
    <xsl:with-param name="FirstRow" select="1" />
    <xsl:with-param name="LastRow" select="$dvt_RowCount" />
    </xsl:call-template>
    </table>
    </xsl:otherwise>
    </xsl:choose>
    <xsl:call-template name="dvt_1.commandfooter">
    <xsl:with-param name="FirstRow" select="$FirstRow" />
    <xsl:with-param name="LastRow" select="$LastRow" />
    <xsl:with-param name="RowLimit" select="$RowLimit" />
    <xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
    <xsl:with-param name="RealLastRow" select="number(ddwrt:NameChanged('',-100))" />
    </xsl:call-template>
    </xsl:template>
    <xsl:template name="dvt_1.body">
    <xsl:param name="Rows"/>
    <xsl:param name="FirstRow" />
    <xsl:param name="LastRow" />
    <xsl:for-each select="$Rows">
    <xsl:variable name="dvt_KeepItemsTogether" select="false()" />
    <xsl:variable name="dvt_HideGroupDetail" select="false()" />
    <xsl:if test="(position() &gt;= $FirstRow and position() &lt;= $LastRow) or $dvt_KeepItemsTogether">
    <xsl:if test="not($dvt_HideGroupDetail)" ddwrt:cf_ignore="1">
    <xsl:call-template name="dvt_1.rowview" />
    </xsl:if>
    </xsl:if>
    </xsl:for-each>
    </xsl:template>
    <xsl:template name="dvt_1.rowview">
    <tr>
    <xsl:if test="position() mod 2 = 1">
    <xsl:attribute name="class">ms-alternating</xsl:attribute>
    </xsl:if>
    <xsl:if test="$dvt_1_automode = '1'" ddwrt:cf_ignore="1">
    <td class="ms-vb" width="1%" nowrap="nowrap">
    <span ddwrt:amkeyfield="" ddwrt:amkeyvalue="ddwrt:EscapeDelims(string(''))" ddwrt:ammode="view"></span>
    </td>
    </xsl:if>
    <td class="ms-vb">
    <xsl:value-of select="format-number(@ID, '#,##0.#;-#,##0.#')"/>
    </td><td class="ms-vb">
    <xsl:value-of select="@LastName" /></td></tr>
    </xsl:template>
    <xsl:template name="dvt_1.empty">
    <xsl:variable name="dvt_ViewEmptyText">There are no items to show in this view.</xsl:variable>
    <table border="0" width="100%">
    <tr>
    <td class="ms-vb">
    <xsl:value-of select="$dvt_ViewEmptyText"/>
    </td>
    </tr>
    </table>
    </xsl:template>
    <xsl:template name="dvt_1.commandfooter">
    <xsl:param name="FirstRow" />
    <xsl:param name="LastRow" />
    <xsl:param name="RowLimit" />
    <xsl:param name="dvt_RowCount" />
    <xsl:param name="RealLastRow" />
    <table cellspacing="0" cellpadding="4" border="0" width="100%">
    <tr>
    <xsl:if test="$FirstRow &gt; 1 or $LastRow &lt; $dvt_RowCount">
    <xsl:call-template name="dvt_1.navigation">
    <xsl:with-param name="FirstRow" select="$FirstRow" />
    <xsl:with-param name="LastRow" select="$LastRow" />
    <xsl:with-param name="RowLimit" select="$RowLimit" />
    <xsl:with-param name="dvt_RowCount" select="$dvt_RowCount" />
    <xsl:with-param name="RealLastRow" select="$RealLastRow" />
    </xsl:call-template>
    </xsl:if>
    </tr>
    </table>
    </xsl:template>
    <xsl:template name="dvt_1.navigation">
    <xsl:param name="FirstRow" />
    <xsl:param name="LastRow" />
    <xsl:param name="RowLimit" />
    <xsl:param name="dvt_RowCount" />
    <xsl:param name="RealLastRow" />
    <xsl:variable name="PrevRow">
    <xsl:choose>
    <xsl:when test="$FirstRow - $RowLimit &lt; 1">1</xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$FirstRow - $RowLimit" />
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:variable name="LastRowValue">
    <xsl:choose>
    <xsl:when test="$LastRow &gt; $RealLastRow">
    <xsl:value-of select="$LastRow"></xsl:value-of>
    </xsl:when>
    <xsl:otherwise>
    <xsl:value-of select="$RealLastRow"></xsl:value-of>
    </xsl:otherwise>
    </xsl:choose>
    </xsl:variable>
    <xsl:variable name="NextRow">
    <xsl:value-of select="$LastRowValue + 1"></xsl:value-of>
    </xsl:variable>
    <td nowrap="nowrap" class="ms-paging" align="right">
    <xsl:if test="$dvt_firstrow &gt; 1" ddwrt:cf_ignore="1">
    <a>
    <xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent('dvt_firstrow={1}')" />;</xsl:attribute>
    Start</a>
    <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
    <a>
    <xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={',$PrevRow,'}'))" />;</xsl:attribute>
    <img src="/_layouts/15/images/prev.gif" border="0" alt="Previous" />
    </a>
    <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
    </xsl:if>
    <xsl:value-of select="$FirstRow" />
    - <xsl:value-of select="$LastRowValue" />
    <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
    <xsl:if test="$LastRowValue &lt; $dvt_RowCount or string-length($dvt_nextpagedata)!=0" ddwrt:cf_ignore="1">
    <a>
    <xsl:attribute name="href">javascript: <xsl:value-of select="ddwrt:GenFireServerEvent(concat('dvt_firstrow={',$NextRow,'}'))" />;</xsl:attribute>
    <img src="/_layouts/15/images/next.gif" border="0" alt="Next" />
    </a>
    </xsl:if>
    </td>
    </xsl:template>
    </xsl:stylesheet> </XSL>
    </WebPartPages:DataFormWebPart>
    </td></tr></table>
    </form>
    </body>
    </html>

    Hey Bale
    Yes I use sharepoint designer 2013, when I do the same in sharepoint designer 2010, it do well
    No to your question 2, 3 and 4
    See again my picture below her, when I open the internet browser
    in the database you have a table with forename and another table with last name,
    the link between this two table is the id, when I open it is ok, Bens lastname is
    James, Ben James.
    So when I try to click on the blue id number 2 beside John, Johns Last name
    should show up, but it did not, the link is dead. that's my problem the funny about this when I
    do the same procedure see above in sharepoint designer 2010, it do well ?
    Here is my first steps, when you have uploaded the first datasource, you need to save, place your courser
    behind the <asp:ScriptManager runat="server" id="ScriptManager"></asp:ScriptManager> x   PLACE COURSER HER
    THEN you can upload the next datasource, the sharepoint designer automatic generate the code for the grid.
    When you have the two grids inside the aspx file, place your courser behind the first
    <WebPartPages:DataFormWebPart X <---
    then the tab "option" show up and inside here you can add the connections between the two grids.

  • How to add user in administrator group of project server 2010 with powershell command ?

    I want to add one user in Administrator group of Project Server .
    Please let me know how to do this through power shell command.

    Hello,
    You would need to use the PSI in your PowerShell commands. Here is a .Net example to get you started, convert this to PowerShell:
    http://blogs.msdn.com/b/ajjose/archive/2013/05/24/creating-a-project-server-user-and-adding-user-to-a-group-through-psi.aspx
    Examples of PowerShell and the PSI can be found here in some of the scripts:
    http://gallery.technet.microsoft.com/scriptcenter/Update-Server-Lookup-table-bb1ae14f
    http://gallery.technet.microsoft.com/scriptcenter/Create-Server-2010-2013-19bd3cc7
    http://gallery.technet.microsoft.com/scriptcenter/Bulk-create-Server-Sites-784f7b29
    These wont do what you need but will give you an idea of using the PSI in PowerShell
    Paul
    Paul Mather | Twitter |
    http://pwmather.wordpress.com | CPS

  • Sharepoint 2013 Discussion Board Web Part, Subject line link on Home Page does not link to the list view

    I am by no means a SharePoint developer, but I really wanted to customize the discussion board for my site - so I found this link: http://www.codeproject.com/Articles/733164/How-to-create-HelpDesk-on-SharePoint-Online
    I added the columns, like the article said, and then completed the section "Modification of the discussion board views".  I skipped the workflow stuff because while I think it would be useful I wanted to make sure I could get
    the actual customization of the discussion board to work first. 
    My Problem (Just to preface - I followed the above instructions, including disabling the Minimal Download Strategy):
    When I clicked into my discussion board list, I was able to get it to look and function as described for both the subject and flat views. However, when I click on the Subject, from the Discussion Board Web Part on my Home Page, it does not redirect into the
    Discussion Board List Flat View.  Instead, it tries to open the root folder from the Home Page while still using the subject view.  The outcome being an empty discussion board on the Home Page.
    So I decided to create a whole new discussion board to see if that one would work, when I inserted a new Discussion Board Web Part into the Home Page, newly created from the app menu, it used the same custom JS file(plumTickets), even though I never linked
    the discussion board to the JS file. Of course when I went into the newly created Discussion Board list it opened as it does OOTB.
    I am so close it having this work like I have been envisioning.  I just need users to be able to click on a discussion subject from the Home Page and be redirected to the list view of the parent folder (I think that is the correct terminology,
    but it may not be) so they would be able to see any replies and be able to reply.  Please Help Me!!!
    I truly appreciate any help you are able to provide, thank you!

    I figured it out. I was using ?FilterField1=fieldname&FilterValue1=value on the URL to the page to pick out one project number. The web part I was trying to add was for a list that did not have that particular fieldname. I didn't realize that would matter
    since I was using the Connections -> Get Filter Values From to get my filter values from the main web part, which does have that fieldname.
    I added a field with that fieldname to the other list and set a workflow to copy the lookup value of the project number lookup field into the new field. Now all is working fine.  Sorry for the wild geese in my original question.

  • How to change the Discussion board view to facebook posting type view

    hi friends..
    i want to change the discussion board view to facebook posting type.Where multiple discussions and comments on single page as well as all the comments should be in a threaded view and also i want to find a new discussion
    link in same page.
    can any one help me...

    Hi,
    As I understand, you would like to improve discussion board to display all posts on a single page with comments.
    There is no OOB option to customize discussion board. However, there are workarounds:
    You could create a site with Blog site template, and it could meet your requirement. More information about Blog site:
    http://office.microsoft.com/en-in/sharepoint-foundation-help/create-a-blog-HA010378201.aspx
    You could use Note Board web part instead, and customize it to allow reply:
    http://social.technet.microsoft.com/Forums/en-US/f7e466ee-ab53-47c5-9dd9-232e295bca6f/sharepoint-2010-note-board-web-part?forum=sharepointgeneralprevious
    You could customize Discussion Board directly using Content Query Web Part and XSL:
    http://sharepointsolutions.com/sharepoint-help/blog/2013/04/custom-discussion-board-rollup-using-content-query-web-part-and-xsl/
    Regards,
    Rebecca Tu
    TechNet Community Support

  • Applying a User Filter web part to the Project Summary Web Part

    I've been searching for a way to do this but to no avail!
    Is there a way to filter out the Project Summary Web Part to only display MyItems.aspx?
    nothing seems to work.  I have designer 2013, SharePoint 2013, etc.
    Please advise,

    Hi Boxboy,
    Based on your description, my understanding is that you want to only display current user’s tasks in the Project Summary web part. Is it right?
    Project summary web part displays events and tasks in SharePoint 2013. Per my knowledge, we cannot filter the tasks in the OOB Project summary web part.
    More information about Project summary web part:
    http://community.bamboosolutions.com/blogs/sharepoint-2013/archive/2013/07/11/how-to-use-the-project-summary-web-part-in-sharepoint-2013.aspx
    As a workaround, you can filter the orginal tasks list using Current User Filter web part instead of filtering the Project summary web part.
    Or, you can develop your own Project summary web part using code.
    How to create a web part for SharePoint:
    https://msdn.microsoft.com/en-us/library/ee231546.aspx
    Best Regards,
    Wendy
    Wendy Li
    TechNet Community Support

  • SP 2013 - Use PowerShell to Add a Custom Web Part to a Page

    Hello Community,
    I need to add a custom web part to a page using PowerShell - has anyone done this and if so please provide guidance and code examples.
    Thanks!
    Tom
    Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award -
    Linked-In - SharePoint Gypsy

    BTW, here is my current code:
    #$web= Get-SPWeb -Identity "http://c4968397007/sites/BRE"
    $Url = "http://c4968397007/sites/BRE"
    $pageUrl = "/SitePages/Home"
    $webpartzone = 2
    $index = 0
    $fileName = "wp_DistrictHomePage_VisualWebPart1.webpart"
    $web = Get-SPWeb $Url
    $web.AllowUnsafeUpdates=$true
     $webPartGallery = $web.Lists["Web Part Gallery"]
     Write-Host "Searching webpart $fileName in web part gallery"
      if($webPartGallery -eq $null)
       Write-Host("Unable to retrieve Webpartgallery");
     $webpart = $null;
     $webpart=$webPartGallery.Items | ? { $_.Title -eq $fileName}
      if($webpart -eq $null) {
       Write-Host("Unable to retrieve webpart: $fileName") -ForegroundColor Red
     else {
      Write-Host("----------Adding Webpart--------")-ForegroundColor Yellow
      $webpartmanager=$web.GetLimitedWebPartManager($pageUrl, [System.Web.UI.WebControls.WebParts.PersonalizationScope]::Shared)
      $errorMsg = "";
      $xmlReader = New-Object System.Xml.XmlTextReader($webpart.File.OpenBinaryStream());
      $webpart = $webpartmanager.ImportWebPart($xmlReader,[ref]"Error")
      $webpartmanager.AddWebPart($webpart, $webpartzone, $index);
      Write-Host("Webpart is added successfully") -ForegroundColor Green ;
    $SiteURL =$Url
    #---------------Test Page----------------------------
    $PageName="Test.aspx"
    $page=$web.lists["Pages"].Items | ? {$_.Name -eq $PageName}
    $page.File.CheckOut();
    Add-WebPartToPage "$SiteURL/Pages/$PageName" "Header" 0 "My Custom WebPart"
    $page.File.CheckIn("Added Web part to a page");
    $page.File.Approve("Added Web part to a page");
    Tom Molskow - Senior SharePoint Architect - Microsoft Community Contributor 2011 and 2012 Award -
    Linked-In - SharePoint Gypsy

  • How do I set the scope to recursive in the Data View Web Part in SP 2013?

    How do I set the scope to recursive in the Data View Web Part in SP 2013?
    I have items in folders that I would like to display in the data view web part out of their folders.  I know that I need to set the scope to recursive.  I found documentation on how to do it in 2010, but since they removed all views other than
    the code view, I am unsure about how to do so.
    Link to article describing how to do what I am trying to do in 2010:
    https://www.nothingbutsharepoint.com/2009/05/13/data-view-web-part-folders-part-2-aspx/

    Hi,
    In SharePoint Designer 2013, we can click the code of the Data view web part. Then switch the tab to "OPTIONS". And then we can find the Folder Scope option, you can select "Show All Files of All Folders"
    to achieve your requirement.
    Thanks,
    Dennis Guo
    TechNet Community 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]
    Dennis Guo
    TechNet Community Support

  • I am using I phone 4s, I wish to add my contacts from laptop to my Iphone. i tried different ways to sync. but not success. so pleaselet me know how to add the contacts to i cloud?

    I am using I phone 4s, I wish to add my contacts from laptop to my Iphone. i tried different ways to sync. but not success. so pleaselet me know how to add the contacts to i cloud?         

    Are you using a PC or a Mac?
    What application are the contacts in on your laptop?

Maybe you are looking for

  • Error while updating to target type INFOCUBE

    Hi, After BI SP16 Upgrade, we noticed that data load to a cube with DTP (7X DS) with partioning active, it would error out saying, "Error while updating to target " " type INFOCUBE....we applied note '1148007' and did reactivation of related structur

  • How to download data from an internal table to a text

    Hi All, I want to download data  from an internal table to a text file. The fields should be pipe(|) separated. I have tried GUI_DOWNLOAD but it is not taking the field separator. The sample of the desired data that i require should be this way:- 134

  • Combo box in multi level block

    Hi, I am facing one pbm with combo box. I will explain my scenario. Pl help me. In new-form-instance-trigger, opening cursor for fetching item1, item2 from table1; - C1 opening cursor for fetching item3 from table1 based on item1--C2 begin open the l

  • How to migrate the data in AS/400 to Oracle

    I have a customer, they plan to migrate their data from AS/400 DB2 V5R3,V6R1 to Oracle 11g. Since the source system is in production, they can only halt for 48 hours, which way is the fastest? ORACLE workbench can only support to IBM DB2/400 V4R3 and

  • Invalid Number in PL/SQL block

    Hi, Following script is giving INVALID NUMBER error. 'col1' column is of NUMBER datatype. But similar script is working for some other table with the same NUMBER datatype. declare x varchar2 (100) := '1,2,3,4,5'; y number; begin SELECT count (*) into