Jump to content

Search the Community

Showing results for tags 'script'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • MSPGeek
    • Announcements
    • The Geek Cast
  • ConnectWise Automate / Labtech
    • ConnectWise Automate / LabTech
    • ConnectWise Automate / LabTech - Development

Categories

  • ConnectWise Automate
    • Scripts
    • Plugins
    • SQL Snippets
    • Role Definitions
    • Automate PowerShell Code
    • Reports
    • Internal Monitors
    • Remote Monitors
  • ConnectWise Manage
    • API Interacting Code

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


Agent Count


INTERESTS


OCCUPATION


ICQ


WEBSITE


WLM


YAHOO


AOL


FACEBOOK


GOOGLEPLUS


SKYPE


TWITTER


YOUTUBE

Found 28 results

  1. I have created a PS script that I want to run daily on X number of servers spread across X number of companies/clients Is there a way to mass-target these servers? I would like to avoid running the script globally as I don't want it to be run on all servers, only the ones I select
  2. Wolf

    VBScript - issues

    So I am new to scripting in Automate. I have ran into the issue of not being able to get a simple VBScript messagebox to open using the scripting interface in Automate. I have discovered the issue to be related to the "logged in user". I have been unable however to figure out how to determine the current user in a way that I can actually apply it to getting the script to run properly. I found this blog post https://gavsto.com/running-programs-scripts-as-a-logged-in-user-in-a-labtech-automate-script/, but I am still not able to figure out how to apply this to running a VBScript as there is no where to say run on %consolenumber% under the vbscript options. All I see are the Function: Execute Script, Script Type: VBScript, the Script to Execute (copied and pasted from my visual studio code editor), Script Parameters, credentials, and its output Variable name. Can someone please point me in the correct direction?
  3. So we need to set a custom maintenance window for one of the locations for one of our clients. We need a window from 5pm to 12am every first and third Sunday. I have never written a script for Automate before so I am not even sure where to start. Has anyone done anything like this before? Is this even possible? Thanks!
  4. DarrenWhite99

    Alert When Agent Is Online

    Version 1.0.4

    377 downloads

    The Internal Monitor "Notify When Agent is Online" watches machines with the "Notify When Online" computer EDF configured. It will send an alert as soon as it finds that the agent is offline. (The offline notice is skipped if the agent was already offline when notifications were first enabled.) When the agent comes online again another alert email will be sent and the EDF will be reset. This monitor can be used to notify when a lost computer comes online, or when that machine that is only online in the office every few weeks is back. To enable notifications for an agent, you simply put your email address into the "Notify When Online" EDF. You can enter multiple addresses separated by ";". The contents of the agent's "Comments" will be included in the email also. (Helpful to remember why you wanted to be alerted, or what instructions should be followed after receiving the alert.) When the agent returns online, the Network Inventory and System Info are refreshed. The recovery email will include the following details: The last check in was at @AgentCheckIn@. Public IP Detected: %RouterAddress% Internal IP: %LocalAddress% System Uptime: %uptime% Last Logged in User: %lastuser% This bundle includes a Script+EDF XML, and a SQL file with the Internal Monitor. To import the Script and EDF, select Tools -> Import -> XML Expansion. After import the script should appear in the "\Autofix Actions" folder. To import the Internal Monitor, select Tools -> Import -> SQL File. The monitor should be imported AFTER the script bundle has already been added. After importing, verify that a valid Alert Template is selected for the monitor. The Alert Template MUST have the "Run Script" action enabled without any script specified in the template. (The script is set on the monitor) Read the Script Notes for advanced control over the number of times a notification will be triggered.
  5. DarrenWhite99

    Alert When Agent Is Online

    Alert When Agent Is Online View File The Internal Monitor "Notify When Agent is Online" watches machines with the "Notify When Online" computer EDF configured. It will send an alert as soon as it finds that the agent is offline. (The offline notice is skipped if the agent was already offline when notifications were first enabled.) When the agent comes online again another alert email will be sent and the EDF will be reset. This monitor can be used to notify when a lost computer comes online, or when that machine that is only online in the office every few weeks is back. To enable notifications for an agent, you simply put your email address into the "Notify When Online" EDF. You can enter multiple addresses separated by ";". The contents of the agent's "Comments" will be included in the email also. (Helpful to remember why you wanted to be alerted, or what instructions should be followed after receiving the alert.) When the agent returns online, the Network Inventory and System Info are refreshed. The recovery email will include the following details: The last check in was at @AgentCheckIn@. Public IP Detected: %RouterAddress% Internal IP: %LocalAddress% System Uptime: %uptime% Last Logged in User: %lastuser% This bundle includes a Script+EDF XML, and a SQL file with the Internal Monitor. To import the Script and EDF, select Tools -> Import -> XML Expansion. After import the script should appear in the "\Autofix Actions" folder. To import the Internal Monitor, select Tools -> Import -> SQL File. The monitor should be imported AFTER the script bundle has already been added. After importing, verify that a valid Alert Template is selected for the monitor. The Alert Template MUST have the "Run Script" action enabled without any script specified in the template. (The script is set on the monitor) Read the Script Notes for advanced control over the number of times a notification will be triggered. Submitter DarrenWhite99 Submitted 12/21/17 Category Internal Monitors  
  6. My Script that i wrote for Automate deploys a ps1 file and runs it as admin. But the script appears to run under Local admin credentials because "$env:LogonServer" doesn't expand to the actual logon server for the site. It expands to "C:\" The reason im using this approach is that i want the script to be compatible for all our client sites. The domain admin credentials are in the sites "Passwords" section and all the defaults are set to run things under those credentials but i still cant get that variable to expand properly
  7. Unicorn Taxi Driver

    Mac Endpoint Uninstaller

    Hey Guys! Has anyone had any luck creating an agent uninstaller script for Mac endpoints?
  8. I have been trying to figure out how to run a script that will append an entry to the existing hosts file I created a .bat file that does it perfectly, but am not sure how to get it to pull from LT and run on the agent. The issue we are having is several Windows 7 machines at a client keep getting the "Yellow Triangle" because of OpenDNS. Mostly doesnt cause a problem, except for Microsoft products stop working properly (https://support.umbrella.com/hc/en-us/articles/230900948-Umbrella-Roaming-Client-Microsoft-Windows-Limited-Network-Connectivity-Warning-Yellow-Triangle-)
  9. This would be our "perfect" RDS script anyway. AT least a start... Anyone have a great reboot script for RDS servers? Looking to have a scheduled reboot once a week, during this reboot we'd like to notify/remind the users of the reboot before it occurs. If possible, also reload applications/documents that they were working on before the reboot (if they do not save and close beforehand). Any help would be great, thanks in advance!
  10. Hi guys, I need to copy a .msi from a server share to a local PC using a script. I then need to create another script to remove a program using the copied .msi. Does anyone know how to create a script for this? I tried and cannot get it to work.
  11. Hi guys, I am trying to install 7zip on a PC via a script through LT. The first part of the script is copying the installer to the local machine from a local server share and the second part is meant to use msiexec to install this. The first half of the script works and the file is copied to the machine but the second part fails. I checked the workstations logs and LT gives me the following error: "The Script(414) failed in the Then section at step 1. The reason: File Copy Command Failed Script: S414 - Starting at Server Time: Thursday, May 24, 2018 4:31:30 PM Script step logging has been disabled. Please set @ScriptEngineEnableLogger@ = True in your script to enable function logging." I duplicated the script to run everything as an admin but this has also given me the same result. Please see below for both of the scripts I have created for this: Script 1: Step 1: Function: File Copy Source path: \\SERVER\Data\IT Software\7z1805.exe Destination path: %windir%\Temp\7z1805.exe Step 2: Function: Shell Command: "%windir%\system32\msiexec.exe" /i "%windir%\Temp\7z1805.exe" /q Script 2: Step 1: Function: File Copy as Admin Source path: \\SERVER\Data\IT Software\7z1805.exe Destination path: %windir%\Temp\7z1805.exe Step 2: Function: Shell as Admin Command: "%windir%\system32\msiexec.exe" /i "%windir%\Temp\7z1805.exe" /q Could someone please provide me with some assistance. I have never used the LT server side of things, so if someone could explain that then I would very grateful.
  12. Randleman

    Continuum removal script

    Has anyone created or know of a successful offboarding script for removing continuum and LMI from a machine without tanking the uninstaller? Thanks!
  13. Hello, we're looking for a way to take different actions based on how many results show up in the monitor that calls this script. To be more specific, we want to execute a SQL stored proc if there are fewer than 10 results, and if there are more than 10, we want to send an alert email. The way I understand it, though, when you call a script based on the results of an internal monitor, the script simply receives one row at a time and executes based on the data in that row, rather than receiving all of the rows at once and running on each one in a loop. Am I understanding this correctly, and is there a way to accomplish what we're trying to do? Thanks!
  14. I am trying to make tickets more readable coming from the stock Blacklisted Event Internal monitors, but tickets are not being created for my custom monitors, in CW Automate or CW Manage: EV - BlackListed Events Informational Errors Only EV - BlackListed Events Warnings and Errors Only To do this I have created custom Monitors, Alert Templates, Alert Actions, and Autofix Scripts by copying the stock ones used by the stock monitors above. Here is the setup for my custom Informational monitor for example: Stock Monitor : EV - BlackListed Events Informational Errors Only Custom : Event Log Errors - Informational - CUSTOM Stock Alert Template : ~Autofix Action Blacklist Events - Informational Custom : ~Autofix Action Blacklist Events - Informational CUSTOM Stock Autofix Script : Monitor Disk Blacklist Events - Informational* Custom : Monitor Disk Blacklist Events - Informational* CUSTOM The problem is, when I manually Run and Reset the custom monitors, neither of them create any tickets. The correct results DO show up under the "Status" and "Build and View Query" tabs of the custom monitor. I have narrowed it down to a problem with the custom Autofix script, because it DOES work when I change the Alert Template to use the stock Autofix script. I cannot figure out why my custom Autofix script isn't working. Here are screenshots of my configurations for the custom Monitor and AutoFix script, compared to stock: Monitor: Script:
  15. Hello All, Is it possible to pass %FIELDNAME% from a monitor to a script? Example would be - low disk internal monitor. It uses %FIELDNAME% to represent the drive letter that is throwing the alert. If I allow the monitor itself to create the ticket, this variable works. If I have the monitor run a script, the %FIELDNAME% variable does not function within the script. Any ideas? Thank you! Arthur
  16. I am working on a script to add a user and make it admin .. this is done.. but is there a way to add the password to the password list for the customer location in labtech with the script? It would help on so many levels.. Anyone have a pointer on this? I want to run it once a month to update the passwords and for each customer group.. ltadmin create and hide.xml
  17. Hello everyone, I have been trying to install the .NET framework 4.7 via the app deployment manager. The installer is a .exe but the install shield method does not appear to be working. I spoke to connectwise support who advised that this needs to be rolled out via a custom script but they do not support this. I have never worked with scripts so I am at a dead end here. Any help and advise on this would be much appreciated, I need to roll this out to roughly 100 machines.
  18. EssentialSteve

    Scheduled Scripts

    Hi there, I'm wanting to change the time a scheduled script is running in Labtech 12. In v11 this was easy, just find the device, click on the + and then go to Scheduled Scripts for that device. However things have all changed with v12, and I can't find that area at all. I even opened a chat up with Labtech support and they couldn't find it. Where can I find it now? Thanks for your help, Steve.
  19. Hello everyone, I have been trying to install the .NET framework 4.7 via the app deployment manager. The installer is a .exe but the install shield method does not appear to be working. I spoke to connectwise support who advised that this needs to be rolled out via a custom script but they do not support this. I have never worked with scripts so I am at a dead end here. Any help and advise on this would be much appreciated, I need to roll this out to roughly 100 machines.
  20. These are internal script variables (%variablename%) that are loaded for computer scripts, but that are not documented at https://docs.connectwise.com/ConnectWise_Automate/ConnectWise_Automate_Documentation/070/240/050/040/050#Database_Replacements InternalScriptVariable,Description computerdomain,Contains DOMAIN from Computer AdminUser Account in form of DOMAIN\AdminUser (otherwise is blank) computeridletime,Contains value from Computers.IdleTime computeruserdomain,Contains Unmodified Computer AdminUser Accountname snmpcommunity,Contains value from Computers.SNMPCommunity uptimeend,Contains value from AgentComputerData.UpTimeStart uptimestart,Contains value from AgentComputerData.UpTimeEnd WindowsDirectory,Contains value from Computers.Windir (Incorrectly documented as %windir%) brandingtitle,Contains value from ControlCenterConfig.Title locationaddress2,Contains value from Location.locationaddress2 probeid,Contains value from Location.probeid - ONLY LOADED WITH COMPUTER SCRIPTS (Not necessarily usable in Messages or outside of the script engine) I submitted a ticket to request this information be published, but until it is, it is here! This information was verified using Automate 11 with Patch 18. It is possible that not all of these variables will be available in earlier versions. There are other script variables that are related to the script execution available also. %errorlevel%,Result of last function, if it could fail. (0=Success, 1=Fail) Is only set as failed if "Continue On Failure" is enabled. A failed step with "Exit On Failure" set would just stop the script. %lastcmdid%,Contains Commands.CMDID value for last remote agent command attempted. %lastcmdoutput%,Contains Commands.Output value for last remote agent command attempted. (Would match %shellresult% if the last command was generated by the "Shell" function) %lastcmdstatus%,Contains Commands.Status value for last remote agent command attempted. (0 is success. 1 is failure) %scriptdepth%,Contains the level of nesting at each script step. The primary Script is level 1. In a Function Script, the level would be 2 or higher. (The script engine will terminate a script if this reaches 15, unless you set the variable @disablerecursioncheck@) %scriptid%,Contains lt_scripts.ScriptID value for the running script. (Does not change inside function scripts, will be the ID of the script shown as "Running") %scriptresumecount%,Not sure. It appears that script states can be saved when the script engine is shutdown. Starting it and resuming the script appears to increase this value. %scriptstep%,The current script step. When a script completes and reports it Completed or Failed on "Step XX", this is the value. %scriptstepcounter%,The number of script steps executed. Should increase by 1 each time a script step is processed. %threadid%,Contains RunningScripts.ThreadID value for the current script.
  21. Hello, I'm trying to run this batch script to uninstall all version of Firefox in Automate but I can't seem to get it to work: taskkill.exe /f /im firefox.exe IF EXIST "%ProgramFiles%\Mozilla Firefox\uninstall\helper.exe" "%ProgramFiles%\Mozilla Firefox\uninstall\helper.exe" -ms IF EXIST "%ProgramFiles(x86)%\Mozilla Firefox\uninstall\helper.exe" "%ProgramFiles(x86)%\Mozilla Firefox\uninstall\helper.exe" -ms IF EXIST "%ProgramFiles%\Mozilla Firefox\uninstall\helper.exe" "%ProgramFiles%\Mozilla Firefox\uninstall\helper.exe" /s IF EXIST "%ProgramFiles(x86)%\Mozilla Firefox\uninstall\helper.exe" "%ProgramFiles(x86)%\Mozilla Firefox\uninstall\helper.exe" /s The batch file alone works if I manually run it on my machine. I've tried the following types of scripts: 1. "Execute Script" pasted the script into the "Script to Execute" window and chose "Run as Admin", Script Type: "Batch". 2. Download and Run script as admin. 3. App Deploy Wizard. Thanks for your help! John
  22. Vashdansky

    Adding Registry Keys via Script

    New to LT.. I am having issues with the search on this site. Don't seem to be finding topics I AM SURE have already been addressed. QUESTION: 1. I am used to scripting out things myself using Powershell, but in this environment I am stuck learning LT. Anyway, to send out a script to a LIST of machines.. I was only able to deploy a script to an entire site not a list of computers at the site. 42. How do I send out a reg key to targeted systems. I just want to add the key (yes for specter/meltdown) thanks.
  23. Hey Everyone, Trying to run a script on Exchange servers that runs a Get-Mailbox command but having trouble getting the script to run successfully. I believe my issue is the script is running powershell but failing because powershell and Exchange Management Shell are slightly different since EMS loads Exchange commands and Powershell does not. Has anyone had success running Exchange commands from Automate Scripts on Exchange servers? Any helpful hints or tips is much appreciated. FYI, I am trying to run a script that removes mobile devices that have not synced 180 days+. I have the EMS command that can accomplish this my only issue seems to be getting the script to run the command in EMS and not Powershell. Thanks!
  24. wchesley

    Scripting Probe Commands

    How can probe commands be scripted? I want to script an SNMP walk. I see the probecommands table in the database separate from the commands table How do I pass probe commands through a script?
  25. Lococard

    Adding Time to Ticket via Script

    Hello, I am looking to create a script which adds time to a ticket. I've tried to function 'Ticket Add Time' then entered the relevant data - this doesn't appear to do anything when run. I've also tried the option using the Time Recording tab which does nothing as well. Any ideas how to get this working?
×