예제 #1
0
파일: adcon.py 프로젝트: meyersh/mldap
    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'))
예제 #2
0
파일: aduser.py 프로젝트: meyersh/mldap
    def get_uac(self):
        """ Return the UAC object representing this user. """

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