You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chris Lasell edited this page Aug 28, 2023
·
1 revision
This will set the membership of a static computer group from the computer names contained in a local CSV file
require'ruby-jss'require'csv'# This csv file contains the computers that should be in the group# Computer names are in the first field of this csv file.# Get the names into an arraydesired_comp_names=CSV.read('/path/to/computernames.csv').map(&:first)# connect to Jamf Pro# you'll be prompted for the password, or it can be given with the 'connect' commandJamf.connect'https://apiuser@myjamfhost.jamfcloud.com'# get the group by namestatic_group=Jamf::ComputerGroup.fetchname: 'StaticGroupName'# replace any existing membership with the desired namesstatic_group.members=desired_comp_names# save your changesstatic_group.save