Skip to content

Commit

Permalink
ActiveDirectory require password if username is supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven-D-Foster committed Jun 2, 2021
1 parent e6fff01 commit 16d5a94
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ protected override void ExecuteInternal()
if (!Constant.OS_WINDOWS) throw new Exception("This function is only supported on Windows clients");
host = GetArgParameterOrConfigRequired("host", "h");
port = GetArgParameterOrConfigInt("port", "o", Ldap.LDAP_PORT).ToString().ToUShort();
username = GetArgParameterOrConfig("username", "u");
password = GetArgParameterOrConfig("password", "p");
username = GetArgParameterOrConfig("username", "u").TrimOrNull();
if (username != null) password = GetArgParameterOrConfigRequired("password", "p");
else GetArgParameterOrConfig("password", "p");

domainName = GetArgParameterOrConfig("domainName", "d");

using (var ad = GetActiveDirectory())
Expand Down

0 comments on commit 16d5a94

Please sign in to comment.