...
The action below defines the login resource used to log into the
Spacevars | ||
---|---|---|
|
Spacevars | ||
---|---|---|
|
Spacevars | ||
---|---|---|
|
Spacevars | ||
---|---|---|
|
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 |
...
The action below retrieves the factory image information available on ASM. Refer to Resource - asmfactoryimage.
Code Block |
---|
$url = "https://134.56.226.215/rest/asmfactoryimage" Invoke-RestMethod -Uri $url -Method GET -WebSession $ps |
...
The action below retrieves the detailed factory image information on ASM. Refer to Resource - asmfactoryimage.
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 |
...
The action below re-initializes the ASM and puts it in default factory state. Refer to Resource - sbaconfig.
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 |
...
The action below modifies the SBA configuration resource. This is the first step in setting up the SBA. Refer to to Resource - sbaconfig.
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 |
...
The action below configures the domain in which the SBA will connect. Refer to to Resource - sbaconfig.
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 |
...
The action below performs a number of low-level steps necessary to deploy the ASM packages. Refer to Resource - sbaconfig.
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaconfig?action=deploy" Invoke-RestMethod -Uri $url -Method POST -Body "" -WebSession $ps |
...
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. Refer to to Resource - sbaconfig.
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaconfig?action=startreplication" Invoke-RestMethod -Uri $url -Method POST -Body "" -WebSession $ps |
...
The action below activates the Communications Server (CS) and must be done before the certificates are installed. Refer to to Resource - sbaconfig.
Code Block |
---|
$url = "https://134.56.226.215/rest/sbaconfig?action=activatewithlync" Invoke-RestMethod -Uri $url -Method POST -Body "" -WebSession $ps |
...
This resource defines the generatecsr action on the SBA CSR Resource. It returns the CSR as the response. It is also able to auto-submit the request. Refer to Resource - sbacsr.
Code Block |
---|
$CA = "RDC.UX2013.COM\UX2013-RDC-CA" $CALogin = "ux2013\Administrator" $CAPassword = "Password1" $Domain = "ux2013.com" $Email = "Adrien@ux2013.com" $Organization = "SONUS" $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 |
...
The action below starts the network daemons for the services indicated. Refer to Resource - sbaconfig.
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 |
...
The action below applies a security template to the node to prevent unauthorized changes from being made to the system. Refer to Resource - sbaconfig.
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 |
...
To confirm that all the SBA services are running properly, 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 |
...