brooklyn-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From henev...@apache.org
Subject [1/2] brooklyn-library git commit: MS SQL install fixes - Authenticate against non Administrator users - Authenticate through SSP to fix permission errors in on the end of the installation
Date Thu, 25 Feb 2016 05:44:38 GMT
Repository: brooklyn-library
Updated Branches:
  refs/heads/master 0576a6c74 -> cbb58b9ba


MS SQL install fixes
- Authenticate against non Administrator users
- Authenticate through SSP to fix permission errors in on the end of the installation


Project: http://git-wip-us.apache.org/repos/asf/brooklyn-library/repo
Commit: http://git-wip-us.apache.org/repos/asf/brooklyn-library/commit/4a189f41
Tree: http://git-wip-us.apache.org/repos/asf/brooklyn-library/tree/4a189f41
Diff: http://git-wip-us.apache.org/repos/asf/brooklyn-library/diff/4a189f41

Branch: refs/heads/master
Commit: 4a189f41462a101ce12254841f033a0f69cb46d1
Parents: 0576a6c
Author: Valentin Aitken <bostko@gmail.com>
Authored: Wed Feb 17 16:17:21 2016 +0200
Committer: Valentin Aitken <bostko@gmail.com>
Committed: Tue Feb 23 01:14:44 2016 +0200

----------------------------------------------------------------------
 .../brooklyn/entity/database/mssql/installmssql.ps1   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/brooklyn-library/blob/4a189f41/software/database/src/main/resources/org/apache/brooklyn/entity/database/mssql/installmssql.ps1
----------------------------------------------------------------------
diff --git a/software/database/src/main/resources/org/apache/brooklyn/entity/database/mssql/installmssql.ps1
b/software/database/src/main/resources/org/apache/brooklyn/entity/database/mssql/installmssql.ps1
index fcbf54a..a2ecda0 100644
--- a/software/database/src/main/resources/org/apache/brooklyn/entity/database/mssql/installmssql.ps1
+++ b/software/database/src/main/resources/org/apache/brooklyn/entity/database/mssql/installmssql.ps1
@@ -37,9 +37,17 @@ New-Item -ItemType Directory -Force -Path "C:\Program Files (x86)\Microsoft
SQL
 
 Install-WindowsFeature NET-Framework-Core
 
+& winrm set winrm/config/service/auth '@{CredSSP="true"}'
+& winrm set winrm/config/client/auth '@{CredSSP="true"}'
+
 $pass = '${attribute['windows.password']}'
 $secpasswd = ConvertTo-SecureString $pass -AsPlainText -Force
-$mycreds = New-Object System.Management.Automation.PSCredential ($($env:COMPUTERNAME + "\Administrator"),
$secpasswd)
+$mycreds = New-Object System.Management.Automation.PSCredential ($($env:COMPUTERNAME + "\${location.user}"),
$secpasswd)
+
+$exitCode = Invoke-Command -ComputerName $env:COMPUTERNAME -Credential $mycreds -ScriptBlock
{
+    param($driveLetter)
+    $process = Start-Process ( $driveLetter + "setup.exe") -ArgumentList "/ConfigurationFile=C:\ConfigurationFile.ini"
-RedirectStandardOutput "C:\sqlout.txt" -RedirectStandardError "C:\sqlerr.txt" -Wait -PassThru
-NoNewWindow
+    $process.ExitCode
+} -Authentication CredSSP -ArgumentList $driveLetter
 
-$process = Start-Process ( $driveLetter + "setup.exe") -ArgumentList "/ConfigurationFile=C:\ConfigurationFile.ini"
-Credential $mycreds -RedirectStandardOutput "C:\sqlout.txt" -RedirectStandardError "C:\sqlerr.txt"
-Wait -PassThru
-exit $process.ExitCode
+exit $exitCode


Mime
View raw message