Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confused about Arrays in vb.net

Status
Not open for further replies.

nick122211

Technical User
Nov 13, 2006
8
US
Ok I am trying to write a little program (3 days work now) that will take one user and assign him rights to another users account to send as. (more rights once I get this one working). I am getting a Member not found error when I run this code. Most of this code is from a sample I am trying to modify.

Dim ObjResource = GetObject("LDAP://" & resource)

'Get Security Desc
Const ADS_ACETYPE_ACCESS_ALLOWED_OBJECT = &H5
Const ADS_FLAG_OBJECT_TYPE_PRESENT = &H2
Const ADS_RIGHT_DS_CONTROL_ACCESS = &H100



Dim objSD = ObjResource("ntSecurityDescriptor")
Dim objDACL = objSD.DiscretionaryACL
Dim objAce = CreateObject("AccessControlEntry")
objAce.Trustee = DomainShort
objAce.AceFlags = 0
objAce.AceType = 5
objAce.Flags = 1
objAce.ObjectType = "{AB721A54-1E2F-11D0-9819-00AA0040529B}"
objAce.AccessMask = 256
objDACL.Addace(objAce)


objSD.DiscretionaryACL = objDACL
ObjResource.Put("ntSecurityDescriptor", ARRAY(objSD))
ObjResource.SetInfo()


Ok so here is the problem. VB.net won't compile with the ARRAY in the " ObjResource.Put("ntSecurityDescriptor", ARRAY(objSD))" line so I removed it and it compiles but fails. Any one know how to do this? Getting frustrated.

Thanks
Nick


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top