Skip to content

Commit ab8fc67

Browse files
committed
Updated logs
1 parent 2cbfd4b commit ab8fc67

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/modules/password/change_password_windows.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ import { getOutput, runCommand } from "../util/run_command";
88

99
async function changePasswordWin(server: Server, user: User, conn: SSH2CONN | false, username: string, password: string) {
1010
var then = new Date();
11+
let headers = `[${server.ipaddress}] [${server.Name}] [${user.username}]`;
1112
if (!conn) {
1213
try {
1314
return await LDAPChangePassword(user, password);
1415
} catch (error: any) {
15-
logger.log(`[${server.ipaddress}] [${server.Name}] [${user.username}] error ${error.message}`, "error");
16+
logger.log(`${headers} error ${error.message}`, "error");
1617
return error.message ? (error as Error) : (error.message as string);
1718
}
1819
}
@@ -31,8 +32,8 @@ async function changePasswordWin(server: Server, user: User, conn: SSH2CONN | fa
3132
try {
3233
return await LDAPChangePassword(user, password);
3334
} catch (error: any) {
34-
logger.log(`[${server.ipaddress}] [${server.Name}] [${user.username}] LDAP Connection ${error.message}`, "warn");
35-
conn.log("Fallback ssh");
35+
logger.log(`${headers} LDAP Connection ${error.message}`, "warn");
36+
conn.log("Falling back to ssh");
3637
return await changePasswordWinAD(conn, stripDomain(username), password);
3738
}
3839
}

0 commit comments

Comments
 (0)