1. Create a .ps1 file using the script below
2. Create a CSV file where cells in column A each contain the IP addresses of Snom phones on your network(ex. A1=192.168.1.50, A2=192.168.1.51,...). It shouldn't cause any issues if you include IPs that aren’t snom phones, the script will just run a bit slowly.
3. Update the script pathing to point to your CSV file
4. Reprovision phones to all use the same web page password. Current password in script: pG8nw6tcGNDS
5. Run the script in PowerShell. Ex. "C:\Users\Documents\SnomReset\TestSnom.ps1" -Update with the path to your .ps1 file
# Phone reset
$sites = Get-Content -Path 'C:\Users\chris\Documents\SnomReset\sites.csv' #Update with the path to your CSV IP file
$httpClient = New-Object -ComObject Msxml2.XMLHTTP
$jobList = @()
ForEach ($Site in $sites) {
$job = Start-Job -ScriptBlock {
param($Url, $Parameters)
$httpClient = New-Object -ComObject Msxml2.XMLHTTP
$httpClient.open('POST', $Url, $false)
$httpClient.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
$httpClient.setRequestHeader("Content-length", $Parameters.Length)
$httpClient.setRequestHeader("Connection", "close")
$httpClient.send($Parameters)
Start-Sleep -Seconds 1
$httpClient.statusText
} -ArgumentList ("http://admin:pG8nw6tcGNDS@$Site/advanced_update.htm", "update_policy=settings_only&settings_refresh_timer=0&subscribe_config=off&pnp_config=on&CONFIRM_RESET=Reset")
$jobList += $job
}
Wait-Job -Job $jobList | Out-Null
ForEach ($job in $jobList) {
$job | Receive-Job | Out-Null
$job | Remove-Job | Out-Null
}
ForEach ($Site in $sites) {
$job = Start-Job -ScriptBlock {
param($Url, $Parameters)
$httpClient = New-Object -ComObject Msxml2.XMLHTTP
$httpClient.open('POST', $Url, $false)
$httpClient.setRequestHeader("Content-type", "application/x-www-form-urlencoded")
$httpClient.setRequestHeader("Content-length", $Parameters.Length)
$httpClient.setRequestHeader("Connection", "close")
$httpClient.send($Parameters)
Start-Sleep -Seconds 1
$httpClient.statusText
} -ArgumentList ("http://admin:pG8nw6tcGNDS@$Site/confirm.htm", "RESET=Yes")
$jobList += $job
}
Wait-Job -Job $jobList | Out-Null
ForEach ($job in $jobList) {
$job | Receive-Job | Out-Null
$job | Remove-Job | Out-Null
}
ForEach ($Site in $sites) {
Write-Host "Phone Reset Initiated for IP: $Site"
}