Bulk Name Change

UMASDBill
Conversationalist

Bulk Name Change

I searched for a solution for renaming multiple AP's at once while we build a network in a new building. I didn't find one so I hope how I did it might help someone else. Using postman I created the code needed to make the change to 1 ap's name. I exported that code to powershell. Then I took the part that is actually making the change and pasted it into the excel spreadsheet where I have my list of ap's and what their name should be. I used the concatenate function to insert the device serial numbers and names into that line of code. Then I pasted it all into powershell and clicked run. Here is what the code looked like with identifiable date changed. I am sure this method could be applied to make changes to other devices. I hope this helps someone. 

 

$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Accept", "*/*")
$headers.Add("Content-Type", "application/json")
$headers.Add("X-Cisco-Meraki-API-Key", "putapikeyhere")

$body = "{
`n `"name`": `"My AP`",
`n `"lat`": 37.4180951010362,
`n `"lng`": -122.098531723022,
`n `"serial`": `"Q000-ABCD-5678`",
`n `"mac`": `"00:00:00:33:44:55`",
`n `"tags`": `" recently-added `"
`n}"

$response = Invoke-RestMethod 'https://api.meraki.com/api/v0/networks/L_123456789123456789/devices/Q000-K5ZH-BFRX?name=A100' -Method 'PUT' -Headers $headers -Body $body
$response = Invoke-RestMethod 'https://api.meraki.com/api/v0/networks/L_123456789123456789/devices/Q000-6RP5-8WC6?name=A101' -Method 'PUT' -Headers $headers -Body $body
$response = Invoke-RestMethod 'https://api.meraki.com/api/v0/networks/L_123456789123456789/devices/Q000-AGNN-4B6D?name=A102' -Method 'PUT' -Headers $headers -Body $body

 

$response | ConvertTo-Json

1 Reply 1
JasonM
Meraki Employee
Meraki Employee

It might also be beneficial to check out this Youtube video on Mass Meraki Changes Without the Need to Code where they utilize Postman collection runner to automate changes in bulk.

Get notified when there are additional replies to this discussion.