none
winlogon登录,enum所有用户,如何筛选掉组策略中本地拒绝登录属性的用户! RRS feed

  • 问题

  • nStatus = NetUserEnum(pszServerName,
                                dwLevel,
                                FILTER_NORMAL_ACCOUNT, // global users
                                (LPBYTE*)&pBuf,
                                dwPrefMaxLen,
                                &dwEntriesRead,
                                &dwTotalEntries,
                                &dwResumeHandle);

     for(pTmpBuf = pBuf;i < dwEntriesRead;i++,pTmpBuf++)
     {
      //if((pTmpBuf->usri2_flags&UF_ACCOUNTDISABLE) != UF_ACCOUNTDISABLE&&FindHideAccount(pTmpBuf->usri2_name))
      if(((pTmpBuf->usri2_flags&UF_ACCOUNTDISABLE) != UF_ACCOUNTDISABLE)&&((pTmpBuf->usri2_flags&UF_LOCKOUT)!=UF_LOCKOUT)&&(!FindHideAccount(pTmpBuf->usri2_name)))
      {
               
             // Validate parameters.
       if(j == dwItem)
       {
        pTmpBufin = pTmpBuf;
        comboxUser[dwItem] = pTmpBuf;
       }
       j++;
       
    //   pitem = (PWSTR)malloc(wcslen(pTmpBuf->usri0_name));
    //   wcsncpy_s(pitem,sizeof(pTmpBuf->usri0_name),pTmpBuf->usri0_name,sizeof(pTmpBuf->usri0_name));;
      }
      
     }

    我想问下,如何枚举去掉 在组策略中本地安全中的拒绝本地登录的用户呀,比如说我设置了,test用户,在组策略中添加到拒绝本地登录,但是我能枚举到test这个用户肯定是进不去的,我要怎么吧这个过滤到,我找了好多属性都不可以呀,虚心请教下,我学习

    2011年2月23日 8:46

全部回复