Prepare SharePoint 2013 Server for App development: Create an Isolated App Domain PowerShell Script

There is an excellent article on MSDN called “How to: Set up an on-premises development environment for apps for SharePoint.”
I’ve created a PowerShell script that runs all the required commands for you, please be sure that you run it as administrator. Including the Disable of the loopback check in the registry.

# Check if the execution policy is set to Unrestricted
$policy = Get-ExecutionPolicy
if($policy -ne "Unrestricted"){
	Set-ExecutionPolicy "Unrestricted"
}

# Check if current script is running under administrator credentials
$currentPrincipal = New-Object Security.Principal.WindowsPrincipal( [Security.Principal.WindowsIdentity]::GetCurrent() )
if ($currentPrincipal.IsInRole( [Security.Principal.WindowsBuiltInRole]::Administrator ) -eq $false) { 
	(get-host).UI.RawUI.Backgroundcolor="DarkRed" 
	clear-host 
	write-host "Warning: PowerShell is not running as an Administrator.`n" 
	exit
}

# Load SharePoint powershell commands
Add-PSSnapin "microsoft.sharepoint.powershell" -ErrorAction SilentlyContinue

cls

# Ensure that the spadmin and sptimer services are running
Write-Host
Write-Host "Ensure that the spadmin and sptimer services are running" -ForegroundColor Yellow
net start spadminv4
net start sptimerv4

# Create your isolated app domain by running the SharePoint Management Shell as an administrator and typing the following command.
Write-Host
Write-Host "Create your isolated app domain by running the SharePoint Management Shell as an administrator and typing the following command." -ForegroundColor Yellow
$appdomain = Read-Host "Your App Domain Name"
Set-SPAppDomain $appdomain

# Ensure that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running 
Write-Host
Write-Host "Ensure that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running." -ForegroundColor Yellow
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"} | Start-SPServiceInstance

# Verify that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running 
Write-Host
Write-Host "Verify that the SPSubscriptionSettingsService and AppManagementServiceInstance services are running." -ForegroundColor Yellow
Get-SPServiceInstance | where{$_.GetType().Name -eq "AppManagementServiceInstance" -or $_.GetType().Name -eq "SPSubscriptionSettingsServiceInstance"}

# Specify an account, application pool, and database settings for the SPSubscriptionService and AppManagementServiceInstance services 
Write-Host
Write-Host "Specify an account, application pool, and database settings for the SPSubscriptionService and AppManagementServiceInstance services." -ForegroundColor Yellow
$login = Read-Host "The login of a managed account"
$account = Get-SPManagedAccount $login 
$appPoolSubSvc = New-SPServiceApplicationPool -Name SettingsServiceAppPool -Account $account
Write-Host "SettingsServiceAppPool created (1/6)" -ForegroundColor Green
$appPoolAppSvc = New-SPServiceApplicationPool -Name AppServiceAppPool -Account $account
Write-Host "AppServiceAppPool created  (2/6)" -ForegroundColor Green
$appSubSvc = New-SPSubscriptionSettingsServiceApplication –ApplicationPool $appPoolSubSvc –Name SettingsServiceApp –DatabaseName SettingsServiceDB 
Write-Host "SubscriptionSettingsServiceApplication created  (3/6)" -ForegroundColor Green
$proxySubSvc = New-SPSubscriptionSettingsServiceApplicationProxy –ServiceApplication $appSubSvc
Write-Host "SubscriptionSettingsServiceApplicationProxy created  (4/6)" -ForegroundColor Green
$appAppSvc = New-SPAppManagementServiceApplication -ApplicationPool $appPoolAppSvc -Name AppServiceApp -DatabaseName AppServiceDB
Write-Host "AppManagementServiceApplication created  (5/6)" -ForegroundColor Green
$proxyAppSvc = New-SPAppManagementServiceApplicationProxy -ServiceApplication $appAppSvc
Write-Host "AppManagementServiceApplicationProxy created  (6/6)" -ForegroundColor Green

# Specify your tenant name 
write-host
Write-Host "Set AppSiteSubscriptionName to 'app'" -ForegroundColor Yellow
Set-SPAppSiteSubscriptionName -Name "app" -Confirm:$false
Write-Host "AppSiteSubscriptionName set" -ForegroundColor Green

# Disable the loopbackcheck in the registry
Write-Host "Disable the loopbackcheck in the registry" -ForegroundColor Yellow
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\" -Name "DisableLoopbackCheck" -PropertyType DWord -Value 1

Write-Host "Completed"
VN:F [1.9.22_1171]
Rating: 9.0/10 (21 votes cast)
VN:F [1.9.22_1171]
Rating: +9 (from 9 votes)

Microsoft All-In-One Code Framework – Developers’ Pain Killer

In partnership with MSDN Samples Gallery, Microsoft All-In-One Code Framework this morning is releasing a brand new version for its Sample Browser, which introduces a big search expansion to over 3500 quality code samples, the new Favorite Searches and Favorite Samples functions for managing your beloved samples, the integration of social media sharing, the enriched query conditions & more.

 

Install :  http://aka.ms/samplebrowser

More information: http://blogs.msdn.com/b/codefx/archive/2012/04/16/samplebrowserbigrefresh.aspx

Hope it helps

Tom

 

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

How do I create those Modern UI tiles in SharePoint 2013 (preview) ?

 

Everybody noticed the new metro modern UI tiles when you open a new team site,  however the main question is…

How do I create my own tiles?

Step by step: How do I create Modern UI tiles on my team site?

 

  • Navigate to the site content page
  • Add a new App
  • Select the promoted links App and press Create

 

  • Notice that the view is called tiles.aspx, but allitems.aspx is still available.
  • Add a new item and pressSave.
  • Each new listitem in the promoted links list represents a tile in the list
  • Add this list as a webpart to your homepage

 Summary

No custom coding, no copy paste of html.. nothing so easy as creating a list based on the promoted links template and receiving everything out-of-the-box!

Hope it helps!

Tom

VN:F [1.9.22_1171]
Rating: 8.2/10 (17 votes cast)
VN:F [1.9.22_1171]
Rating: +5 (from 7 votes)

SharePoint 2013 beta – There are 2 layouts and images folders

When you have the beta version of SharePoint 2013 running, you will notice that even if you never installed SharePoint 2010 on your brand new image.
Both the 14 and 15 root folder are available.

This means that we have 2 layouts folders and 2 images folders!

I created 2 small images called test.gif

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\IMAGES\test\test.gif “14 folder”
C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\IMAGES\test\test.gif “15 folder”

When I navigated to http://sp/_layouts/images/test/test.gif the following image is shown

 

But how do we use the content of the 15 directory? Easy!

When we navigate to http://sp/_layouts/15/images/test/test.gif the image in the 15 directory is displayed.

 

Summary

{weburl}/_layouts/ C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\LAYOUTS
{weburl}/_layouts/images C:\Program Files\Common Files\microsoft shared\Web Server Extensions\14\TEMPLATE\IMAGES
{weburl}/_layouts/15/ C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\LAYOUTS
{weburl}/_layouts/15/images C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\IMAGES

 

Hope it helps!

Tom

VN:F [1.9.22_1171]
Rating: 7.9/10 (9 votes cast)
VN:F [1.9.22_1171]
Rating: +4 (from 4 votes)