
setting user rights problem using adsi
yes, the code should work fine. i'm using asdi 2.0.
i actually took a look at the nt resource kit, found some examples for asdi
2.0 written in Visual Basic. tried them, and got the same error message at
the same point. i assume it is some setup problem with our domain here, and
me not having the correct rights. i am administrator, but not for the full
domain.
if you have any other ideas, let me know.
danke schoen,
- martin
Quote:
> Hi, Martin, I've copied your code. After changing domainName and userName,
> it worked as expected: no error, "user cannot change password" flag set.
I'm
> using ADSI 2.5 Beta 1. What's your version?
> Uwe
> > *** following is a part of my script to get a user object using adsi
> > i always get an error message when trying to set the userflag property.
> all
> > documentation says this is the right way. also, i do have the correct
> > rights. what's wrong?
> > dim flag
> > flag = &H40
> > dim domainName
> > domainName = "thinkinc/sfmgloeckle"
> > dim userName
> > userName = "new"
> > dim objUser
> > set objUser = GetObject("WinNT://" & domainName & "/" &
userName)
> > dim oldFlag
> > oldFlag = objUser.get("UserFlags")
> > MsgBox("old flag:" & oldFlag)
> > dim newFlag
> > newFlag = oldflag Or flag
> > MsgBox("new flag:" & newFlag)
> > ' error occurs on next statement !!!!!!!!!!!!!!!!!!
> > objUser.put "UserFlags", newFlag
> > objUser.SetInfo