|
|
|||||||
I am having trouble setting a user attribute in AD to nothing with Kix. Still running 4.22 I can set the attribute to any text, but get errors trying to set it to nothing. $adsUser.postOfficeBox = "" $adsUser.setinfo will not work. $adsUser.postOfficeBox = "New Text" $adsUser.setinfo This comes back error free and changes the field to "New Text". What am I not seeing here ? Thanks |
||||||||
|
|
|||||||
well, "" will set the value to zerolength string. there is no nothing available in kix. you could try: Code:
but I have no idea will that kinda work. as always with com, it goes to the guessing side. |
||||||||
|
|
|||||||
Well. Still does not change the value in AD, but I get a new error code. Before I was getting error 9 E_ADS_OBJECT_UNBOUND The specified ADSI object is not bound to a remote resource. Make sure to call GetInfo on a newly created object after SetInfo has been called. With the $Nothing I get error 16389 Which I don't see in error lists I have found to date. |
||||||||
|
|
|||||||
BTW it is not a newly created object. As I noted, I can easily change the text to anything else, just not to nothing. |
||||||||
|
|
|||||||
I googled a vb snipet and converted it to kix... Totally untested. Code:
|
||||||||
|
|
|||||||
sure it's untested as it's not kix syntax. something more like: Code:
but that looks little odd too. alpo, could you post the source? |
||||||||
|
|
|||||||
As you wish sir... http://www.dx21.com/SCRIPTING/ADSI/ADGUI/USER2.ASP ...and just for clarification, I never said I was a COM expert. |
||||||||
|
|
|||||||
hmm... indeed, it looks pretty same now. wonder will someone try it out too and btw, who did speak about com expert? we have shawn for that stuff. I think the issue here was about conversion of vbs arguments to kixtart args. |
||||||||
|
|
|||||||
Code:
Yes this works, but of course my next question. What is the difference between Code:
and Code:
and where can I read about putEX ? THANKS ! |
||||||||
|
|
|||||||
well, all the adsi stuff is in the adsi reference of http://msdn.microsoft.com the difference between put an putEx is the obvious Ex as in Extended. and in this case the argument to specify if the value is wished to be emptied. |
||||||||
|
|
|||||||
All I meant was I never know what the syntax is going to be for com objects without testing it... it seems like sometimes its with parenthesis, and sometimes it isn't. The best thing is we got him a solution. |
||||||||
|
|
|||||||
Allen, ja, sure, I'm with ya. as a side note, it never is without paranthesis with kixtart |
||||||||
|
|
|||||||
Thanks guys - I found this info, so I thought I'd post in case someone searches this board for "PutEX". Quote: |
||||||||
|
|
|||||||
Thanks for the informational post Gerald_G. You should be aware however that there are many post about PutEx on the board. If you did a search, make sure to change the date range "newer than X years" value. I found a lot of posts (86) that reference PutEx when I set the search for posts up to 4 years old. |