FWIW, I couldn't get your version of the script nor the RenameUser.pl that comes with the Win32::AdminMisc module to do anything either.

The total absence of any mention of the RenameUser() api in either the module itself or the pod that comes with the module make it very difficult to track down the likely cause. The function exists in the dll (apparently, as perl doesn't complain when you try to use it) but when I tried running the test script that came with the module I got

P:\site\lib\Win32\AdminMisc>renameUser Attempting to rename the user account 'fred' to 'derf' Could not rename the user 'fred' to 'derf': The operation completed su +ccessfully. Finished.

Which is somewhat confusing:)

The best suggestion I can think of is that you try contacting Dave Roth via his web site or CPAN id.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!


In reply to Re: Re: Re: Renaming User Accounts by BrowserUk
in thread Renaming User Accounts by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.