Removed errant 'accountDomain' param from constructor

pull/60/head
David Hall 2019-03-10 13:36:30 -06:00
parent 9f77841ac5
commit b328949591
1 changed files with 20 additions and 1 deletions

View File

@ -38,7 +38,7 @@ namespace Vanara
/// <param name="password">
/// The password that is used to connect to the computer. If the user name and password are not specified, then the current token is used.
/// </param>
public Computer(string target, string userName = null, string accountDomain = null, string password = null)
public Computer(string target, string userName = null, string password = null)
{
BeginInit();
Target = target;
@ -168,5 +168,24 @@ namespace Vanara
private bool ShouldSerializeTargetServer() => targetServer != null && !targetServer.Trim('\\').Equals(Environment.MachineName.Trim('\\'), StringComparison.InvariantCultureIgnoreCase);
private bool ShouldSerializeUserName() => userName != null && !userName.Equals(Environment.UserName, StringComparison.InvariantCultureIgnoreCase);
internal System.Security.Principal.WindowsIdentity Identity
{
get
{
if (UserName is null)
return null;
var nonUpnIdx = UserName.IndexOf('\\');
var un = UserName;
string dn = null;
if (nonUpnIdx >= 0)
{
dn = UserName.Substring(0, nonUpnIdx);
un = UserName.Substring(nonUpnIdx + 1);
}
return new Vanara.Security.Principal.WindowsLoggedInIdentity(un, dn, UserPassword).AuthenticatedIdentity;
}
}
}
}