This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
###Force commuincation to only occur with TLS 1.2 | |
Write-Verbose -Message "Forcing TLS 1.2 Cipher...." | |
[Net.ServicePointManager]::SecurityProtocol = | |
[Net.SecurityProtocolType]::Tls12 | |
Write-Verbose -Message "TLS 1.2 Ciper Successfully Enforced" | |
$filepath = Get-Location | |
$WS1Env = Get-Content -Path $filepath\tools\config.ini | Select -Skip 1 | ConvertFrom-StringData | |
$logPath = $WS1Env.logpath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$logpath = "C:\Hawaii\Kauai\workspaceone\tools\logs" | |
If(!(test-path $logpath)) | |
{ | |
New-Item -ItemType Directory -Force -Path $logpath | |
} | |
$applog = "$logpath\HouseBought$((Get-Date).ToString('MM-dd-yyyy_hh-mm-ss')).csv" | |
$addy = "https://kauai.ryanpringnitz.com" | |
$apiKey = "z/Model337ltuYugOcE2snK/ModelYnot?d4vHlN4hd=" | |
$b64 = "SWNhbmhhelRlc2xhP1RoaXNQYXNzd29yZGlzSm9rZWJ1dFJlYWxseSxJd2FudEFUZXNsYQ==" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######Howto use script | |
# 1. Create config.ini file | |
# 1a. Config.ini file example at following URL: https://gist.github.com/HawaiiRyan/b610f6d5427afa9609cee145affed912 | |
# 2. Update -path location in the line where variable/object $WS1Env is declared | |
# 3. Ensure $addy, $b64, $apikey are referencing the correct environment. | |
# 3a. UAT environment is used in this example | |
#Set Verbosity Preference | |
$VerbosePreference = "Continue" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$VerbosePreference = "Continue" | |
$script:config = "config.ini" | |
Write-Verbose -Message "The username is in the format domain\samAccountName" | |
function Test-APICred { | |
[CmdletBinding()] | |
[OutputType([String])] | |
Param ( | |
[Parameter( | |
Mandatory = $true, | |
ValueFromPipeLine = $true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$VerbosePreference = "Continue" | |
$script:Credentials = Get-Credential | |
Try { | |
$script:Username = $credentials.username | |
$script:Password = $credentials.GetNetworkCredential().password | |
} | |
Catch { | |
$_.Exception.Message | |
Continue | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --location --request GET 'https://ws1.ryanpringnitz.com/API/mdm/profiles/86' \ | |
--header 'Accept: application/json;version=2' \ | |
--header 'Authorization: Basic SGF3YWlpNG1l' \ | |
--header 'aw-tenant-code: a/D3ariE08ltuYjgecv2jnW/mi41in3lYUd9vHlK0hk=' \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AndroidForWorkWifiList": [ | |
{ | |
"ServiceSetIdentifier": "devtest", | |
"SecurityType": "WPA", | |
"Password": "*****", | |
"SetAsActiveNetwork": true, | |
"HiddenNetwork": false, | |
"EnterprisePassword": "*****" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"AndroidForWorkWifiList": [ | |
{ | |
"ServiceSetIdentifier": "devtest", | |
"SecurityType": "WPA", | |
"Password": "12345678", | |
"SetAsActiveNetwork": true, | |
"HiddenNetwork": false, | |
"EnterprisePassword": "12345678" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -X POST | |
--header 'Content-Type: application/json' \ | |
--header 'Accept: application/json;version=2' \ | |
--header 'Authorization: Basic SGF3YWlpNG1l' \ | |
--header 'aw-tenant-code: a/D3ariE08ltuYjgecv2jnW/mi41in3lYUd9vHlK0hk=' \ | |
-d '{ \ | |
"AndroidForWorkWifiList": [ \ | |
{ \ | |
"ServiceSetIdentifier": "devtest", \ | |
"SecurityType": "WPA", \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
} |