removing AD user attributes?

i recently discovered our login script is running twice cos it's in the group policy and on the user profile 'login script' attribute. a legacy from migrating from NT no doubt

have tried to create a vbscript to wipe the attributes but there's a problem. it works if i try and set the value to something else but fails if i try to set it to ""

set objParent = GetObject("LDAP://ou=pupils,dc=domain")
objParent.Filter = Array("user")
for each objUser in objParent
   Wscript.Echo "Modifying " & objUser.Get("sAMAccountName")
   objUser.ScriptPath = ""
   objUser.SetInfo
next

with "" i get the error  the attribute syntax specified to the directory service is invalid
with NULL i get the error unspecified error.

any ideas?
LVL 3
browolfAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Debsyl99Commented:
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
browolfAuthor Commented:
that's it.  knew it'd be something known. couldnt seem to find it myself.

cheers.
0
JAaron AndersonProgramming Architect @ Widener UniversityCommented:
this link doesnt exist please post remedy inline...
0
JAaron AndersonProgramming Architect @ Widener UniversityCommented:
Since the Google Link is no longer available...
Im trying to perform this in VBscript.

I have 2 attributes I want to not just make null but delete them expongued from the User record.

            
strUserToPurge = InputBox("Type in the ID of user", "PURGE USER")
If InStr(strUserToPurge, "\") > 0 Then strUserToPurge = Mid(strUserToPurge, InStr(strUserToPurge, "\") + 1)

strUserPath = Get_LDAP_User_Properties("user", "name", strMyDomain & "\" & strUserToPurge, "adspath", strConnUser, strConnPassword)


' Delete target Attribute       strAttribute1 = "myattribute1"
      Set objUser = GetObject(objRecordSet.Fields("strUserPath").Value)
            objUser.PutEx ADS_PROPERTY_CLEAR, "myattribute1", 0 ' Completely erase
      objUser.SetInfo


' Delete target Attribute       strAttribute2 = "myattribute2"
      Set objUser = GetObject(objRecordSet.Fields("strUserPath").Value)
            objUser.PutEx ADS_PROPERTY_CLEAR, "myattribute2", 0 ' Completely erase
      objUser.SetInfo


please help thx
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows 2000

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.