.net - AD: Group does not have a primaryGroupToken attribute -
i need change primary group of user, can delete it's current one. group not have attribute "primarygrouptoken", need in order change primary group of user. here screenshot of attribute editor:
obviously, code responds nothing:
dim domaingroup new directoryentry("ldap://our.domain/cn=domain users,cn=users,dc=our,dc=domain") dim domaingroupgrouptoken string = domaingroup.properties("primarygrouptoken").value.tostring()
is there way manually set it? or there wrong code? in advance.
it's computed property. stealing here, need add call refreshcache
before accessing property:
dim domaingroup new directoryentry("ldap://our.domain/cn=domain users,cn=users,dc=our,dc=domain") domaingroup.refreshcache(new string() {"primarygrouptoken"}) dim domaingroupgrouptoken string = domaingroup.properties("primarygrouptoken").value.tostring()
(not tested, vb bit rusty)
Comments
Post a Comment