#91849 - 2003-03-31 11:03 AM
how to clear a property
|
ebiard
Fresh Scripter
Registered: 2003-03-13
Posts: 14
|
I don't manage to clear a property. I always get an error back when .SetInfo is done. Thanks.
|
|
Top
|
|
|
|
#91851 - 2003-03-31 11:39 AM
Re: how to clear a property
|
ebiard
Fresh Scripter
Registered: 2003-03-13
Posts: 14
|
@SERROR after .SetInfo : COM exception error "SetInfo" ((null) - (null)) [-2147352567/80020009]
code : $AD=GetObject("...") For Each $User in $AD $User.cramBac=$Bac ... $User.SetInfo ?@SERROR ...
if $Bac is empty or "", it does not work. Of course, cramBac property exists for the object.
|
|
Top
|
|
|
|
#91853 - 2003-04-01 12:03 AM
Re: how to clear a property
|
ebiard
Fresh Scripter
Registered: 2003-03-13
Posts: 14
|
Let's go for this short example : code:
$User=GetObject("LDAP://CN=testattr,OU=testattrib,OU=testcitrix,OU=Informatique,OU=Siege,DC=w2k,DC=cram10,DC=cnav") ?$User.fullname $User.fullname="" $User.SetInfo ?@SERROR Get $x
|
|
Top
|
|
|
|
#91855 - 2003-03-31 01:10 PM
Re: how to clear a property
|
ebiard
Fresh Scripter
Registered: 2003-03-13
Posts: 14
|
Don't so fast, thank you. You can moify the code with "LDAP://server/...", this doesn't change anything.
|
|
Top
|
|
|
|
#91857 - 2003-03-31 01:27 PM
Re: how to clear a property
|
ebiard
Fresh Scripter
Registered: 2003-03-13
Posts: 14
|
Works fine with WinNT provider ! Why not with the LDAP provider ? It would have been easier for me (got to directly point a specific OU). Thanks.
|
|
Top
|
|
|
|
#91858 - 2003-03-31 01:54 PM
Re: how to clear a property
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
#91859 - 2003-03-31 02:18 PM
Re: how to clear a property
|
Jochen
KiX Supporter
   
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
|
Top
|
|
|
|
#91860 - 2003-03-31 02:50 PM
Re: how to clear a property
|
ebiard
Fresh Scripter
Registered: 2003-03-13
Posts: 14
|
Well... Seems that i really need to make it work with the LDAP provider because : I need to change properties (and also clear them) that are not system based. These were implemented with a schema extension of the user class. And... These kind of properties are not seen with the WinNT provider... AFTER SOME TESTING (on the same object) : - WINNT : ok to view, fill or empty any system based property. but cannot address extented-schema based properties. - LDAP : ok to view or fill any type of property. but cannot empty any. Thanks for your help (maybe i missed something ?).
|
|
Top
|
|
|
|
#91861 - 2003-03-31 05:27 PM
Re: how to clear a property
|
ebiard
Fresh Scripter
Registered: 2003-03-13
Posts: 14
|
FOUND IT!
It works when using the PutEx method (see msdn-PutEx) like : code:
$<object>.PutEx(1,<property>,"") $<object>.SetInfo
1 is for "ADS_PROPERTY_CLEAR".
Thanks again for your help.
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 532 anonymous users online.
|
|
|