Your current problem may be that you do not have the "adssecurity.dll" on
your system, or it is not registered.  This DLL registers the ADsSID Object
on your system, so OLE knows what it is, and how to handle this object.
This dll is found as part of the ADSI SDK, on M$' site.

Mail me offline if you can't find it.

Then place the DLL somewhere like winnt\system32 (anywhere that your path
statement will find it) and then run this from the command prompt.

'regsvr32 adssecurity.dll'

Although, I too, have come to learn OLE as it applies to Exch 5.5 and a few
other implementations, I need to give thanks to Andrew Bastien and this list
(and archives), for their help.

As well, Yes, I have deprecated "CreateObject" in favor of "new" in my
implementation... CreateObject should still work. 

Though, I don't think that's your current problem.

Steven

-----Original Message-----
From: Jonathan C. Detert [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 3:58 PM
To: [EMAIL PROTECTED]
Subject: Win32::OLE->CreateObject('ADsSID) fails: Invalid class string


Hello,

I'm new to Win32::OLE and am trying to use it to create/delete Ms.
Exchange mailboxes.  I'm using code I found in the archives
( http://aspn.activestate.com/ASPN/Mail/Message/215825 ) and modified for
my environment.

Thanks to Steven Manross, I got past my first hurdle (i did not know my
exchange ou value).  (actually, i think the code i found in the archive
is by him as well)

So, now the code creates a mailbox, but it bombs when trying to
associate an NT account to the mailbox.  The code snippet where it fails
is this:
-----------------
     my $sid = Win32::OLE->CreateObject("ADsSID") or
             die "CreateObject(ADsSID): ", Win32::OLE->LastError."\n";
     $sid->SetAs($ADS_SID_WINNT_PATH, "WinNT://$NT_DOMAIN/$username,user");
     my $sidHex = $sid->GetAs($ADS_SID_HEXSTRING);
     $mailBox->Put("Assoc-NT-Account", $sidHex );
     $mailBox->SetInfo;
-----------------
The error I get is from the CreateObject : "0x800401f3: Invalid class
string"

Any ideas?  My only clue is this:

Reading the perldoc for Win32::OLE reveals that the CreateObject method
is deprecated in favor of 'new' instead.  Fine.  However, the doc says
you need to pass 'new' a "program id" or a "class id".  Maybe "ADsSID"
isn't a valid 'class id' in this context?  If not, then what should I
use?  Also, I'm running the Win32::OLE code on a box that is remote to
the MsExchange server box.  Do I need to specify the hostname of the
MsExchange server box in my call to 'new' ?

Thanks for whatever help you lend.
-- 
Happy Landings,

Jon Detert
Unix System Administrator, Milwaukee School of Engineering
1025 N. Broadway, Milwaukee, Wisconsin 53202
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to