
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-31-2014 08:48 AM
So for one reason or another (usually an OS update) our users will lose their saved password to our private network and end up on our public network. This means they can't print, access internal resources, etc. I'm trying to come up with a way to put something in Self Service that will get them back on our private network. Our JSS is externally facing, but not our Casper share so I was trying to do something that could utilize the Files and Processes > Execute Command policy on.
I was trying to use the "networksetup -addpreferredwirelessnetworkatindex" command because in one line I could get the wireless network in and make sure it was at the top of the preferred list...and I could do this without a script, and therefore without a share. However, I've been unable to get it to work. Does this not work in Yosemite anymore? Any other thoughts on how I can accomplish this?
Thanks for any help!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-31-2014 11:17 AM
Is there a way to do two commands in one line of text? I'm not having luck with ; or && based on my Google searches.
If I can just get this line to work, I can use whats built into the JSS and everything would be perfect. Don't mind the en1/en0 stuff, I'll use Smart Groups for that aspect.
networksetup -addpreferredwirelessnetworkatindex en0 GSD-PantherNet 0 WPA2 PASSWORD; networksetup -removepreferredwirelessnetwork en0 GSD-Public
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-31-2014 09:15 AM
You could script it, install the script into a repository (I keep some scripts on each system for various purposes), and then execute the script as a Files and Processes command. You get to see all of the script output in the JSS policy log, works very well.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-31-2014 09:44 AM
I might be a little off on this, but (if you're running JSS 9.6) you could create a configuration profile containing the private network and have it accessible from Self-Service.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-31-2014 10:48 AM
I'd like to avoid configuration profiles if possible for wireless. Its been a nightmare in the past because if you ever need to remove or change them, you lose connection to the device. I've finally had success with that command, although its dumping it to the bottom of the list...but I'll keep working on it. I'm definitely not fantastic with commands and scripting, although playing around with problems like this is good for learning!
Thanks for the help so far!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-31-2014 11:17 AM
Is there a way to do two commands in one line of text? I'm not having luck with ; or && based on my Google searches.
If I can just get this line to work, I can use whats built into the JSS and everything would be perfect. Don't mind the en1/en0 stuff, I'll use Smart Groups for that aspect.
networksetup -addpreferredwirelessnetworkatindex en0 GSD-PantherNet 0 WPA2 PASSWORD; networksetup -removepreferredwirelessnetwork en0 GSD-Public

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Posted on 10-31-2014 11:21 AM
Or I could just test it in Casper and not in Terminal. I got it to work. Thanks everyone!
