Solved

How can I create a script to change the wireless key using the Ubiquiti Unifi controller or Unifi wireless access points

Posted on 2016-09-07
7
24 Views
Last Modified: 2016-10-10
Hello Experts,

I have a desire to create a script that will change the wireless access key on a Guest wireless network comprised of 5 Unifi wireless access points.  I have the Unifi controller software installed on a Windows 2012 R2 server and all seems to be working well.

I would like a script that can run on a monthly basis to change the wireless key\password (various reasons for this).  I am having issues finding any information on how to do that on a Windows server using a command (bat) file or Powershell.

Any assistance would be appreciated.

Thanks,
karislove
0
Comment
Question by:karislove
  • 4
  • 3
7 Comments
 
LVL 20

Accepted Solution

by:
masnrock earned 500 total points (awarded by participants)
ID: 41806269
Not sure it would be worth your while to accomplish what you'd like. The central provisioning information I believe is in a database.

But...

If you go to C:\Users\[user name which you installed controller under]\Ubiquiti UniFi\data\devices

You will find folders that device out the type of device (most likely UAP). Within there, you will see folders that are named after the MAC addresses of each device. In there, you will see a system.cfg file. That will contain what you're looking for.

However, since you most likely have each WAP provisioning to the controller, it is possible that it might just get changed back to what the controller has. Now if you want to modify the database itself, the controller I believe utilizes MongoDB.
0
 

Author Comment

by:karislove
ID: 41806435
masnrock

Thanks for the info.  I see the files you are talking about.  I will have to play and see if the controller software can be updated in that way.  

I found SSH commands to modify the UAPs directly but the controller is unaware of the changes and the next time you modify settings using the controller it overwrites the UAPs configuration.

I am really looking for a powershell script that will interface with the controller code\db so I can utilize the provisioning facilities of the controller.  I am not familiar with MongoDB so writing anything will be a fair bit of learning.  I was hoping to get a significant shove in the right direction.

Thanks,
karislove
0
 
LVL 20

Expert Comment

by:masnrock
ID: 41806462
Well, you are now pointed in the right direction, knowing that your battle is really with a database. It is just debatable how easily what you need can be done.

You may want to consider looking for a programmer or consultant who might be able to write what you need.

Just a thought, have you considered implementing 802.1X?
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 

Author Comment

by:karislove
ID: 41806507
A programmer is the next step if it looks like the time spent learning outweighs the cost of the programmer.  You know that numbers game.

802.1x would be a good place to go but it doesn't seem to fit the current situation.  Cause... ya know... reasons.  Just changing the key seems to fit best for the moment.  

All I need is a powershell script to update the key and reprovision the UAPs.  Everyone is happy after that.  My life gets easier when everyone is happy.

Time to learn MongoDB.

Thanks,
karislove
0
 
LVL 20

Assisted Solution

by:masnrock
masnrock earned 500 total points (awarded by participants)
ID: 41807732
I'd recommend doing a gig listing on here then, as well as some other sites. Lots of people should be able to do it.

Alternatively, if you want a little bit of info for you to try yourself...
https://danielweberonline.wordpress.com/2012/01/30/query-and-update-data-on-mongodb-using-powershell/
0
 

Author Comment

by:karislove
ID: 41809083
masnrock,

Daniel Weber is already in my list of research links.  Thanks for the thought though.  I am going to research my options later this week and see where that leads.  I will update this thread next week with what I find.

I may post a gig if I can't get over the wall I am up against.

Thanks,
karislove
0
 
LVL 20

Expert Comment

by:masnrock
ID: 41836562
Programming is necessary, and will be done either in house or as a gig. There does not exist a simple solution that comes out of the box.
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now