.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:

enter image description here

obviously, code responds nothing:

enter image description here

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

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -