-
×InformationWindows update impacting certain printer icons and names. Microsoft is working on a solution.
Click here to learn moreInformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center.
-
×InformationWindows update impacting certain printer icons and names. Microsoft is working on a solution.
Click here to learn moreInformationNeed Windows 11 help?Check documents on compatibility, FAQs, upgrade information and available fixes.
Windows 11 Support Center.
- HP Community
- Poly Video Conferencing
- Meeting Room Solutions
- Re: Poly Studio X50, G7500 Possible Curl /PS Script for Audi...
Create an account on the HP Community to personalize your profile and ask a question
06-12-2023 04:37 AM
Hello, Is it possible right now to use an API/Curl script to call an audiotransmitlevel Set change? Currently, Lens Provisioning is unable to provide updates to this Field. "Transmission Audio Gain (dB)"
Thank you
Solved! Go to Solution.
Accepted Solutions
06-12-2023 05:33 AM
Hello @Daniel Petrillo ,
Welcome to the Poly Community.
Untested and no official support via Poly for single device with hardcoded password as 789 and fixed IP
curl -b cookies.txt -c cookies.txt -d "{\"user\": \"admin\",\"password\": \"789\"}" -H "Content-Type: application/json" -k https://192.168.1.100/rest/session
curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://192.168.1.100/rest/config -d "{\"vars\":[{\"name\":\"audio.volume.audiotransmitlevel\",\"value\":\"18\"}]}
CURL Batch processing
Create a txt file via Excel or similar with 1 column of the IP address and one Column of the password. Save as IP_Pass.csv file
Create an MS-Dos Batch file and copy this:
@echo off
echo Reading IP_Pass.csv
for /F "tokens=1,2 delims=," %%a in (IP_Pass.csv) do (
curl -b cookies.txt -c cookies.txt -X POST -d "{\"user\": \"admin\",\"password\": \"%%b\"}" -H "Content-Type: application/json" -k https://%%a/rest/session
curl -b cookies.txt -c cookies.txt -H "Content-Type: application/JSON" -k https://%%a/rest/config -d "{\"vars\":[{\"name\":\"audio.volume.audiotransmitlevel\",\"value\":\"18\"}]}
timeout /t 5 /NOBREAK
)
Call it audiotransmit.bat and save it in the same directory as the CSV file
Run audiotransmit.bat and it changes this for all IPs specified.
Power Shell Batch Processing
Create a txt file via Excel or similar with 1 column of the IP address and one Column of the password. Save as IP_Pass.csv file
#BEGIN POWERSHELL SCRIPT FOR REBOOTING Poly GroupSeries command
$File = get-content "IP_Pass.csv"
foreach ($line in $File){
$Arr = $line.Split(',')
[array]
#URL to make new session
$sessionURL = (https:// + $Arr[0] + "/rest/session");
#Command to make new session
$sessionBody = "{`"user`": `"admin`",`"password`": `"" + $Arr[1] + "`"}"
#URL to issue reboot
$rebootURL = (https:// + $Arr[0] + "/rest/config");
#Command to issue reboot
$rebootBody = @{
vars = @(
@{
name = "audio.volume.audiotransmitlevel"
value = "18"
}
)
} | ConvertTo-Json
# disable self signed certificate check
if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type)
{
$certCallback = @"
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public class ServerCertificateValidationCallback
{
public static void Ignore()
{
if(ServicePointManager.ServerCertificateValidationCallback ==null)
{
ServicePointManager.ServerCertificateValidationCallback +=
delegate
(
Object obj,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors errors
)
{
return true;
};
}
}
}
"@
Add-Type $certCallback
}
[ServerCertificateValidationCallback]::Ignore()
# End self signed certificate commands
Invoke-WebRequest $sessionURL -UseBasicParsing -ContentType "application/json" -Method Post -body $sessionBody -SessionVariable sess;
Invoke-WebRequest $rebootURL -UseBasicParsing -ContentType "application/json" -WebSession $sess -Method POST -Body $rebootBody
}
Call it audiotransmit.ps1 and save it in the same directory as the CSV file
It uses the same CSV source file but you may need to allow the script execution via Power Shell:
- By default, PowerShell will not allow you to execute this script:
- If you see the above error, you will need to change the ExecutionPolicy from Default to RemoteSigned:
> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Now start power shell and run audiotransmit.ps1
Please ensure to provide some feedback if this reply has helped you so other users can profit from your experience.
Best Regards
Steffen Baier
Notice: I am an HP Poly employee but all replies within the community are done as a volunteer outside of my day role. This community forum is not an official HP Poly support resource, thus responses from HP Poly employees, partners, and customers alike are best-effort in attempts to share learned knowledge.
If you need immediate and/or official assistance for former Poly\Plantronics\Polycom please open a service ticket through your support channels
For HP products please check HP Support.
Please also ensure you always check the General VoIP , Video Endpoint , UC Platform (Microsoft) , PSTN
06-12-2023 05:33 AM
Hello @Daniel Petrillo ,
Welcome to the Poly Community.
Untested and no official support via Poly for single device with hardcoded password as 789 and fixed IP
curl -b cookies.txt -c cookies.txt -d "{\"user\": \"admin\",\"password\": \"789\"}" -H "Content-Type: application/json" -k https://192.168.1.100/rest/session
curl -b cookies.txt -c cookies.txt -X POST -H "Content-Type: application/json" -k https://192.168.1.100/rest/config -d "{\"vars\":[{\"name\":\"audio.volume.audiotransmitlevel\",\"value\":\"18\"}]}
CURL Batch processing
Create a txt file via Excel or similar with 1 column of the IP address and one Column of the password. Save as IP_Pass.csv file
Create an MS-Dos Batch file and copy this:
@echo off
echo Reading IP_Pass.csv
for /F "tokens=1,2 delims=," %%a in (IP_Pass.csv) do (
curl -b cookies.txt -c cookies.txt -X POST -d "{\"user\": \"admin\",\"password\": \"%%b\"}" -H "Content-Type: application/json" -k https://%%a/rest/session
curl -b cookies.txt -c cookies.txt -H "Content-Type: application/JSON" -k https://%%a/rest/config -d "{\"vars\":[{\"name\":\"audio.volume.audiotransmitlevel\",\"value\":\"18\"}]}
timeout /t 5 /NOBREAK
)
Call it audiotransmit.bat and save it in the same directory as the CSV file
Run audiotransmit.bat and it changes this for all IPs specified.
Power Shell Batch Processing
Create a txt file via Excel or similar with 1 column of the IP address and one Column of the password. Save as IP_Pass.csv file
#BEGIN POWERSHELL SCRIPT FOR REBOOTING Poly GroupSeries command
$File = get-content "IP_Pass.csv"
foreach ($line in $File){
$Arr = $line.Split(',')
[array]
#URL to make new session
$sessionURL = (https:// + $Arr[0] + "/rest/session");
#Command to make new session
$sessionBody = "{`"user`": `"admin`",`"password`": `"" + $Arr[1] + "`"}"
#URL to issue reboot
$rebootURL = (https:// + $Arr[0] + "/rest/config");
#Command to issue reboot
$rebootBody = @{
vars = @(
@{
name = "audio.volume.audiotransmitlevel"
value = "18"
}
)
} | ConvertTo-Json
# disable self signed certificate check
if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type)
{
$certCallback = @"
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
public class ServerCertificateValidationCallback
{
public static void Ignore()
{
if(ServicePointManager.ServerCertificateValidationCallback ==null)
{
ServicePointManager.ServerCertificateValidationCallback +=
delegate
(
Object obj,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors errors
)
{
return true;
};
}
}
}
"@
Add-Type $certCallback
}
[ServerCertificateValidationCallback]::Ignore()
# End self signed certificate commands
Invoke-WebRequest $sessionURL -UseBasicParsing -ContentType "application/json" -Method Post -body $sessionBody -SessionVariable sess;
Invoke-WebRequest $rebootURL -UseBasicParsing -ContentType "application/json" -WebSession $sess -Method POST -Body $rebootBody
}
Call it audiotransmit.ps1 and save it in the same directory as the CSV file
It uses the same CSV source file but you may need to allow the script execution via Power Shell:
- By default, PowerShell will not allow you to execute this script:
- If you see the above error, you will need to change the ExecutionPolicy from Default to RemoteSigned:
> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned
Now start power shell and run audiotransmit.ps1
Please ensure to provide some feedback if this reply has helped you so other users can profit from your experience.
Best Regards
Steffen Baier
Notice: I am an HP Poly employee but all replies within the community are done as a volunteer outside of my day role. This community forum is not an official HP Poly support resource, thus responses from HP Poly employees, partners, and customers alike are best-effort in attempts to share learned knowledge.
If you need immediate and/or official assistance for former Poly\Plantronics\Polycom please open a service ticket through your support channels
For HP products please check HP Support.
Please also ensure you always check the General VoIP , Video Endpoint , UC Platform (Microsoft) , PSTN
06-12-2023 06:00 AM
Hello @Daniel Petrillo
my >here< FAQ has examples if you ever stuck.
Best regards
Steffen Baier
Notice: I am an HP Poly employee but all replies within the community are done as a volunteer outside of my day role. This community forum is not an official HP Poly support resource, thus responses from HP Poly employees, partners, and customers alike are best-effort in attempts to share learned knowledge.
If you need immediate and/or official assistance for former Poly\Plantronics\Polycom please open a service ticket through your support channels
For HP products please check HP Support.
Please also ensure you always check the General VoIP , Video Endpoint , UC Platform (Microsoft) , PSTN
06-13-2023 06:57 AM
Good Morning Poly Community/Fam -
PS Script for Bulk Changes in your environment -
Dump all the Hostname/IP's into the Get-Content -Path "IP.txt"
Update $Password
Value of AudioTransmitLevel should reflect Poly's recommended , we used 18 across the board.
#BEGIN POWERSHELL SCRIPT FOR POLY X50/G7500/ REST Command Bulk AudioTransmitLevel Change
# Ignore SSL certificate checks
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}
"@
[System.Net.ServicePointManager]::CertificatePolicy = New-Object TrustAllCertsPolicy
# Get the content of the text file
$IPAddresses = Get-Content -Path "IP.txt"
# Prepare a list to store the results
$results = @()
# Loop through each IP address
foreach ($IP in $IPAddresses) {
$loginUrl = "https://$IP/rest/session"
$configUrl = "https://$IP/rest/config"
$loginBody = @{
user = "admin"
password = "789"
} | ConvertTo-Json
$configBody = @{
vars = @(
@{
name = "audio.volume.audiotransmitlevel"
value = "18"
}
)
} | ConvertTo-Json
try {
# Create a new web request session
$sessionRequest = Invoke-WebRequest -Uri $loginUrl -Method Post -Body $loginBody -ContentType "application/json" -SessionVariable session -UseBasicParsing
# Now apply the new audio configuration
$configRequest = Invoke-WebRequest -Uri $configUrl -WebSession $session -Method POST -Body $configBody -ContentType "application/json" -UseBasicParsing
# Add the result to the list
$results += New-Object PSObject -Property @{
IPAddress = $IP
LoginStatusCode = $sessionRequest.StatusCode
LoginStatusDescription = $sessionRequest.StatusDescription
ConfigStatusCode = $configRequest.StatusCode
ConfigStatusDescription = $configRequest.StatusDescription
Status = "Successful"
}
}
catch {
# If there was an error, add the result to the list
$results += New-Object PSObject -Property @{
IPAddress = $IP
LoginStatusCode = $null
LoginStatusDescription = $null
ConfigStatusCode = $null
ConfigStatusDescription = $null
Status = "NA Check Credentials or Hostname"
}
}
}
# Export the results to a CSV file
$results | Export-Csv -Path "AudioResults.csv" -NoTypeInformation
The results above will export to "AudioResults.csv" file which will include the below results upon successful or not successful operation.
ConfigStatusDescription | ConfigStatusCode | IPAddress | LoginStatusCode | Status | LoginStatusDescription |
OK | 200 | Hostname | 200 | OK | OK |
Didn't find what you were looking for? Ask the community