mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-01-26 06:03:15 -05:00
Fixed bug with PTHI and AMTUUID
This commit is contained in:
parent
97ae2312ac
commit
5e8c69f89a
@ -668,7 +668,8 @@ function run(argv) {
|
|||||||
performAmtAgentPresence();
|
performAmtAgentPresence();
|
||||||
} else if (settings.action == 'amtuuid') {
|
} else if (settings.action == 'amtuuid') {
|
||||||
// Start running
|
// Start running
|
||||||
if (settings.hostname != null) {
|
if (settings.hostname != null)
|
||||||
|
{
|
||||||
if ((settings.password == null) || (typeof settings.password != 'string') || (settings.password == '')) { console.log('No or invalid \"password\" specified, use --password [password].'); exit(1); return; }
|
if ((settings.password == null) || (typeof settings.password != 'string') || (settings.password == '')) { console.log('No or invalid \"password\" specified, use --password [password].'); exit(1); return; }
|
||||||
if ((settings.username == null) || (typeof settings.username != 'string') || (settings.username == '')) { settings.username = 'admin'; }
|
if ((settings.username == null) || (typeof settings.username != 'string') || (settings.username == '')) { settings.username = 'admin'; }
|
||||||
}
|
}
|
||||||
@ -1398,7 +1399,17 @@ function getTrustedHashes(amtMei, func, tag) {
|
|||||||
// Called to get the UUID of Intel AMT, start by setting up MicroLMS if we are doing the operation on the local computer
|
// Called to get the UUID of Intel AMT, start by setting up MicroLMS if we are doing the operation on the local computer
|
||||||
function getAmtUuid()
|
function getAmtUuid()
|
||||||
{
|
{
|
||||||
if ((settings.hostname == null) || (settings.hostname == '127.0.0.1') || (settings.hostname.toLowerCase() == 'localhost')) { settings.noconsole = true; startLms(getAmtUuidEx); return; } else { getAmtUuidEx(); }
|
if ((settings.hostname == null) || (settings.hostname == '127.0.0.1') || (settings.hostname.toLowerCase() == 'localhost'))
|
||||||
|
{
|
||||||
|
settings.hostname = '127.0.0.1';
|
||||||
|
settings.noconsole = true;
|
||||||
|
startLms(getAmtUuidEx);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
getAmtUuidEx();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fetch the computer's UUID by fetching the CIM_ComputerSystemPackage WSMAN object.
|
// Fetch the computer's UUID by fetching the CIM_ComputerSystemPackage WSMAN object.
|
||||||
@ -1667,6 +1678,11 @@ function setupMeiOsAdmin(func, state, tag) {
|
|||||||
var transport = require('amt-wsman-duk');
|
var transport = require('amt-wsman-duk');
|
||||||
var wsman = require('amt-wsman');
|
var wsman = require('amt-wsman');
|
||||||
var amt = require('amt');
|
var amt = require('amt');
|
||||||
|
|
||||||
|
settings.username = x.user;
|
||||||
|
settings.password = x.pass;
|
||||||
|
settings.tls = false;
|
||||||
|
|
||||||
oswsstack = new wsman(transport, '127.0.0.1', 16992, x.user, x.pass, false);
|
oswsstack = new wsman(transport, '127.0.0.1', 16992, x.user, x.pass, false);
|
||||||
osamtstack = new amt(oswsstack);
|
osamtstack = new amt(oswsstack);
|
||||||
if (func) { func(state, tag); }
|
if (func) { func(state, tag); }
|
||||||
|
@ -66,7 +66,8 @@ function CreateWsmanComm(/*host, port, user, pass, tls, extra*/) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Private method
|
// Private method
|
||||||
obj.PerformAjaxEx = function (postdata, callback, tag, url, action) {
|
obj.PerformAjaxEx = function (postdata, callback, tag, url, action)
|
||||||
|
{
|
||||||
if (obj.FailAllError != 0) { if (obj.FailAllError != 999) { obj.gotNextMessagesError({ status: obj.FailAllError }, 'error', null, [postdata, callback, tag]); } return; }
|
if (obj.FailAllError != 0) { if (obj.FailAllError != 999) { obj.gotNextMessagesError({ status: obj.FailAllError }, 'error', null, [postdata, callback, tag]); } return; }
|
||||||
if (!postdata) postdata = "";
|
if (!postdata) postdata = "";
|
||||||
if (globalDebugFlags & 1) { console.log("SEND: " + postdata + "\r\n\r\n"); } // DEBUG
|
if (globalDebugFlags & 1) { console.log("SEND: " + postdata + "\r\n\r\n"); } // DEBUG
|
||||||
@ -80,9 +81,11 @@ function CreateWsmanComm(/*host, port, user, pass, tls, extra*/) {
|
|||||||
}
|
}
|
||||||
obj.digest.http = require('http');
|
obj.digest.http = require('http');
|
||||||
}
|
}
|
||||||
var request = { protocol: (obj.tls == 1 ? 'https:' : 'http:'), method: 'POST', host: obj.host, path: '/wsman', port: obj.port, rejectUnauthorized: false, checkServerIdentity: function (cert) { /*console.log('checkServerIdentity', JSON.stringify(cert));*/ } };
|
var request = { delayWrite: true, protocol: (obj.tls == 1 ? 'https:' : 'http:'), method: 'POST', host: obj.host, path: '/wsman', port: obj.port, rejectUnauthorized: false, checkServerIdentity: function (cert) { /*console.log('checkServerIdentity', JSON.stringify(cert));*/ } };
|
||||||
var req = obj.digest.request(request);
|
var req = obj.digest.request(request);
|
||||||
//console.log('Request ' + (obj.RequestCount++));
|
//console.log('Request ' + (obj.RequestCount++));
|
||||||
|
if (globalDebugFlags & 1) { console.log('Request ' + (obj.RequestCount++)); } // DEBUG
|
||||||
|
|
||||||
req.on('error', function (e) { obj.gotNextMessagesError({ status: 600 }, 'error', null, [postdata, callback, tag]); });
|
req.on('error', function (e) { obj.gotNextMessagesError({ status: 600 }, 'error', null, [postdata, callback, tag]); });
|
||||||
req.on('response', function (response) {
|
req.on('response', function (response) {
|
||||||
//console.log(JSON.stringify(response, null, 2));
|
//console.log(JSON.stringify(response, null, 2));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user