Discovery: how to get last logged in user from remote PC ?

stryker129
Mega Guru

Is there a way to do that through Discovery?

Any hints would be appreciated.

Thanks

1 ACCEPTED SOLUTION

Hi Ivan,



For your probe, you have to write sensor like this. Try and let me know if that works.



new DiscoverySensor({


  process: function(result) {


  if (gs.nil(result.output))


  return;


  this.parseOutput(result.output);


  },



  parseOutput: function(output) {


  var ci = this.getCmdbRecord();


  var line = output.split("\n");


  ci.u_username= line[2];



  },



  type: "DiscoverySensor"


});



Regards,


Vivek



Based on the impact hit like, helpful or correct.


View solution in original post

17 REPLIES 17

Thanks a lot Vivek!


Hi Vivek,

how we can do this in London,(where there is pattern) and how we can get/capture the discovered login name even it is not in the sys User table.

 

Bharat

Abdule
Kilo Explorer

Hello Vivek,

 

I using the exact same steps that were specified above. I ran PS on the server and my windows laptop and I'm getting the last logged in user. I can't seem to get it to work through service-now. In the ECC queue, I am getting an error in the state value.

Regards,

Abdul