The best way to start troubleshooting this is to put a SetInfo after each PutEx and an error check of..
If (Win32::OLE->LastError != 0) { print "objuser (or whatever): ".Win32::OLE->LastError(); } After each SetInfo. As well, I think a simple Put (instead of PutEx) will work. Steven -----Original Message----- From: henry isham [mailto:[EMAIL PROTECTED]] Sent: Friday, February 14, 2003 2:12 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Adding Users to AD with OLE All, I'm trying to execute the script below but it's returning this error: Win32::OLE operating in debugging mode: _Unique => 1 Win32::OLE(0.1502) error 0x8007202f: "A constraint violation occurred" in METHOD/PROPERTYGET "SetInfo" The really bizzare thing here is that this script's VBSCRIPT equivalent works fine. So, I'm totally stumped! Begin Script ------------ use Win32::OLE; my $Name = "Henry Isham"; my $ID = "hisham"; my $Container = Win32::OLE->GetObject("LDAP://ou=sitename,dc=corp,dc=net"); my $NewUser = $Container->Create("user","cn=" .$Name); $NewUser->PutEx("SamAccountName",$ID); $NewUser->PutEx("objectClass","user"); $NewUser->PutEx("scriptPath","sitename.vbs"); $NewUser->PutEx("userAccountControl",512); $NewUser->SetInfo; print Win32::OLE->LastError(); = Z) fyXXh饧`ᴚ)Ŋlzr琼y+Z(:.尞˛ mm+-젱㵥bj瑮oj)fj潌˛ _______________________________________________ Perl-Win32-Users mailing list [EMAIL PROTECTED] To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs