Beispiel #1
0
    def getuac(self, samaccountname):
        """ Retrieve the userAccountControl field for a given user.
        >>> ad.getuac('shaunt').flags()
        ['ADS_UF_NORMAL_ACCOUNT']

        >>> ad.getuac('shaunt')
        <<class 'mldap.uac'> object (['ADS_UF_NORMAL_ACCOUNT'])>

        >>> ad.getuac('wimpy').set(uac.ADS_UF_PASSWORD_EXPIRED).commit()

        :return: a :class:`uac.uac` object derived from these flags.
        """
        userAccountControl_flags = int(
            self.getattr(samaccountname, 'userAccountControl'))

        return uac(value=userAccountControl_flags,
                   ad_con=self,
                   objectguid=self.getattr(samaccountname, 'objectGUID'))
Beispiel #2
0
    def get_uac(self):
        """ Return the UAC object representing this user. """

        return uac(self.userAccountControl,
                   ad_obj=self.adcon, objectguid=self.objectGUID)