def isUserInAD(user): if not computer.isInAD(): return False rc, groups = localUserHelper.getGroupsOfLocalUser(user) if not rc: return False return "domain users" in groups
def isInAD(): """ Check if the computer is joined to an AD :return: True or False :rtype: bool """ rc, groups = localUserHelper.getGroupsOfLocalUser(krbHostName()) if not rc: return False return "domain computers" in groups
def isInGroup(groupName): """ Check if the computer is part of an ldap group :param groupName: The name of the group to check :type grouName: str :return: True or False :rtype: bool """ rc, groups = localUserHelper.getGroupsOfLocalUser(krbHostName()) if not rc: return False return groupName in groups
def isInGroup(groupName): """ Checks if the current user is part of a given group :param groupName: The name of the group :type groupName: str :return: True if the user is part of the group, False otherwise :rtype: bool """ rc, groups = localUserHelper.getGroupsOfLocalUser(username()) if not rc: return False return groupName in groups
def isUserInAD(user): """ Checks if a given user is an AD user. :param user: The username of the user to check :type user: str :return: True if the user is in the AD, False if it is a local user :rtype: bool """ if not computer.isInAD(): return False rc, groups = localUserHelper.getGroupsOfLocalUser(user) if not rc: return False return "domain users" in groups
def isInGroup(groupName): rc, groups = localUserHelper.getGroupsOfLocalUser(username()) if not rc: return False return groupName in groups
def isInAD(): rc, groups = localUserHelper.getGroupsOfLocalUser(krbHostName()) if not rc: return False return "domain computers" in groups