Deploy RES ONE Workspace Environment
| 0 Votes |
Description
Property Details
| 10563 | |
| Production - Fully Tested and Ready for Production | |
| Deploy RES ONE Workspace Environment | |
| SYST | |
| RES Software | |
| 3/21/2016 12:00:00 AM | |
| True | |
| RESQA on 3/24/2016 5:00:49 AM | |
| RESQA on 3/24/2016 5:00:49 AM | |
| 3372 Views / 3 Downloads | |
* Average over 0 ratings.
** Log In or Register to add your rating.
|
Relevance
isWindows (Relevance 1172)
windows of operating system
| Used in 24 fixlets | * Results in a true/false |
not exists service "res" or not exists file (pathname of parent folder of parent folder of file of service "res" & "\pwrtech.exe")
| Used in 16 fixlets | * Results in a true/false |
exists service whose (display name of it as lowercase contains "sql server")
Actions
Action 1 (default)
Action Link Click
here to deploy this action.
Script Type
BigFix Action Script
//SourceReleaseDate: 20160321-102103
prefetch RES-ONE-Workspace-2015.msi sha1:4658f00e56b0a94bec013680a1919f42e3385875 size:48315904 http://downloads.ressoftware.com/downloads/cdm/040116/RES-ONE-Workspace-2015-SR1.msi
action parameter query "WMDB" with description "Please enter the Workspace Manager Database Name (WorkspaceManager)"
action parameter query "WMserver" with description "Please enter the SQL Server Name (BigFixServer)"
delete __createfile
createfile until __end
IF DB_Id('{parameter "WMDB" of action}') IS NULL
BEGIN
create database [{parameter "WMDB" of action}]
End
GO
ALTER LOGIN [{parameter "domainname" of action}\{parameter "BigfixConnector" of action}] WITH DEFAULT_DATABASE=[{parameter "WMDB" of action}], DEFAULT_LANGUAGE=[us_english]
GO
USE [{parameter "WMDB" of action}];
If not Exists (select loginname from master.dbo.syslogins where loginname = '{parameter "domainname" of action}\{parameter "BigfixConnector" of action}' and dbname = '{parameter "WMDB" of action}')
Begin
CREATE USER [{parameter "BigfixConnector" of action}] from login [{parameter "domainname" of action}\{parameter "BigfixConnector" of action}]
End
GO
USE [{parameter "WMDB" of action}]; exec sp_addrolemember 'db_owner' , [{parameter "BigfixConnector" of action}]
Go
__end
delete createdb.sql
copy __createfile createdb.sql
waithidden sqlcmd -s {parameter "WMserver" of action} -E -i createdb.sql
waithidden msiexec /i __Download\RES-ONE-Workspace-2015.msi /qn /log "{(value of variable "temp" of environment) & "\installWM.log"}"
regset "[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\RES\Workspace Manager]" "DBType"="MSSQL"
regset "[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\RES\Workspace Manager]" "DBName"="{parameter "WMDB" of action}"
regset "[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\RES\Workspace Manager]" "DBServer"="{if parameter "WMserver" of action contains "\" then preceding text of first "\" of parameter "WMserver" of action & "\\" & following text of first "\" of parameter "WMserver" of action else parameter "WMserver" of action}"
waithidden cmd.exe /c "{"%22"&(pathname of parent folder of parent folder of file of service "res" & "\pwrtech.exe"&"%22" & " /FIPS /createtables ") & "/ADDGROUPTOTECHMGR="&(parameter "domainname" of action)&"\"&(parameter "BigfixConnector" of action)}"
waithidden cmd.exe /c "{"%22"&(pathname of parent folder of parent folder of file of service "res" & "\pwrtech.exe"&"%22" & " /sethashedpassword=")&(parameter "RESPW" of action)}"
action uses wow64 redirection false
delete __createfile
delete "{(value of variable "temp" of environment) & "\getSiteGuid.ps1"}"
createfile until __done
$SiteGuid = (Invoke-Sqlcmd -query "USE [{parameter "WMDB" of action}];SELECT strValue from tblSettings where strSetting = 'EnvironmentGUID';").strValue
$SiteGuid = $siteGuid.Substring(1,$SiteGUID.strValue.Length -2)
[Microsoft.Win32.Registry]::SetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\RES\CDM","CDMsiteGUID",$SiteGUID,[Microsoft.Win32.RegistryValueKind]::String)
__done
copy __createfile "{(value of variable "temp" of environment) & "\getSiteGuid.ps1"}"
delete "{(value of variable "temp" of environment) & "\getSiteGuid.ps1"}"
//BATCH GETSITEGUID
delete __createfile
delete "{(value of variable "temp" of environment) & "\getSiteGuid.bat"}"
createfile until __done
sqlcmd -h -1 -W -Q {"%22"}SET NOCOUNT ON;USE [{parameter "WMDB" of action}] ;SELECT strValue from [{parameter "WMDB" of action}].[dbo].[tblSettings] where strSetting = 'EnvironmentGUID';SET NOCOUNT OFF{"%22"}|FIND /I {"%22"}{"%7b"}{"%22"} > {(value of variable "temp" of environment) & "\guid.txt"}
set /P cdmguid=<{(value of variable "temp" of environment) & "\guid.txt"}
del {(value of variable "temp" of environment) & "\guid.txt"}
REG ADD HKLM\SOFTWARE\Wow6432Node\RES\CDM /v CDMsiteGUID /t {"%22"}REG_SZ{"%22"} /d {"%22"}%cdmguid%{"%22"} /f
__done
copy __createfile "{(value of variable "temp" of environment) & "\getSiteGuid.bat"}"
waithidden cmd.exe /c {(value of variable "temp" of environment) & "\getSiteGuid.bat"}
delete "{(value of variable "temp" of environment) & "\getSiteGuid.bat"}"
//END
notify client forcerefresh
//set workspace AccountNames settings and retention
delete __createfile
delete logretention.xml
createfile until __end
="1.0"?>
9.9.2.3
90
__end
copy __createfile logretention.xml
waithidden "{(pathname of parent folder of parent folder of file of service "res" & "\pwrtech.exe")}" /add /overwrite logretention.xml
delete __createfile
delete "accountnames.xml"
createfile until __end
="1.0"?>
9.10.0.0
no
ad
no
no
= "yes">
yes
yes
no
accountnames
yes
__end
copy __createfile accountnames.xml
waithidden "{(pathname of parent folder of parent folder of file of service "res" & "\pwrtech.exe")}" /add /overwrite accountnames.xml
delete __createfile
createfile until __end
use [{parameter "WMDB" of action}];
IF EXISTS (Select * FROM tblSettings Where strSetting = 'RelayServerPassword' AND strValue = 'DA39A3EE5E6B4B0D3255BFEF95601890AFD80709')
begin
Update tblSettings
Set strValue = LTRIM(RTRIM('{parameter "RESPW" of action}'))
Where strSetting = 'RelayServerPassword'
end
GO
__end
delete createdb.sql
copy __createfile createdb.sql
waithidden sqlcmd -s {parameter "WMserver" of action} -E -i createdb.sql
Success Criteria
This action will be considered successful when the applicability relevance evaluates to false.
Sharing
| Social Media: |

