Changing multi-value ADSI properties in IIS, using Perl

Changing multi-value ADSI properties in IIS, using Perl

Post by Richard Hoope » Sat, 12 Oct 2002 22:08:51



Dear All,

I'm trying to write a Perl script that will allow me to alter multi-value
IIS ADSI properties, such as IPDeny, the list of denied IP addresses for a
node, which is a property of an IPSecurity object. I've seen examples in
VBScript for this sort of thing, but I definitely want to do it in Perl.

I had got as far as listing the contents of the property, by using array
references, something like this:

$root = Win32::OLE->GetObject($adspath); #Get the main ADSI node
$security = $root->IPSecurity or die; #Get the IPSecurity object for that
node
$arrayref = $security->IPDeny; #Get a reference to the property array

But when I try to do things like changing the values in the array, either by
giving the object a reference to a new list:


and then go:
$root->SetInfo;
nothing seems to happen.

I had a brief go at treating the IPSecurity object like a full-blown ADSI
object, and used Get, Put, GetEx and PutEx to do it, and met with no
success.  What am I doing wrong?  How do I change these values?

Any help gratefully received!

Cheers,

Richard