Skip to content

Commit

Permalink
[dsccommunity#569] A fix for SQL 2016 virtual directory name change.
Browse files Browse the repository at this point in the history
  • Loading branch information
bozho committed Jun 2, 2017
1 parent b3b3076 commit 091fcc8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased
- Changes to xSQLServerRSConfig
- BREAKING CHANGE: removed $SQLAdminCredential parameter. Use common parameter PsDscRunAsCredential (WMF 5.0+) to run the resource under different credentials. PsDscRunAsCredential Windows account must be a sysadmin on SQL Server (issue #568).
- Fixed virtual directory creation for SQL Server 2016.

## 7.1.0.0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ function Set-TargetResource
}
if($RSConfig.VirtualDirectoryReportManager -ne $RMVirtualDirectory)
{
$null = $RSConfig.SetVirtualDirectory("ReportManager",$RMVirtualDirectory,$Language)
$null = $RSConfig.ReserveURL("ReportManager","http://+:80",$Language)
# SSRS Web Portal application name changed in SQL Server 2016
# https://docs.microsoft.com/en-us/sql/reporting-services/breaking-changes-in-sql-server-reporting-services-in-sql-server-2016
$virtualDirectoryName = if ($SQLVersion -ge 13) { 'ReportServerWebApp' } else { 'ReportManager'}
$null = $RSConfig.SetVirtualDirectory($virtualDirectoryName,$RMVirtualDirectory,$Language)
$null = $RSConfig.ReserveURL($virtualDirectoryName,"http://+:80",$Language)
}
$RSCreateScript = $RSConfig.GenerateDatabaseCreationScript($RSDatabase,$Language,$false)

Expand All @@ -124,8 +127,8 @@ function Set-TargetResource

Invoke-Sqlcmd -ServerInstance $RSConnection -Query $RSCreateScript.Script
Invoke-Sqlcmd -ServerInstance $RSConnection -Query $RSRightsScript.Script
$RSConfig.SetDatabaseConnection($RSConnection,$RSDatabase,2,"","")
$RSConfig.InitializeReportServer($RSConfig.InstallationID)
$null = $RSConfig.SetDatabaseConnection($RSConnection,$RSDatabase,2,"","")
$null = $RSConfig.InitializeReportServer($RSConfig.InstallationID)
}

if(!(Test-TargetResource @PSBoundParameters))
Expand Down

0 comments on commit 091fcc8

Please sign in to comment.