Replies: 4 comments 1 reply
|
Get-LMAccountStatus should already do that for you. https://github.com/logicmonitor/lm-powershell-module/blob/main/Public/Get-LMAccountStatus.ps1 |
1 reply
|
you beat me to it. it is missing the adminName. :-) |
0 replies
|
This has been included in the main github branch to be included in the next release of the module after v7.4.1. Once that release happens youll be able to run: |
0 replies
|
Available in 7.4.2: https://github.com/logicmonitor/lm-powershell-module/releases/tag/7.4.2 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
We are in the process of automating a lot of our work and one of the things many of our scripts are going to be doing is providing some sort of change log for automations. Is there a cmdlet that could be created that could retrieve just the username associated with the account used to connect to Logic Monitor, via the Connect-LMAccount cmdlet? This cmdlet could be called something like Get-LMConnectUsername (or something probably way better than that) and could be called by our automation scripts to produce a log record showing which API account called the function allowing us to dynamically update external audit logs and automations that update our ticket system for changes and requests.
Since the LMAuth object is $Script-scoped, we don't have direct access to the Access Id that could be potentially used to look up the user account. Not sure if this is doable but thought I would ask anyway. With the $Script:LMAuth.AccessId you can call Get-LMAPIToken and return the adminName property. Something like the following:
All reactions