How to automate resetting password every period of time

SOLVED
Alex07
Here to help

How to automate resetting password every period of time

Hi All,

 

How can i automate the process of resetting our Wifi password every periodic time, and sending an email only to me with a new password.

 

Thanks for the help

1 ACCEPTED SOLUTION
14 REPLIES 14

Thanks, 

Do you know where i can find my baseUrl?

BrechtSchamp
Kind of a big deal

You can use:

 

https://api.meraki.com/api/v0/networks/

Edit:

And to find your org ID and network ID and so on, it's probably best you have a look at a tutorial for how to use the API's. Have a look here:

https://developer.cisco.com/meraki/build/meraki-postman-collection-getting-started/

 

Alex07_0-1592315938271.png

I'm getting the result when running the script.

BrechtSchamp
Kind of a big deal

It's telling you what format it is expecting... See the line that starts with "Usage: ..."

 

Try running it with:

MerakiPSKTool.ps1 -site "Your network's name" -ssid "Your SSID's name" -action "Change"

 

Works,

Thank you very much for all the help!

Hi,

Can i reset to multiple wifi networks?

For Example:

I have 5 sites , Test1, Test2, Test3, Test4, Test5.

SSID is the same in all the Sites.

So now i want to reset password for each site separate and send all the information in the same email message.

 

Wifi Passwords:

Site1 = "12345"

Site2 = "qwert"

.....

nealgs
Building a reputation

Hi Alex07,

 

As the code stands it only does one named site/ssid per execution

 

You would have to run the code once per site and you would end up with a separate email for each.

 

The idea behind the original code was to allow a sites ssids to be changed individually at a time that suited the site.  Each of our sites are manned differently, some have reception some don't so an email is sent to reception with the new password in it, so changing them all at once and having a block email sent didn't work for us - hence how the code is.

 

Gary 

Hi Nealgs,

 

Thanks for the clearest explanation.

 

Thank you very much.

Maybe anyone know how i can execute this script via Task Scheduler?

Because i want to add this script to Task Scheduler, for example:

In "Action" section i'm always putting those lines:

    Program/script : Powershell.exe
    Add arguments : -ExecutionPolicy Bypass C:\Policies\Meraki\ChangePass.ps1

But this won't work here, because this script can be executed only when using this command:

    .\ChangePass.ps1 -site "Building1" -ssid "Wifi-Guest" -action "Change"

How can i make it work from task scheduler?

Thanks for help

nealgs
Building a reputation

Hi Alex07,

 

The way i've set it up is that under Actions tab in Task Sceduler,

Action: start a program

Program/Script: powershell.exe

Add arguments: <fullpathtoPS1File> -site <yoursite> -ssid <yourSSID> -action Change

 

I've had it running like this for nearly a year without issues. Hope this helps 🙂

 

Gary

Strange, that didn't work for me.

nealgs
Building a reputation

what errors where you getting?

 

path to ps1 file has to include ps1 file also 🙂

 

\\server\scripts\ps1.ps1 -site Site1 -ssid Wifi -action Change

 

Gary

That the problem, that i don't get any errors.

I can see that The Operation completed successfully.

But WiFi password didn't changed and i didn't received any email about it.

Get notified when there are additional replies to this discussion.
Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.
Labels