Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Sarafian authored and beutepa committed May 31, 2017
1 parent 71deaaa commit 8a92cb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
**1.6**

Issues:
- GH-32: Set-ISHUserLocal throws error "net.exe : The user name could not be found." when the password has character "
- GH-31: Set-ISHUserLocal cannot work with passwords longer thatn 14 characters

**1.5**

Issues:
Expand Down
6 changes: 4 additions & 2 deletions Source/Modules/ISHServer/Set-ISHUserLocal.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ function Set-ISHUserLocal
}
}

# Do this for when the password contains the " character
$normalizedOSUserPassword=$osUserPassword.Replace('"','\"')
if($existingUsers -contains $localUserName)
{
& NET USER $localUserName $osUserPassword
& NET USER $localUserName $normalizedOSUserPassword /Y
Write-Verbose "Updated $localUserName"
}
else
{
& NET USER $localUserName $osUserPassword /ADD
& NET USER $localUserName $normalizedOSUserPassword /ADD /Y
$user = [adsi]"WinNT://$env:computername/$localUserName"
$user.UserFlags.value = $user.UserFlags.value -bor 0x10000
$user.CommitChanges()
Expand Down

0 comments on commit 8a92cb3

Please sign in to comment.