View .ps1
$Wcl=New-Object System.Net.WebClient
View httpdownload.ps1
$webCli = new-object System.Net.WebClient
$webCli.Credentials = [System.Net.CredentialCache]::DefaultCredentials
# $webCli.Credentials = new-object System.Net.NetworkCredential(user,pwd,domain)
$webCli.DownloadFile($FileUrl, $LocalFilePath)

Fix SharePoint 2013 Field Link missing from List Content Type, Lookup Field, Additional Fields

You have a List Content Type with a Lookup Field for which you cannot set additional lookup fields from the User Interface.

You can use Powershell (server side) to set the additional lookup fields by explicitely adding a field link object to the target list content type.


SharePoint 2013 Powershell How To Update Modify Lookup Column Field References

When you delete a list referenced from a lookup field, the field stops working, even if you recreate the list with the same name. This is due to the fact that the lookup field referneces the list by ID and not by Title.

Even if from UI interface you can't edit a column definition of a lookup field, you can easily change the lookup definition using Powershell.

The following snippet shows how to change the lookup list and display value of a site column definition. The trick is to work on the XMLSchema of the field and then update the field definition. Note: if you have defined in your lookup field to show additional fields, you have to reset the lookup list for these fields too.


How To PowerShell Active Directory Query using ADSISearcher

Create the new adsisearcher object:

$searcher = [adsisearcher]""

Test searcher:


SharePoint 2013 Pass a Parameter through URL to New Form

You want to pass a parameter value through URL to a new form and populate a field of the item (in this example a lookup field).

  1. Using SPD, create a New Form aspx page (you can also work directly on the NewForm.aspx page).
  2. Using the browser, connect to the aspx page and click Edit.
  3. Insert the Script Editor web part and add the relevant code (see below)
  4. Stop Editing the page (it will be automatically saved), and Cancel the form.

Now, you will be able to call the web page using URL parameter YourField:


SharePoint 2013 Visual Studio Team Foundation Web Parts How To Automatically Refresh Query Results Without Postback Action

You want to refresh the Query Results web parts of Visual Studio Team Foundtion embedded into a web part page, so that every 3 seconds the user has a query updated without having to refresh the entire page. Obviously you want automatically refresh the single web part, not the entire web page.

  1. In Edit mode, search in the web page runtime elements for the keyword "Refresh Results". You should find one or more ie:menuitem elements, many elements as many Query Results web parts you have. See the snippet_menuitem.html below for an example.
  2. The script you are interested to is in the onmenuclick attribute.
  3. After you have taken note of all required onmenuclick values just build you refresher as shown below.

SharePoint 2013 how to CSS Image Sprites: spcommon.png and custom

SharePoint 2013 layouts come with a common image sprite called spcommon.png. We can access this image via CSS sprite with positioning or background technique and reuse standard layout icons in web pages.

The breakdown of css instructions for spcommon.png is documented here:


  1. Build a custom CSS file using the image sprite technique
  2. Upload the custom CSS into the asset folder

SharePoint 2013 How To Javascript Callout Manager

Callouts in SharePoint 2013 are now possible with minimal client side scripting thanks to the new callout.js framework. The fastest method is to embed the code into a code web part.

Useful MSDN starter topic:

In summary:

  1. Make sure to use SP.SOD.executeFunc to call your code when the callout framework has been loaded.
  2. Get an element as launchpoint from the document. If the element is dynamically created via javascript, a DOM get_element is necessary to correctly reference the launchpoint.

SharePoint 2013 How To XSL Link Option List View Web Part

XSL Link option allows to link an XSLT stylesheet uploaded to the site for processing and transforming List View data to which the web part is connetcted.

The input xml passed to XSLT is described here

There are two main ways to work:

  • Just transform input data and render it as wanted
  • Include the default templates and override those as required