By Martin Stevnhoved
I am making an Automation Script that updates a custom plugin-file, that might is always be in use, to a newer version.
If the plugin doesn't already exist everything works fine.
But if it already exist it cannot be overwritten, because the Pulseway Service (and managers, if any are running) is using the file.
My solution is to stop the service, overwrite the file and start the service.
It works very well when executing manually in ISE, but not when executed as an Automation Script from Pulseway.
It looks like the entire script is terminated when the service stops, and the execution doesn't return anything in execution history - not even an error.
Could anyone help me with the best practice for updating a plugin dll-file from an Automation Script.
I am trying to create a PowerShell script that will run DBCC checks on a SQL server and then report status back to Pulseway. I have a working script that I can run from the command line but the script will not run correctly when sent as a Pulseway script. Here are the details.
The script fails because it is unable to authenticate to the SQL server. The SQL Server is running on the same machine as I am running the script on. Thus wil are not dealing with cross machine accounts. I have put debug code into the script and the account reported back by PowerShell is MACHINENAME$. The machine is in a domain and thus the script appears to be reporting back the machine account in the domain. This implies to me that when Pulseway runs a script it is using the NT AUTHORITY\SYSTEM account and that the MACHINENAME$ account would then be used for any network access. Is this correct?
I have given SQL Server rights to NT AUTHORITY\SYSTEM as well as DOMAIN\MACHINENAME$ and NT AUTHORITY\LOCAL SERVICE. Non of these rights appear to allow me to connect to SQL. Has anyone ever written Powershell code for Pulseway and been able to connect to SQL Server?
Any ideas, thoughts or details on the user contexts used by Pulseway would be helpful.
Our business operates with hundreds of products in our inventory and going through all of them and manually entering them into PSA was not exactly an option, and without an import function, I had to develop an import tool that uses the PSA API. I developed it originally with hard coded parameters, in a single class, but went back today and improved it for distribution to everyone here.
To view the source code, check out the repository at https://bitbucket.org/garrettbromley/pulseway-product-import/
To download the executable files, download PulsewayProductImport-v2.zip at https://bitbucket.org/garrettbromley/pulseway-product-import/downloads/
Download the Excel template and add your inventory into that sheet. I personally had a Microsoft Surface that I walked around with and inventoried everything. To change the categories/sub categories, open the "Back End" tab on the sheet and edit those tables to your liking The only column that isn't required is the UPC Code. Run the Import Tool Input your PSA credentials Type in the full directory to the excel sheet (make sure its closed before running it) Confirm the number of detected items Watch the tool work Make a stock adjustment with the levels of stock for each item (this unfortunately cannot be automated) It will notify you how many items have successfully been imported and which ones failed (if any) and why.
Please let me know if you have any questions! I will post changelogs if any updates are made.