Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>My first guess is that you've got "invisible" spaces in your CSV file. For example their is likely a trailing whitespace after the names of your servers in the CSV that your eyes of course don't see. You can fix that either by fixing the CSV file, or using <code>.Trim()</code> on your imported strings -- i.e. <code>$_.Name.Trim()</code></p> <p>If that's not the case, or not the only issue, then this is something I've had issues with to. When I have complicated strings like your desired <code>net.exe</code> arguments I've liked to take precautions and get extra pedantic with defining the string and not rely on PowerShell's automatic guessing of exactly where a string begins and ends.</p> <p>So, instead of baking your parameters inline on your <code>net.exe</code> command line hand-craft them into a variable first, like so</p> <pre><code>$args = '\\' + $_.name + '/user:' + $_.name + '\Administrator' + $_.pass </code></pre> <p>If you <code>write-Host</code> that out you'll see that it no longer has your rogue spaces. Indeed you may notice that it no longer has <strong>enough</strong> spaces, so you'll have to get a little explicit about where they belong. For instance the above line doesn't put the proper spaces between <code>\\servername</code> and <code>/user</code>, or between the username and password, so you'd have to add that space back in, like so.</p> <pre><code>$args = '\\' + $_.name + ' /user:' + $_.name + '\Administrator ' + $_.pass </code></pre> <p>Notice the explicit spaces.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload