diff --git a/scripts/includes/GLPIAPI.py b/scripts/includes/GLPIAPI.py index 39e147d..2b3b984 100644 --- a/scripts/includes/GLPIAPI.py +++ b/scripts/includes/GLPIAPI.py @@ -55,6 +55,7 @@ class GLPIAPI: return deviceID, data, search["totalcount"] elif(search["totalcount"] > 1): + deviceID = list(search["data"].keys()) return deviceID, search["data"], search["totalcount"] else: return None, None, 0 diff --git a/scripts/includes/airwatchAPI.py b/scripts/includes/airwatchAPI.py index b314e7c..d649817 100644 --- a/scripts/includes/airwatchAPI.py +++ b/scripts/includes/airwatchAPI.py @@ -182,8 +182,12 @@ class AirwatchDevice: self.GroupId = device["LocationGroupId"]["Id"]["Value"] self.Group = device["LocationGroupName"] self.GroupUuid = device["LocationGroupId"]["Uuid"] - self.UserId = device["UserId"]["Id"]["Value"] - self.User = device["UserName"] + if(device["UserId"].get("Id") != None): + self.UserId = device["UserId"]["Id"]["Value"] + self.User = device["UserName"] + else: + self.UserId = None + self.User = None self.UserEmail = device["UserEmailAddress"] self.PlatformId = device["PlatformId"]["Id"]["Value"] self.Platform = device["Platform"]