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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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



soft_king
Novice

Feb 17, 2009, 7:01 AM


Views: 3752
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.


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("userPrincipalName",$sAMAccountName."$domain");
$objUser->Put("givenName", $finame);
$objUser->Put("sn", $laname);
$objUser->Put("displayName", $finame." ".$laname);
$objUser->Put("description","description");
$objUser->SetInfo;
$objUser->SetPassword("Password");
$objUser->{AccountDisabled} = FALSE;
$objUser->SetInfo;

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


$objUser->Put("profilePath", $profile . $sAMAccountName);
$objUser->Put("homeDirectory", $homedir . $sAMAccountName);
$objUser->Put("homeDrive", "z:");
$objUser->SetInfo;
[\code]

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