Page 1 of 1 1
Topic Options
#174979 - 2007-03-26 10:04 PM .setinfo set @error to -2147352567
Sam_B Offline
Getting the hang of it

Registered: 2005-10-25
Posts: 68
Loc: Bern, Switzerland
Hi experts, I have a strange error in my user creation script. When I generate a ADS user object and write it to the ADS, .setinfo returns error -2147352567 (ConvertCOMError translates it to "the storage control block is invalid") BUT the user object gets created! Can anybody tell me what I'm doing wrong? At the moment, I continue with the script ignoring this error, but this can only be a workaround...

Here's the fragment of my script (most of the parts borrowed from this source anyway)

Function AddUser($NotesID, $UserOU, $Givenname, $Surname)
DIM $AdsDomain, $AdsUser, $NORMAL_ACCOUNT, $DisplayName
$NORMAL_ACCOUNT = &0200
;
Debug on
$AdsDomain = GetObject("LDAP://" + $UserOU)
If $AdsDomain=0
ConvertCOMError(@ERROR)
$AddUser = "Error occured during AddUser: " @SERROR
EndIf
$DisplayName = $Givenname + " " + $Surname
$AdsUser = $AdsDomain.Create("user","cn=" + $DisplayName)
If $AdsUser = 0
$AddUser = "Unable to create user $NotesID"
Return
EndIf

$adsUser.Put("sAMAccountName", $NotesID)
$adsUser.Put("userPrincipalName", $NotesID + "@@EMEA.globalcsc.net")
$adsUser.Put("givenName", $Givenname)
$adsUser.Put("sn", $Surname)
$adsUser.Put("displayName", $DisplayName)
$adsUser.Put("HomeDirectory","\\cscdssbrn001.ch.emea.csc.com\" + $NotesID + "$")
$adsUser.Put("homeDrive", "I:")
$adsUser.Put("Description","User created by " + @USERID + " with script " + @SCRIPTNAME)

;Write the newly created object out from the property cache
$adsUser.SetInfo
If not @ERROR = 0
ConvertCOMError(@ERROR)
$AddUser = "Error occured during AddUser: " @SERROR
Return
EndIf
....
EndFunction

Thanks for you help!

Top
#175045 - 2007-03-28 08:00 PM Re: .setinfo set @error to -2147352567 [Re: Sam_B]
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Take a look at my code in the following post. It does not generate an error when tested. Compare it to your code.

LDAP User Creation Question
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#175200 - 2007-04-04 11:54 AM Re: .setinfo set @error to -2147352567 [Re: Howard Bullock]
Sam_B Offline
Getting the hang of it

Registered: 2005-10-25
Posts: 68
Loc: Bern, Switzerland
Thanks a lot for the hint. I adjusted my script with your code and it is working now!
Top
Page 1 of 1 1


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 2220 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.059 seconds in which 0.031 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org