Jump to content

ZSmith

Members
  • Content Count

    9
  • Joined

  • Last visited

  • Days Won

    1

ZSmith last won the day on January 17 2018

ZSmith had the most liked content!

Community Reputation

2 Neutral

My Information

  • Agent Count
    < 500 Agents

Converted

  • INTERESTS
    Game Design

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. ZSmith

    Retired Assets Script & Monitor

    @Tim and anyone else who stumbles upon this thread, here's the answer to making the script run: Make it an offline computer script Since the monitor is deleting computers that are offline, they cant run this script unless it is also set to offline. It's an easy miss (took me a few minutes to realize it myself), but you can see it in Dan's script that it is set to offline as well. Hope this helps anyone looking to get this set up : ) - Zach
  2. Thoughts: 1) From the looks of it there's no real reason why your script shouldn't work - all it's doing is setting variables. So that said, is the script ever being called? Does your alert call your script? on everyday? (Sorry, I dont mean to insult intelligence. I figure if you're doing this you were smart enough to set that correctly. But it's the main setting I can't see, so I can't rule it out). 2) If you have data showing up in the status panel, it means the monitor is most likely working - but just in case, check to see if that data is current/changes when you run the monitor. The status (in my experimentation) seems to show cached data from the last successful run, not necessarily from the last run. 3) If the monitor isnt in fact running (which you say it is, but just in case you find otherwise), try removing the newline characters from the extra SQL - I tried to make my SQL readable in LT monitors when I did it the first time and it caused all sorts of issues. But that was RAWSQL which could be different, not sure how the LT backend parses the data there. Try this and see if it sheds any light, if not, post what you find and we can dig further from there.
  3. ZSmith

    Using RawSQL with Internal Monitors

    @dtrent01 this one took me a LONG time to figure out when I worked on it a couple months ago. Basically, there's one stupid line in the incredibly sparse documentation on RAWSQL thats easily looked over: "The query should return the Computers.ComputerID column in order to record alerts correctly." When I ran my monitor (before it worked) using the built in SQL Spy, I saw (somewhere) in the query that it was looking for a hardcoded value for Computers.ComputerID. So, yes, your queries returned Computers.ComputerID, but you resturned it AS "SomethingElse' - if you don't return it as a that exact field (or something that relates to that key, like Drives.ComputerID for example), then it will fail to execute the monitor. And basically, the Build and View is merely a SQL execution with a viewing table (you can even do drops, updates, inserts, etc from here, though I don't recommend it). The Build and View actually has very little to do with the actual function of the Monitor (at least until you get the syntax right and it starts working). TLDR : insert Computers.ComputerID into your Select - it (hopefully) should work. Also prayer might be helpful. Hope this helps.
  4. One way to do it, if you're only using IF (True) for the condition at the top of the script, would be change the drop down selection there to SQL Data Check and then the boxes to: Sql Statement: Select runningScripts.Running From runningScripts Where runningScripts.ComputerID = %computerID% and runningScripts.ScriptID = %scriptID% Compare: Not = To: 1 (And you can put an exit script step (a blank Script Goto) in the Script's Else if you would like to be verbose.) But if you are already running a check on the incoming IF() field, you can just add a IF SQL Data Check step at the start of your script. It's mostly the same setup but slightly different: Sql Statement: (Same) Compare: = To: 1 Label to Jump to or Steps to Skip: 0 Jump to 0 if you want to immediately exit the script. Or you could jump to a line/label printing "Already running" error to the console before exiting or something (if you want to tell the difference between the script crashing and exiting b/c there's another running). But yeah, that should work for you if you want to keep it from running while it's already running. If you need to keep it from scheduling as well, it shouldn't be a big jump from this to getting that to work, too.
  5. Did you strip out all the formatting text? New lines and tabs (i.e. anything that makes the query functionally readable) have to be removed. It's a weird quirk, but might be the issue if you only copy and pasted the code. - Zach
  6. ZSmith

    Startup Programs

    Ok, so things to note when building your script: - Use RegEdit.exe to find the names of the registries you want to edit, not the task manager. Java in Task Manager > Startup shows up as 'Java Update Scheduler', while in RegEdit it shows up as 'SunJavaUpdateSched' - so don't assume. - When you copy the RegEdit registry path, it will include 'Computer\HKEY_LOCAL_MACHINE\...' - Labtech expects to see the input as simply 'HKLM\...' - Make sure you type in the registry field into Labtech's Registry Value field. If you copy the path from regedit, it will stop at the folder and not include the name of the registry itself. It should look something like 'HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run\(insert the registry name here without parentheses)' - Since this is a binary field, be sure to change your Data Type drop down selection to 'Reg_Binary'. - In the registry, the binary data will appear as '02 00 00 00 00 00 00 00 00 00 00 00' - Labtech expects this as '02,00,00,00,00,00,00,00,00,00,00,00' - If you want to disable the program, anything other than '02,00,00,00,00,00,00,00,00,00,00,00' will disable it. I've attached an example script(examples do function, so edit it before you run it if you don't want any unexpected errors). Hope this helps! SetRegister_StartupProgramsExample.zip
  7. ZSmith

    Startup Programs

    So first off, I'm just summarizing the information I found at these 2 links: https://www.tenforums.com/tutorials/2944-add-delete-enable-disable-startup-items-windows-10-a.html https://powershell.org/forums/topic/enabledisable-startup-programs-in-windows-10/ The startup programs are stored in registries found at: HKEY_LOCAL_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\StartupApproved\Run (I also had some stored in StartupApproved\Run32) Programs unique to the user (I presume) are in the HKEY_LOCAL_CURRENT_USER whereas programs installed for all users are under HKEY_LOCAL_MACHINE. Once you know which programs you want to enable or disable, it's just a registry edit, which you can accomplish a variety of ways. If you're just looking for a straightforward Labtech Script, you can just use the 'Registry Set Value' command (https://docs.labtechsoftware.com/LabTech10.5/Default.htm#UsingLabTech/Scripts/CreatingScripts/Advanced/FunctionReference/ComputerFunctions/RegistrySetValue.htm). The computer sees any registry of value '02 00 00 00 00 00 00 00 00 00 00 00' (this should be 12 bytes, dont miscount) as enabled; anything else is considered disabled (for readability, one of the guys in those forum posts uses '03 00 00 00 00 00 00 00 00 00 00 00' - whatever you want works, but making and using a system is good). This should be enough to get you going. I can probably post a starter script later if you still need help. Cheers!
  8. I just happened across this in the LabTech documentation, did you ever give try this instead of running it through PowerShell? https://docs.labtechsoftware.com/LabTech11/Default.htm#UsingLabTech/Scripts/CreatingScripts/Advanced/FunctionReference/SoftwareFunctions/PlaySound.htm%3FTocPath%3DUsing%20LabTech|Scripts|CreatingScripts|Advanced|FunctionReference|SoftwareFunctions|_____4
×