Created
July 25, 2017 23:41
-
-
Save fuzzylogiq/15818ac813fa9ac53b8b561d33d7636d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sites = j.Site() | |
| computers = j.Computer() | |
| computers2 = computers.retrieve_all(subset='general') | |
| mobiledevices = j.MobileDevice() | |
| mobiledevices2 = mobiledevices.retrieve_all(subset='general') | |
| computer_sites = [ computer.find('general/site/id').text for computer in computers2 if computer.find('general/remote_management/managed').text == 'true' ] | |
| mobile_sites = [ mobile.find('general/site/id').text for mobile in mobiledevices2 if mobile.find('general/managed').text == 'true' ] | |
| for site in sites: | |
| print "%s:\n Computers: %s\n Mobile Devices: %s" % (site.name, computer_sites.count(str(site.id)), mobile_sites.count(str(site.id))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment