
Here a small script to provision the Business Data Connectivity Service Application-without ugly GUID in the database name.
- Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
- #Settings
- $ServiceName = "BDC Service"
- $ServiceProxyName = "BDC Proxy"
- $AppPoolAccount = "demo\spservices"
- $AppPoolName = "SharePoint Services App Pool"
- $DatabaseServer = "sp2013"
- $DatabaseName = "SP2013 BDC"
- Write-Host -ForegroundColor Yellow "Checking if Application Pool Accounts exists"
- $AppPoolAccount = Get-SPManagedAccount -Identity $AppPoolAccount -EA 0
- if($AppPoolAccount -eq $null)
- {
- Write-Host "Please supply the password for the Service Account..."
- $AppPoolCred = Get-Credential $AppPoolAccount
- $AppPoolAccount = New-SPManagedAccount -Credential $AppPoolCred -EA 0
- }
- Write-Host -ForegroundColor Yellow "Checking wether the Application Pool exists"
- $AppPool = Get-SPServiceApplicationPool -Identity $AppPoolName -ErrorAction SilentlyContinue
- if (!$AppPool)
- {
- Write-Host -ForegroundColor Green "Creating Application Pool"
- $AppPool = New-SPServiceApplicationPool -Name $AppPoolName -Account $AppPoolAccount -Verbose
- }
- Write-Host -ForegroundColor Yellow "Checking if BDC Service Application exists"
- $ServiceApplication = Get-SPServiceApplication -Name $ServiceName -ErrorAction SilentlyContinue
- if (!$ServiceApplication)
- {
- Write-Host -ForegroundColor Green "Creating BDC Service Application"
- $ServiceApplication = New-SPBusinessDataCatalogServiceApplication –ApplicationPool $AppPool –DatabaseName $DatabaseName –DatabaseServer $DatabaseServer –Name $ServiceName
- }
- Write-Host -ForegroundColor Yellow "Starting the BDC Service"
- $ServiceInstance = Get-SPServiceInstance | Where-Object { $_.TypeName -like "*Business*" }
- Start-SPServiceInstance $ServiceInstance
- Write-Host -ForegroundColor Green "Done - BDC Service is up and running."
No comments:
Post a Comment