![]() # -Updated by Bram Cohen, JAMF Software, LLC, on September 10th, 2014 # -Updated by Sam Fortuna, JAMF Software, LLC, on August 5th, 2014 # -Created by Sam Fortuna, JAMF Software, LLC, on June 18th, 2014 # The format must be asset number in the first column, serial number in the second, mac address in the third, and computer name last # This script reads a CSV of computer data and imports them to the JSS. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ![]() # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES IN NO EVENT SHALL JAMF SOFTWARE, LLC BE LIABLE FOR ANY # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # THIS SOFTWARE IS PROVIDED BY JAMF SOFTWARE, LLC "AS IS" AND ANY # derived from this software without specific prior written permission. # names of its contributors may be used to endorse or promote products # * Neither the name of the JAMF Software, LLC nor the # documentation and/or other materials provided with the distribution. # notice, this list of conditions and the following disclaimer in the # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions of source code must retain the above copyright # modification, are permitted provided that the following conditions are met: # Redistribution and use in source and binary forms, with or without # Copyright (c) 2014, JAMF Software, LLC. (they got me going on the csv idea and had the original script designed for user import in this fashion.) I am open to any ideas people have about this. I have hijacked this script and edited it as far as I can with help from the wonderful people at JAMF. csv file and sort the data into an xml file to be POST'ed into the API. So you can use that in your scripts to confirm the upload actually worked, like: if thenĮDIT: Forgot to mention to check out your JSS' built in help for more information, in case you haven't already: Throwing in -f asks curl to specifically get an exit status. So even if the JSS refuses the POST command because of a bad username/password or malformed syntax or a bad xml file, curl will happily think it worked, as long as it got some kind of response back from the server. Curl normally considers any response from the server to be a successful exit status. ![]() I guess experiment.īTW, the -f flag in the curl command, while not strictly required, is something I recommend. Haven't specifically created new computer records via the API, so I'm not clear on that. ![]() But I may be wrong because you're using the xml file for that information. IOW, the syntax would look something like the following: curl -sfku apiusername:apipassword -T /path/to/xmlfile.xml -X POSTĪlso, I'm not sure, but you may need to also specify something else besides just /computers, like /id, /name, /udid, /serialnumber, etc. What you're looking for is the -T flag before the xml file path I believe. I may also be contacting JAMF as I am up against a time crunch on this. I am using JSS 9.61 and am ordering new iMacs from Apple. I could try to do prestage imaging to simply install the apps I want, but I was hoping to be able to front load computer groups and policy scoping. I am fine with needing to add more information to the xml file such as platform, os version and so on if it helps with the pre-deployment. The big picture is that I will be receiving new imacs and would like to take an excel inventory of the mac addresses and serial numbers, export it to xml and import the entries into the JSS so I can group computers and scope policies before the computers arrive. I know it should end with /path/to/xmlfile -X POST. I understand the command will look something like " after that I am unsure of what to put in for a path. I have an xml file with both pieces of information in it ready to be imported. I am not understanding the syntax for this. I am trying to import a computer using the mac or serial number into the JSS using the api.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |