It seems as though it is because the module is checking to see if I pass
in a reference to a hash but that check is failing (line 439). When I
call the ref function on the hash itself it returns fine.
print "True.\n" if (ref(\%hShareInfo) eq "HASH");
Any ideas?
martin
Martin Douglas wrote:
Hi All,
Has anyone used Win32::NetResource to add a share to a folder? I
tried a small code sample and it keeps telling me that the first
parameter I am putting into NetShareAdd is not of type hash. I am
using Perl v.5.8.3 for Windows.Here is the exact error message and
code below:
Argument must be a HASH reference at
C:/Perl/site/lib/Win32/NetResource.pm line 439.
use Win32::NetResource; # share creation/permissions
my $sError;
my %hShareInfo = ('path' => "C:\folder",
'netname' => "foldershare",
'type' => STYPE_DISKTREE,
'permissions' => 0,
'current-users' => 0,
'maxusers' => -1,
'remark' => "Cluster share",
'passwd' => 0);
Win32::NetResource->NetShareAdd(\%hShareInfo, $sError);
print "Error is: $sError.\n";
The purpose of this code is to share out users home folders during
automatic creation of Active Directory accounts. Is there a better
way to do this?
Any help would be fabulous, thanks.
martin
--
*****************************************************************
Martin Douglas ([EMAIL PROTECTED])
ITS Network Operations
Information Technology Services
Natural Sciences Centre, Room 209
University of Western Ontario
(519) 661-2111 x81187
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs