![]() ![]() ![]() This means you could have one script that was used in multiple login policies each scoped to the appropriate users with the DNS server as a variable for the script as so. Networksetup -setdnsservers Ethernet 185.228.168. You can also use the optional parameter which can be referenced as 4 in the script. To change these preferences on your Mac, choose Apple menu > System Preferences, click Network, select a network service in the list on the left, click Advanced, then click DNS. Use the DNS pane of Network preferences on your Mac to enter DNS servers and search domains. Run dialogs that interact with end users and adjust system. Change DNS settings in Network preferences on Mac. Expand the Jamf Pro database to collect more inventory items using Extension Attributes. You’ll learn how to: Create one-liners for simple ongoing maintenance. Networksetup -setdnsservers Ethernet 185.228.168.139 In our webinar, Scripting 101 for Apple Admins, we’ll show you how to utilize scripts to accomplish some amazing results. # Older students get an open, but filtered experience: Networksetup -setdnsservers Ethernet 8.8.8.8 ![]() Networksetup -setdnsservers Wi-Fi 8.8.8.8 The DNS addresses will change somewhat but I have the script successfully deployed to a couple of test machines. ![]() This is the script I cam up with, and testing reveals that it works good, too. You can have as many commands as you like between the enclosing bracket lines as long. One other consideration is that if you are running a script in a login policy it will hold up the login process and any other policies until it's completed (depending on the JSS settings) you can mitigate this by passing the script contents to a seperate task (not sure on the terminology but it works). You can also use the optional parameter which can be referenced as $4 in the script. If you do it in a policy with login as the trigger $3 will be the username, you can also scope policies to users/groups for login triggers so you don't actiually need the conditionals. If your happy with it running only when JAMF is available you can probably approach it something along these lines. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |