Wednesday, September 21, 2016

How to get Open Wiki Page by ID in SharePoint 2013 Page



OOB Feature 


  1. Enable "Document ID Service" in the Site Collection Features
  2. New entry in the Site Collection Administration appears: "Document ID settings"
  3. In this menu you can define a prefix for your Document IDs
  4. In any list/library a new column is provided: Document ID (linked to document)
  5. Display this column in a list view --> use the provided URL of this column for linkage



http://test/_layouts/15/DocIdRedir.aspx?ID=DocIDPrefix-SomeNumbers-ID

http://test/_layouts/15/DocIdRedir.aspx?ID=DocIDPrefix-12231-987

what is difference between Name and Account - /_vti_bin/listdata.svc/UserInformationList,



Result:

<content type="application/xml">
  <m:properties>
    <d:Id m:type="Edm.Int32">1</d:Id>
    <d:ContentTypeID>0x010A00F8C6531A37316E499095FDC0720C4D90</d:ContentTypeID>
    <d:ContentType>Person</d:ContentType>
    <d:Name>peakfinders\administrator</d:Name>
    <d:Modified m:type="Edm.DateTime">2015-04-30T16:50:53</d:Modified>
    <d:Created m:type="Edm.DateTime">2015-04-30T16:50:53</d:Created>
    <d:CreatedById m:type="Edm.Int32">1073741823</d:CreatedById>
    <d:ModifiedById m:type="Edm.Int32">1073741823</d:ModifiedById>
    <d:Owshiddenversion m:type="Edm.Int32">1</d:Owshiddenversion>
    <d:Version>1.0</d:Version>
    <d:Path>/_catalogs/users</d:Path>
    <d:Account>i:0#.w|peakfinders\administrator</d:Account>
    <d:EMail m:null="true" />
    <d:MobileNumber m:null="true" />
    <d:AboutMe m:null="true" />
    <d:SIPAddress m:null="true" />
    <d:IsSiteAdmin m:type="Edm.Boolean">true</d:IsSiteAdmin>
    <d:Deleted m:type="Edm.Boolean">false</d:Deleted>
    <d:Hidden m:type="Edm.Boolean">false</d:Hidden>
    <d:Picture m:null="true" />
    <d:Department m:null="true" />
    <d:JobTitle m:null="true" />
  </m:properties>
</content>


Friday, September 16, 2016

How to get attachments from SharePoint list with PowerShell?

SharePoint 2013 it works

$webUrl = "http://peakfinder/"    
$library = "Product Information"
$spSite = new-object Microsoft.SharePoint.SPSite($webUrl)
$w = $spSite.OpenWeb()
$l = $w.Lists[$library]
$resultHashtable = @{}

foreach ($listItem in $l.Items)
{     
    Write-Host "    Content: " $listItem.ID 
    foreach ($attachment in $listItem.Attachments)
    {
        $file = $w.GetFile($listItem.Attachments.UrlPrefix + $attachment)
        $linkAttachment = "http://peakfinder/" + $file.ServerRelativeUrl
        Write-Host "http://peakfinder/"$file.ServerRelativeUrl
        if($linkAttachment){
        $resultHashtable.Add($listItem.ID, $linkAttachment)
        }    
    }    
}
#Export CSV
$resultHashtable.GetEnumerator() | Sort-Object -Property Name -Descending |
Select-Object -Property @{n='SiteURL';e={$_.Name}},Value |
Export-Csv -Path Attachments.csv -NoTypeInformation

How to enable the officewebapps in Sharepoint 2013 using Powershell Script

Get-OfficeWebAppsFarm

Powershell Script
$owaFarm = Get-OfficeWebAppsFarm;
$owaFarm .OpenFromUrlEnabled = $true;

Types of Testing