0

每当我尝试computer在 Microsoft Active Directory 中创建对象时,如下所示:

var ldap = require('ldapjs');

var client = ldap.createClient({
  url: 'ldap://<<host>>:389'
});

client.bind('<<Admin DN>>', '<<password>>', function(err) {
  if(err){
      console.log('error',err);
  }else{
      console.log('bind is success');
  }
});

var newDN = "CN=testcomputeruser,OU=testou,DC=test,DC=com";
var newUser = {
    cn: 'newtestComputer334',
    objectClass: 'computer',
    description: 'This is test implementation hence this is test description.', 
    //System will populate 'netbootInitialization':'TestNetbootInitialization',
    //System will populate 'netbootGUID':'b0ae470c-16bc-4019-b455-8c96ec515f55',
    //System will populate 'netbootMachineFilePath':'TestNetbootMachineFilePath',
    //System will populate 'siteGUID':'1010101011', 
    //System will populate 'netbootSIFFile':'TestnetbootSIFFile',
    //System will populate 'netbootMirrorDataFile':'TestnetbootMirrorDataFile',
    //System will populate 'msDS-AdditionalDnsHostName':'TestmsDS-AdditionalDnsHostName',
    //System will populate 'msDS-AdditionalSamAccountName':'TestmsDS-AdditionalSamAccountName',
    //System will populate 'msDS-ExecuteScriptPassword':'10100111100011100',    
    //System will populate 'netbootDUID':'10100111100011010101',    
  }

client.add(newDN, newUser,function(err, resp) {
    console.log('newDN : ', newDN);
    console.log('newUser : ' ,newUser);
  if(err){
      console.log('error',err);
  }else{
      console.log('new user is success');
      //////////////////////////////////////////
      client.unbind(function(err) {
          if(err){
              console.log('error unbind : ',err);
          }else{
              console.log('unbind is success');
          }
        });
      //////////////////////////////////////////    
  }
})

此处属性的值netbootSIFFile, netbootMirrorDataFile, msDS-AdditionalDnsHostName, msDS-AdditionalSamAccountName, msDS-ExecuteScriptPassword and netbootDUID将由 Microsoft Active Directory 填充。

根据架构,我们找不到任何相同的指标。

有没有办法从每个对象类的 Active Directory(LDAP) 模式中找到系统属性?

4

1 回答 1

0

如果您Computer通过 LDAP 读取模式中的类对象(例如CN=Computer,CN=Schema,CN=Configuration,DC=test,DC=com),您可以读取systemMayContain属性,它是“只能由系统修改”的属性列表。

或者您可以创建一个计算机对象,设置它允许您使用的最少属性,然后读回所有具有值的属性。您未设置的所有属性都是系统设置的属性。

于 2019-12-31T16:19:18.760 回答