server config - WSU-GC/sharepoint-2013-docs GitHub Wiki
Server Configurations
RUN ALL POWERSHELL SCRIPTS AS ADMIN
The account running the commands will need to have securityadmin and db_owner roles in sql databases.
App Domain
-
sharepoint example domain: gc-sp.wsu.edu
-
app example domain: gc-sp-apps.com
-
Purchase/setup separate domain from the sharepoint domain for apps.
-
point app domain to sharepoint web server in DNS (forward zone lookup).
- ex: gc-sp-apps.com -> gc-sp.wsu.edu
-
Create wildcard CNAME DNS record for app domain to also point at sharepoint web server.
- ex: *.gc-sp-apps.com -> gc-sp.wsu.edu
-
Obtain a wildcard certificate for the app domain and install it in IIS. Do not manually create the IIS site for this. The IIS site is created through sharepoint in the next step.
Creating a Web App for the App Domain using SSL
Use the New-WebApplication powershell script.
> .\NewWebApplication.ps1
Which will prompt you for the following arguments:
$Name
: The friendly name of the WebApp. Will appear in Central Admin > Web Applications and in IIS.$Url
: This cmdlet is for https WebApps so supply an https url.$account
: provide "domain\account". used to run commands and provision DBs. See note from top of the page about necessary account permissions.$HostHeader
[Optional]: This value will be used as the Server Name Indication in IIS. Leave this blank for the app domain WebApp.
Should see new WepApplication in Central Admin > Application Management > Manage Web Applications. After creating the WepApp space you should see a new IIS site. Bind the wildcard certificate to this site through IIS. If using a self singed cert during development then install the cert on local development machine as a trusted root authority. If this is for the App Domain, ensure that the server name indication is blank in IIS.
References
SPWebApplications are IIS websites, SPSites are site collections and SPWeb are websites. Visit SPWebApplication vs SPSite vs SPWeb for more information.
Create an empty root site collection on the App Domain WebApplication
Run the New-Site powershell script.
> .\New-Site.ps1
Which will prompt you for
$Url
: The url where the site collection should be based on a WebApplication url. ex: https://gc-sp-apps.com/sites/SiteName or https://gc-sp-apps.com. For creating the site collection for the App Domain it should be a root site collection so in our example it should be https://gc-sp-apps.com.$OnwerAlias
: "domain\account" to be the owner of the site collection.$Template
[Optional]: The template to use for the site collection. Defaults to the Team Site template (STS#0). To find possible values runGet-SPWebTemplate
. to find specific template by title:Get-SPWebTemplate | where{$_.Title -eq "Team Site"}
. Provide the Name of the desired template to this function.
Should see new site collection in Central Admin > Application Management > View all site collections.
References
Configure Subscription Settings Service
Run Configure-SubscriptionSettingsService
> .\Configure-SubscriptionSettingsService.ps1
Which will prompt you for
$account
: "domain\account" to run the commands and configure the DBs behind the scenes.
References
- Get-SPServiceInstance
- Set-SPServiceInstance
- New-SPServiceApplicationPool
- New-SPSubscriptionSettingsServiceApplication
- New-SPSubscriptionSettingsServiceApplicationProxy
Configure App Manager Service
Run Configure-AppManagerService
> .\Configure-AppManagerService.ps1
Which will prompt you for
$account
: "domain\account" to run the commands and configure the DBs behind the scenes.
References
- Get-SPServiceInstance
- Set-SPServiceInstance
- New-SPServiceApplicationPool
- New-SPAppManagementServiceApplication
- New-SPAppManagementServiceApplicationProxy
Set App Domain and Prefix
Run Set-AppDomain
> .\Set-AppDomain.ps1
Which will prompt you for
$Domain
: the app domain. Do not include the protocol. ex: gc-sp-apps.com$Prefix
: the prefix to append to the random app ids. ex: app.
References
Create App Catalog
Run the New-Site powershell script. View Create an empty root site collection on the App Domain WebApplication section from above for more information.
-$Url
should be of the sharepoint domain. ex: https://gc-sp.wsu.edu/sites/app-catalog
$Template
should be "APPCATALOG#0". To confirm this runGet-SPWebTemplate | where{$_.Title -like "*catalog*"}
.
COMPLETE!! Should be ready to publish apps
Business Connectivity Services
Needed to start state service, start BCS service, start and configure secure store.
Use the ConfigureBusinessConnectivityService powershell script.
> .\ConfigureBusinessConnectivityService.ps1
This script will set up the state service, the secure store and then the business connectivity service.
note that a target app needs to be manually created within secure store after running this
- Navigate to the Secure Store application service
- Generate a new key - it will prompt you to set a password
- Create a new Target Application
- Enter a unique ID and name, add a contact email and choose 'Group' then click 'Next'
- Leave the default (Windows User Name and Windows Password) fields and click 'Next'
- Add a user to be the admin of the target application
- Add the group of users who you are trying to provide access to as members
- Now you can use the Secure Store to access the protected resource
- In Sharepoint Designer 2013 connect to your site and go to the 'External Content Types' section
- Choose the (new) 'External Content Type' button at the top left to start building your content Type
- Enter a 'Name' and 'Display Name' this is what your content type will be called in Sharepoint
- click the link to '...discover external data sources...'
- click the 'Add Connection' button and choose the data source type (i.e. SQL Server) and click 'OK'
- enter the 'server' and 'database name' and the 'Name' (this is how you will identify the data source in sharepoint designer)
- choose the 'Connect with Impersonated Windows Identity' option and enter the name of your Secure Store Application ID so you can connect through the Secure Store credential mapping configured earlier. then click 'OK' to connect to your data.
- Now you can browse your data source in the 'Data Source Explorer'
- Navigate to a database object that exposes the operation you want to add and right click on it then select the operation you want to add
- The wizard does a pretty good job of walking you through the configuration for each operation
- After you have made your modifications you need to click the 'Save' icon at the top left. This will create the actual 'external content type' so that it exists within sharepoint.
- you can now right click onthe content type and choose to export BDC model which will be helpful if you want to build the content types in development and then import them into production without needing to go back through all of the config steps for each of the entities and necessary opreations
- To import a BDC model into sharepoint you can navigate to Central Admin -> Application Management -> Manage Service Applications -> Business Data Connectivity Service Application (click the name of your specific service app to go to the page where you can manage it) and then choose the 'Import' option at the top left
- The 'Create Lists & Form' option in sharepoint designer will generate the necessary forms that map to the operations you have added. you will need to choose a name for a new list if one does not exist. if editing an existing content type the necessary forms are added/updated when running this command
- Note: we need to do more testing with the edit operations and primary keys to make sure that we have a handle on this
- You will also need to navigate to the BCS application and set object and metadata permissions or you will get an access denied error when viewing your external content type through SharePoint.
this script was tested in pieces, not yet as an entire process
need to add documentaiton showing how to use sharepoint designer to connect to data and publish