cd c:\Windows\System32\inetsrv
.\appcmd.exe list wp
SharePoint Governance: To get started, it’s important to have the right conversations! |
SharePoint 2013 development overview |
http://msdn.microsoft.com/en-us/library/ff798413.aspx |
REST in SP2010 |
System.Diagnostics.Debugger.Break();
Optimizing SharePoint sites |
Debugging JQuery |
Enabling JavaScript Intellisense for SharePoint Development |
$list = (Get-SPWeb "http://portal.contoso.com").Lists["Demo List"] $list.Fields | ?{$_.title -eq "Title"} | FT Title, InternalName
Feature area
|
Access point
|
---|---|
Site
|
http://server/site/_api/site
|
Web
|
http://server/site/_api/web
|
User Profile
|
http:// server/site/_api/SP.UserProfiles.PeopleManager
|
Search
|
http:// server/site/_api/search
|
Publishing
|
http:// server/site/_api/publishing
|
Client object model API
|
REST endpoint
|
---|---|
ClientContext.Web.Lists
|
http://server/site/_api/web/lists
|
ClientContext.Web.Lists[guid]
|
http://server/site/_api/web/lists(‘guid’)
|
ClientContext.Web.Lists.GetByTitle("Title")
|
http://server/site/_api/web/lists/getbytitle(‘Title’)
|
url: http://site url/_api/web/lists/GetByTitle(‘Test')/items method: GET headers: Authorization: "Bearer " + accessToken accept: "application/json;odata=verbose" or “application/atom+xml”
url: http://site url/_api/web/lists/GetByTitle(‘Test')/items(item id) method: GET headers: Authorization: "Bearer " + accessToken accept: "application/json;odata=verbose" or “application/atom+xml”
URI Conventions - Filter System Query Option ($filter) |
http://msdn.microsoft.com/en-US/library/office/jj163227#bkmk_constructquery |
jQuery.ajax({
url: "/SiteName/_api/web/lists/getbytitle('ListName')/items",
type: "GET",
headers: { "Accept": "application/json;odata=verbose" },
success: function(data, textStatus, xhr) {
var dataResults = data.d.results;
var resultId = dataResults[0].AuthorId.results[0];
getUser(resultId)
},
error: function(xhr, textStatus, errorThrown) {
alert("error:"+JSON.stringify(xhr));
}
});
function getUser(id){
var returnValue;
jQuery.ajax({
url: "http://YourSite/_api/Web/GetUserById(" + id + ")",
type: "GET",
headers: { "Accept": "application/json;odata=verbose" },
success: function(data) {
var dataResults = data.d;
//get login name
var loginName = dataResults.LoginName.split('|')[1];
alert(loginName);
//get display name
alert(dataResults.Title);
}
});
}
How to Get Login Name and Display Name using SharePoint 2013 REST API
http://www.codeproject.com/Articles/692289/How-to-Get-Login-Name-and-Display-Name-using-Share
Get-SPServiceApplication
$upsa = Get-SPServiceApplication -Id <GUID of User Profile Service Application>Replace <GUID of User Profile Service Application> with the service guid above.
$upsa.NetBIOSDomainNamesEnabled = 1
$upsa.Update()
Use case: Automatically importing user profile pictures to SharePoint 2013 (and 2010) |
Set-SPManagedAccount -UseExistingPassword
# Run with SharePoint 2010 Management Shell$webUrl = Read-Host "Enter the web url"$web = Get-SPWeb $webUrl$list = $web.Lists["User Information List"]$query = New-Object Microsoft.SharePoint.SPQuery$queryCamlString = '<Query><OrderBy><FieldRef Name="Title" Ascending="True" /></OrderBy></Query>'$query.Query = $queryCamlString$userInformationListItems = $list.GetItems($query)foreach($userInformationListItem in $userInformationListItems){echo $userInformationListItem.Title}
# Run with SharePoint 2010 Management Shell$site = Get-SPSite "your URL"$context = Get-SPServiceContext $site$profileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($context)$profiles = $profileManager.GetEnumerator()foreach(($profile in $profiles){$displayName = $profile.DisplayName}