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 (martin at you double-you oh dot see eh)
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

Reply via email to