Add_workflow_for_techpubs |
---|
AUTH1 | UserResourceIdentifier{userKey=8a00a0c85bb25531015bc4122a4f0003, userName='null'} |
---|
JIRAIDAUTH | SYM-22656 |
---|
REV5 | UserResourceIdentifier{userKey=8a00a0c85bb25531015bc4122a4f0003, userName='null'} |
---|
REV6 | UserResourceIdentifier{userKey=8a00a0c85bb25531015bc4122a4f0003, userName='null'} |
---|
REV3 | UserResourceIdentifier{userKey=8a00a02355cd1c2f0155cd26c85500c9, userName='null'} |
---|
REV1 | UserResourceIdentifier{userKey=8a00a02355cd1c2f0155cd26cc5207f0, userName='null'} |
---|
|
Summary
Prerequisites
For prerequisites, refer to Look at Deploying the Survivable Branch Appliance and Using REST with Powershell 3 for the Requirement
Step by Step
Login
to Access REST.
Log into SBC REST API
The action below defines the login resource used to log into the
Defines the Login resource used to login to the Sonus SBC REST API. This is the first request that needs to be made before you can access any of the other REST Resources on
the Sonus SBC 1000/2000 system. Using the system. Refer to Resource - login.
Code Block |
---|
### Allow self Sign Cert
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class IDontCarePolicy : ICertificatePolicy {
public IDontCarePolicy() {}
public bool CheckValidationResult(
ServicePoint sPoint, X509Certificate cert,
WebRequest wRequest, int certProb) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = new-object IDontCarePolicy
### Login
$BodyValue = "Username=restuser&Password=restpass"
$url = "https://134.56.226.215/rest/login"
$Result = Invoke-RestMethod -Uri $url -Method Post -Body $BodyValue -SessionVariable ps |
Update the recovery partition with a new ASM image (Optional)
This operation allows The action below enables you to load new software into the Recovery partition of the ASM through USB. Using Refer to Resource - sbaconfig.
Query
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaconfig?action=asmupdaterecoverypartition"
Invoke-RestMethod -Uri $url -Method POST -Body "" -WebSession $ps |
...
Re-initialize the ASM (Optional)
...
Retrieve available ASM images
...
Retrieves the information of the The action below retrieves the factory image information available on ASM. Using Refer to Resource - asmfactoryimage.
Query
Code Block |
---|
$url = "https://134.56.226.215/rest/asmfactoryimage"
Invoke-RestMethod -Uri $url -Method GET -WebSession $ps
|
...
Command to get the ASM image details based on the ID:
Retrieves The action below retrieves the detailed information of the factory image information on ASM. Using Refer to Resource - asmfactoryimage.
Query
Code Block |
---|
$url = "https://134.56.226.215/rest/asmfactoryimage/1"
Invoke-RestMethod -Uri $url -Method GET -WebSession $ps
$url = "https://134.56.226.215/rest/asmfactoryimage/2"
Invoke-RestMethod -Uri $url -Method GET -WebSession $ps
$url = "https://134.56.226.215/rest/asmfactoryimage/3"
Invoke-RestMethod -Uri $url -Method GET -WebSession $ps |
...
Command to apply a new ASM image based on the ASM Image details
This The action below re-initializes the ASM and puts it in default factory state. Using Refer to Resource - sbaconfig.
Query
Code Block |
---|
##########
$dirNam = "2013-05-02_10-08-26"
##########
$BodyValue = "dirName=$dirName"
$url = "https://134.56.226.215/rest/sbaconfig?action=asmreinitialize"
Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps |
Response
Code Block |
---|
<?xml version="1.0"?>
<root>
<status>
<http_code>200</http_code>
</status>
</root> |
Action end on status
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaactionstatus"
Invoke-RestMethod -Uri $url -Method GET -WebSession $MyPs
<?xml version="1.0"?>
<root>
<status>
<http_code>200</http_code>
</status>
<sbaactionstatus href="https://134.56.226.215/rest/sbaactionstatus">
<rt_Success>1</rt_Success>
<rt_ActionType>9</rt_ActionType>
<rt_PercentComplete>100</rt_PercentComplete>
<rt_Duration>0</rt_Duration>
<rt_StatusText>Re-initialization complete</rt_StatusText>
<rt_AllActionsBitmap>0</rt_AllActionsBitmap>
<rt_ActionStartTime>0</rt_ActionStartTime>
</sbaactionstatus>
</root> |
Configuring the ASM IP Settings
Modifies The action below modifies the SBA configuration resource. This is the first step in setting up the SBA. Using Refer to Resource - sbaconfig.
Query
Code Block |
---|
$DHCPEnabled = 0
$ipv4Address = "134.56.226.214"
$ipv4Netmask = "255.255.255.0"
$ipv4Gateway = "134.56.226.5"
$RemoteDesktopEnabled = 1
$DNSServer1 = "134.56.227.32"
$DNSServer2 = "134.56.226.75"
$AclEnable = 1
##########
$BodyValue = "DHCPEnabled=$DHCPEnabled&ipv4Address=$ipv4Address&ipv4Netmask=$ipv4Netmask&ipv4Gateway=$ipv4Gateway&RemoteDesktopEnabled=$RemoteDesktopEnabled&DNSServer1=$DNSServer1&DNSServer2=$DNSServer2&AclEnable=$AclEnable"
$url = "https://134.56.226.215/rest/sbaconfig"
Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps |
...
Joining the ASM to the domain
This The action below configures the domain that in which the SBA will connect to. Using Refer to Resource - sbaconfig.
Query
Code Block |
---|
$hostName = "SBA2010-226-214"
$domainName = "UX2013.COM"
$userName = "UX2013\administrator"
$userPassword = "Password1"
##########
$BodyValue = "hostName=$hostName&domainName=$domainName&userName=$userName&userPassword=$userPassword"
$url = "https://134.56.226.215/rest/sbaconfig?action=joindomain"
Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps
|
...
Command to prepare the SBA bits
This The action below performs a number of low-level steps necessary to deploy the ASM packages. Using Refer to Resource - sbaconfig.
Query
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaconfig?action=deploy"
Invoke-RestMethod -Uri $url -Method POST -Body "" -WebSession $ps
|
...
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaactionstatus"
Invoke-RestMethod -Uri $url -Method GET -WebSession $MyPs
<?xml version="1.0"?>
<root>
<status>
<http_code>200</http_code>
</status>
<sbaactionstatus href="https://134.56.226.215/rest/sbaactionstatus">
<rt_Success>1</rt_Success>
<rt_ActionType>22</rt_ActionType>
<rt_PercentComplete>100</rt_PercentComplete>
<rt_Duration>1502</rt_Duration>
<rt_StatusText>Complete</rt_StatusText>
<rt_AllActionsBitmap>3</rt_AllActionsBitmap>
<rt_ActionStartTime>0</rt_ActionStartTime>
</sbaactionstatus>
</root> |
Command to start the replication with Lync Server
...
This The action below causes the Communications Server (CS) to begin configuration replication with the domain. This is a necessary step for bringing up the CS configuration, as well as receiving updates from the domain. Using Refer to Resource - sbaconfig.
Query
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaconfig?action=startreplication"
Invoke-RestMethod -Uri $url -Method POST -Body "" -WebSession $ps |
...
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaactionstatus"
Invoke-RestMethod -Uri $url -Method GET -WebSession $MyPs
<?xml version="1.0"?>
<root>
<status>
<http_code>200</http_code>
</status>
<sbaactionstatus href="https://134.56.226.215/rest/sbaactionstatus">
<rt_Success>1</rt_Success>
<rt_ActionType>20</rt_ActionType>
<rt_PercentComplete>100</rt_PercentComplete>
<rt_Duration>268</rt_Duration>
<rt_StatusText>replication started</rt_StatusText>
<rt_AllActionsBitmap>7</rt_AllActionsBitmap>
<rt_ActionStartTime>0</rt_ActionStartTime>
</sbaactionstatus>
</root> |
Command to activate SBA with Lync Server
...
This The action below activates the Communications Server (CS) and must be done before the certificates are installed. Using Refer to Resource - sbaconfig.
Query
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaconfig?action=activatewithlync"
Invoke-RestMethod -Uri $url -Method POST -Body "" -WebSession $ps |
...
Code Block |
---|
<?xml version="1.0"?>
<root>
<status>
<http_code>200</http_code>
</status>
</root> |
Action end on status
...
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaactionstatus"
Invoke-RestMethod -Uri $url -Method GET -WebSession $MyPs
<?xml version="1.0"?>
<root>
<status>
<http_code>200</http_code>
</status>
<sbaactionstatus href="https://134.56.226.215/rest/sbaactionstatus">
<rt_Success>1</rt_Success>
<rt_ActionType>7</rt_ActionType>
<rt_PercentComplete>100</rt_PercentComplete>
<rt_Duration>12</rt_Duration>
<rt_StatusText>Activation Complete</rt_StatusText>
<rt_AllActionsBitmap>15</rt_AllActionsBitmap>
<rt_ActionStartTime>0</rt_ActionStartTime>
</sbaactionstatus>
</root> |
...
This resource defines the generatecsr action on the SBA CSR Resource Resource. It returns the CSR as the response. It is also able to auto-submit the request. Using Refer to Resource - sbacsr.
Query
Code Block |
---|
$CA = "RDC.UX2013.COM\UX2013-RDC-CA"
$CALogin = "ux2013\Administrator"
$CAPassword = "Password1"
$Domain = "ux2013.com"
$Email = "Adrien@ux2013.com"
$Organization = "SONUSRIBBON"
$OU = "AUTOMAITON"
$City = "FREMONT"
$State = "CA"
$Country = "US"
$CsrTemplate = "WebServer"
$KeySize = 2048
##########
$BodyValue = "CA=$CA&CALogin=$CALogin&CAPassword=$CAPassword&Domain=$Domain&Email=$Email&Organization=$Organization&OU=$OU&City=$City&State=$State&Country=$Country&CsrTemplate=$CsrTemplate&KeySize=$KeySize"
$url = "https://134.56.226.215/rest/sbacsr?action=generatecsr"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps |
...
Code Block |
---|
<?xml version="1.0"?>
<root>
<status>
<http_code>200</http_code>
</status>
</root> |
Action end on status
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaactionstatus"
Invoke-RestMethod -Uri $url -Method GET -WebSession $MyPs
<?xml version="1.0"?>
<root>
<status>
<http_code>200</http_code>
</status>
<sbaactionstatus href="https://134.56.226.215/rest/sbaactionstatus">
<rt_Success>1</rt_Success>
<rt_ActionType>14</rt_ActionType>
<rt_PercentComplete>100</rt_PercentComplete>
<rt_Duration>11</rt_Duration>
<rt_StatusText>Certificate successfully applied</rt_StatusText>
<rt_AllActionsBitmap>31</rt_AllActionsBitmap>
<rt_ActionStartTime>0</rt_ActionStartTime>
</sbaactionstatus>
</root> |
Starting the SBA Services
This The action below starts the network daemons for the services indicated. Using Refer to Resource - sbaconfig.
Query
Code Block |
---|
$BodyValue = "serviceName=16"
$url = "https://134.56.226.215/rest/sbaconfig?action=enablesvc"
Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps |
...
Code Block |
---|
<?xml version="1.0"?><root>
<status>
<http_code>200</http_code>
</status>
</root> |
Action end on status
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaactionstatus"
Invoke-RestMethod -Uri $url -Method GET -WebSession $MyPs
<?xml version="1.0"?>
<root>
<status>
<http_code>200</http_code>
</status>
<sbaactionstatus href="https://134.56.226.215/rest/sbaactionstatus">
<rt_Success>1</rt_Success>
<rt_ActionType>1</rt_ActionType>
<rt_PercentComplete>100</rt_PercentComplete>
<rt_Duration>139</rt_Duration>
<rt_StatusText>Services successfully started (16)</rt_StatusText>
<rt_AllActionsBitmap>63</rt_AllActionsBitmap>
<rt_ActionStartTime>0</rt_ActionStartTime>
</sbaactionstatus>
</root> |
Applying an SBA Security Template
This The action below applies a security template to the node to prevent unauthorized changes from being made to the system. Using Refer to Resource - sbaconfig.
Query
Code Block |
---|
$BodyValue = "templateType=0&sbaInstallFilename=0"
$url = "https://134.56.226.215/rest/sbaconfig?action=applysectemplate"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps |
...
Code Block |
---|
<?xml version="1.0"?><root>
<status>
<http_code>200</http_code>
</status>
</root> |
Action end on status
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaactionstatus"
Invoke-RestMethod -Uri $url -Method GET -WebSession $MyPs
<?xml version="1.0"?>
<root>
<status>
<http_code>200</http_code>
</status>
<sbaactionstatus href="https://134.56.226.215/rest/sbaactionstatus">
<rt_Success>1</rt_Success>
<rt_ActionType>21</rt_ActionType>
<rt_PercentComplete>100</rt_PercentComplete>
<rt_Duration>1</rt_Duration>
<rt_StatusText>Security Template Applied</rt_StatusText>
<rt_AllActionsBitmap>127</rt_AllActionsBitmap>
<rt_ActionStartTime>0</rt_ActionStartTime>
</sbaactionstatus>
</root> |
Checking the SBA Status
To confirm that all the SBA services are running properly, check the status by refer to Viewing the SBA Operational Status to check the status.
Code Block |
---|
$url = "https://134.56.226.215/rest/asmfactoryimage/1"
$Result = Invoke-RestMethod -Uri $url -Method GET -WebSession $ps |
...
SBA Login/Configuration/Status - Example
Code Block |
---|
### 1. Login
$NodeUrl = "134.56.226.215"
$NodeLogin = "restuser"
$NodePassword = "restpass"
### 2. Re-initialize the ASM
$LyncVersion = "Lync 2013"
### 3. Configuring the ASM IP Settings
$DHCPEnabled = 0
$ipv4Address = "134.56.226.214"
$ipv4Netmask = "255.255.255.0"
$ipv4Gateway = "134.56.226.5"
$RemoteDesktopEnabled = 1
$DNSServer1 = "134.56.227.32"
$DNSServer2 = "134.56.226.75"
$AclEnable = 1
### 4. Update SbcComms
$SbcCommsFilePath = "c:\setup.msi"
### 5. Joining the ASM to a Domain
$hostName = "AUTO-SBA226-214"
$domainName = "UX2013.COM"
$userName = "UX2013\administrator"
$userPassword = "Password1"
|
Code Block |
---|
### 7. Generate and Import an SBA Certificate
$CA = "RDC.UX2013.COM\UX2013-RDC-CA"
$CALogin = "ux2013\Administrator"
$CAPassword = "Password1"
$Domain = "ux2013.com"
$Email = "Adrien@ux2013.com"
$Organization = "SONUSRIBBON"
$OU = "AUTOMAITON"
$City = "FREMONT"
$State = "CA"
$Country = "US"
$CsrTemplate = "WebServer"
$KeySize = 2048
### 10. Install the Latest Lync SBA Cumulative Update (CU)
$CUFilePath = "c:\CU.pkg"
###################################
#### Define some function Helper
###################################
|
Code Block |
---|
### Re-initialize the ASM with the correct ASM Image
function SearchImageDirectoryName {
Param($MyLyncVersion, $MyNodeUrl, $MyPs)
$url = "https://$MyNodeUrl/rest/asmfactoryimage"
$ImageCmd = Invoke-RestMethod -Uri $url -Method GET -WebSession $MyPs
if ((BasicHandler $ImageCmd) -ne 1) {
write-host "Failed on SearchImageDirectoryName: "(BasicHandler $ImageCmd)
return 0
}
[xml]$ImageCmdXml= $ImageCmd.Substring(5)
foreach ($image in $ImageCmdXml.root.asmfactoryimage_list.asmfactoryimage_pk.href) {
$url = $image
$ImageDetail = Invoke-RestMethod -Uri $url -Method GET -WebSession $MyPs
[xml]$ImageDetailXml= $ImageDetail.Substring(5)
if($ImageDetailXml.root.asmfactoryimage.Description.contains($MyLyncVersion)) { return $ImageDetailXml.root.asmfactoryimage.ImageDirectoryName}
}
return 0
}
|
Code Block |
---|
### Return the result of the request
Function BasicHandler {
Param($MyResult)
[xml]$XmlResult = $MyResult.Substring(5)
if($XmlResult.root.status.http_code.contains("200")) {
return 1
} else {
return "Error Code:<"+$XmlResult.root.status.app_status.app_status_entry.code+"> Param:<"+$XmlResult.root.status.app_status.app_status_entry.params+">"
}
}
### Return the result of the request
Function BasicHandlerCurl {
Param($MyResult)
$FiltredMyResult = ""
foreach ($line in $MyResult) {
if ($line.StartsWith("<")) {
$FiltredMyResult += $line
} elseif ($line.StartsWith(" ")) {
$FiltredMyResult += $line
}
}
[xml]$XmlResult = $FiltredMyResult
if($XmlResult.root.status.http_code.contains("200")) {
return 1
} else {
return "Error Code:<"+$XmlResult.root.status.app_status.app_status_entry.code+"> Param:<"+$XmlResult.root.status.app_status.app_status_entry.params+">"
}
} |
Code Block |
---|
### Return the result of the last action
function LookCompletionStatus {
Param($MyNodeUrl, $MyPs)
$url = "https://$MyNodeUrl/rest/sbaactionstatus"
$timer = 0
while($timer -lt 3600) {
$Result = Invoke-RestMethod -Uri $url -Method GET -WebSession $MyPs
if ((BasicHandler $Result) -ne 1) { return 0}
[xml]$FinalResult= $Result.Substring(5)
if ($FinalResult.root.sbaactionstatus.rt_Success -eq 1) {
if ($FinalResult.root.sbaactionstatus.rt_PercentComplete -eq 100) { return 1 }
} else {
return $FinalResult.root.sbaactionstatus.rt_StatusText
}
sleep 10
$timer += 10
write-host "- "$FinalResult.root.sbaactionstatus.rt_PercentComplete"% "$FinalResult.root.sbaactionstatus.rt_StatusText
}
return "Timout out"
}
###################################
#### Main Code
###################################
$ActualStep = 0 |
Code Block |
---|
### 1. Login
$ActualStep = "1. Login"
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class IDontCarePolicy : ICertificatePolicy {
public IDontCarePolicy() {}
public bool CheckValidationResult(
ServicePoint sPoint, X509Certificate cert,
WebRequest wRequest, int certProb) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = new-object IDontCarePolicy
$BodyValue = "Username=$NodeLogin&Password=$NodePassword"
$url = "https://$NodeUrl/rest/login"
$Result = Invoke-RestMethod -Uri $url -Method Post -Body $BodyValue -SessionVariable ps
if ((BasicHandler $Result) -ne 1) {
write-host "Failed on "$ActualStep": "(BasicHandler $Result)
return 0
}
|
Code Block |
---|
### 2. Re-initialize the ASM
$ActualStep = "2. Re-initialize the ASM"
$dirName = SearchImageDirectoryName $LyncVersion $NodeUrl $ps
if ($dirName -eq 0) {
write-host $ActualStep" Failed: Unable to find the proper ASM Image"
return 0
}
$BodyValue = "dirName=$dirName"
$url = "https://$NodeUrl/rest/sbaconfig?action=asmreinitialize"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps
if ((BasicHandler $Result) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
if ((LookCompletionStatus $NodeUrl $ps) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
|
Code Block |
---|
### 3. Configuring the ASM IP Settings
$ActualStep = "3. Configuring the ASM IP Settings"
$BodyValue = "DHCPEnabled=$DHCPEnabled&ipv4Address=$ipv4Address&ipv4Netmask=$ipv4Netmask&ipv4Gateway=$ipv4Gateway&RemoteDesktopEnabled=$RemoteDesktopEnabled&DNSServer1=$DNSServer1&DNSServer2=$DNSServer2&AclEnable=$AclEnable"
$url = "https://$NodeUrl/rest/sbaconfig"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps
if ((BasicHandler $Result) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
if ((LookCompletionStatus $NodeUrl $ps) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
### 4. Update SbcComms
### 5. Joining the ASM to a Domain
$ActualStep = "5. Joining the ASM to a Domain"
$BodyValue = "hostName=$hostName&domainName=$domainName&userName=$userName&userPassword=$userPassword"
$url = "https://$NodeUrl/rest/sbaconfig?action=joindomain"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps
if ((BasicHandler $Result) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
if ((LookCompletionStatus $NodeUrl $ps) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
} |
Code Block |
---|
### 6. Deploying the SBA
$ActualStep = "6. Deploying the SBA"
$url = "https://$NodeUrl/rest/sbaconfig?action=deploy"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body "" -WebSession $ps
if ((BasicHandler $Result) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
if ((LookCompletionStatus $NodeUrl $ps) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
$url = "https://$NodeUrl/rest/sbaconfig?action=startreplication"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body "" -WebSession $ps
if ((BasicHandler $Result) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
if ((LookCompletionStatus $NodeUrl $ps) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
$url = "https://$NodeUrl/rest/sbaconfig?action=activatewithlync"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body "" -WebSession $ps
if ((BasicHandler $Result) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
if ((LookCompletionStatus $NodeUrl $ps) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
|
Code Block |
---|
### 7. Generate and Import an SBA Certificate
$ActualStep = "7. Generate and Import an SBA Certificate"
$BodyValue = "CA=$CA&CALogin=$CALogin&CAPassword=$CAPassword&Domain=$Domain&Email=$Email&Organization=$Organization&OU=$OU&City=$City&State=$State&Country=$Country&CsrTemplate=$CsrTemplate&KeySize=$KeySize"
$url = "https://$NodeUrl/rest/sbacsr?action=generatecsr"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps
if ((BasicHandler $Result) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
if ((LookCompletionStatus $NodeUrl $ps) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
} |
Code Block |
---|
### 8. Starting the SBA Services
$ActualStep = "8. Starting the SBA Services"
$BodyValue = "serviceName=16"
$url = "https://$NodeUrl/rest/sbaconfig?action=enablesvc"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps
if ((BasicHandler $Result) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
if ((LookCompletionStatus $NodeUrl $ps) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
### 9. Applying an SBA Security Template
$ActualStep = "9. Applying an SBA Security Template"
$BodyValue = "templateType=0&sbaInstallFilename=0"
$url = "https://$NodeUrl/rest/sbaconfig?action=applysectemplate"
$Result = Invoke-RestMethod -Uri $url -Method POST -Body $BodyValue -WebSession $ps
if ((BasicHandler $Result) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
if ((LookCompletionStatus $NodeUrl $ps) -ne 1) {
write-host $ActualStep" Failed: "(BasicHandler $Result)
return 0
}
### 10. Install the Latest Lync SBA Cumulative Update
|