VB is not installed on my machine so I can't test that...however I do have
perl; how would I call it from perl? The following gives me an 'invalid
class string' error:
$oIADsTools = Win32::OLE->CreateObject("IADsTools.dll");
FYI the c# app evokes the same memory error when run from Win2000/SP4 and
XP/SP2. I don't care about timestamps; I'm just using it to resolve GPO
names from their GUIDs.
-Frank
>I am not sure why you would see that, do you get the same when using it
>from VB or perl?
[quoted text clipped - 22 lines]
>> -Frank Brown
>> http://www.inwa.net/~frog/
Joe Richards [MVP] - 17 Sep 2004 00:28 GMT
Here is an example perl script of using iadstools (watch line wrap)
use OLE;
print "\niadstools-test V01.00.00pl Joe Richards (joe\@joeware.net) September
2004\n\n";
$IADSTool=CreateObject OLE ("IADsTools.DCFunctions");
$fqdn=shift;
$nc=shift;
$directpartnercount=$IADSTool->GetDirectPartners($fqdn,$nc);
if ($directpartnercount == -1)
{
print " ERROR - Couln't retrieve partners:
".$IADSTool->LastErrorText."\n";
exit;
}
for $k(1..$directpartnercount)
{
print "--\n";
print "Partner Name: ".$IADSTool->DirectPartnerName($k)."\n";
print "Last Success: ".$IADSTool->DirectPartnerLastSuccessTime($k)."\n";
print "Last Attempt: ".$IADSTool->DirectPartnerLastAttemptTime($k)."\n";
print "Failure Count: ".$IADSTool->DirectPartnerNumberFailures($k)."\n";
print "--\n";
}
You should also be able to call it from vbscript
wscript.echo
wscript.echo "iadstools-test2 V01.00.00vbs Joe Richards (joe\@joeware.net)
September 2004"
wscript.echo
wscript.echo
set IADSTool=CreateObject("IADsTools.DCFunctions")
fqdn=wscript.arguments.item(0)
nc=wscript.arguments.item(1)
directpartnercount=IADSTool.GetDirectPartners(cstr(fqdn),cstr(nc))
if (directpartnercount = -1) then
wscript.echo " ERROR - Couldn't retrieve partners: " &
IADSTool.LastErrorText() & "."
wscript.quit()
end if
for k=1 to directpartnercount
wscript.echo "--"
wscript.echo "Partner Name: " & IADSTool.DirectPartnerName(k)
wscript.echo "Last Success: " & IADSTool.DirectPartnerLastSuccessTime(k)
wscript.echo "Last Attempt: " & IADSTool.DirectPartnerLastAttemptTime(k)
wscript.echo "Failure Count: " & IADSTool.DirectPartnerNumberFailures(k)
wscript.echo "--"
next
--
Joe Richards Microsoft MVP Windows Server Directory Services
www.joeware.net
> VB is not installed on my machine so I can't test that...however I do have
> perl; how would I call it from perl? The following gives me an 'invalid
[quoted text clipped - 35 lines]
>>>-Frank Brown
>>>http://www.inwa.net/~frog/
frank brown - 21 Sep 2004 19:19 GMT
OK it works from perl. Not sure why it generates access violation in c#. I
can recode my app from c# to perl as a workaround.
-Frank
> Here is an example perl script of using iadstools (watch line wrap)
>
[quoted text clipped - 98 lines]
> >>>-Frank Brown
> >>>http://www.inwa.net/~frog/
Joe Richards [MVP] - 22 Sep 2004 19:40 GMT
Cool
--
Joe Richards Microsoft MVP Windows Server Directory Services
www.joeware.net
> OK it works from perl. Not sure why it generates access violation in c#. I
> can recode my app from c# to perl as a workaround.
[quoted text clipped - 144 lines]
>>>>>-Frank Brown
>>>>>http://www.inwa.net/~frog/