CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Win32 Programming Help: Re: [FishMonger] syntax woes: Edit Log


Feb 17, 2009, 7:01 AM

Views: 7045
Re: [FishMonger] syntax woes

Thanks guys....
Another thing. I'm trying to create a user with perl and it I keep getting and error:

An invalid directory pathname was passed
Win32::OLE(0.1709) error 0x80005000 in METHOD/PROPERTYGET "Create". This is the code.

my $fullname = $finame." ".$laname; 

my $objParent = Win32::OLE->GetObject("LDAP://OU=MyOU,dc=Mydomain,dc=ext");
my $objUser = $objParent->Create("user","cn=".$fullname);
$objUser->Put("sAMAccountName", $sAMAccountName);
$objUser->Put("givenName", $finame);
$objUser->Put("sn", $laname);
$objUser->Put("displayName", $finame." ".$laname);
$objUser->{AccountDisabled} = FALSE;

my $homedir = "\\\\server\\ext\\";
#my $homedrive = "";
my $profile = "\\\\server\\ext\\";

$objUser->Put("profilePath", $profile . $sAMAccountName);
$objUser->Put("homeDirectory", $homedir . $sAMAccountName);
$objUser->Put("homeDrive", "z:");

My hunch is that something is wrong with the create line "my $objUser = $objParent->Create("user","cn=".$fullname);" but i can't figure out what it is. Can you help me?

(This post was edited by soft_king on Feb 17, 2009, 7:19 AM)

Edit Log:
Post edited by soft_king (Novice) on Feb 17, 2009, 7:19 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives