Forum Discussion
This is great, thanks Kevin!
Do you know if there would be a way of pulling the wmi.user and pass into the script here to be able to do things like restarting services and whatnot? I have a pre-existing PS script that uses a different file for the creds, but if I could work it into the settings LM has built in, that would be great.
Any device properties can be pulled into DS Script blocks using ##DEVICE.PROPERTY## (https://www.logicmonitor.com/support/terminology-syntax/scripting-support/embedded-powershell-scripting). So in your ask ##WMI.USER## and ##WMI.PASS## would sub those property values into the script.
In our organization we load them into an object at the start of the the block i.e.
$wmi_user = '##WMI.USER##',
$wmi_pass = '##WMI.PASS##'
Then later on use the loaded object in the appropriate locations as you normally would.
Related Content
- 2 months ago
- 7 months ago