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 May 30, 2017
1 parent b496b93 commit 6cb2531
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 @@ -64,6 +64,7 @@
- Changes to xSQLServerRSConfig
- Replaced sqlcmd.exe usages with Invoke-Sqlcmd calls (issue #567).
- 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
- Changes to xSQLServerDatabasePermission
- Fixed code style, updated README.md and removed *-SqlDatabasePermission functions from xSQLServerHelper.psm1.
- Added the option 'GrantWithGrant' with gives the user grant rights, together with the ability to grant others the same right.
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 6cb2531

Please sign in to comment.