angryprogrammerinside / installagent Goto Github PK
View Code? Open in Web Editor NEWInstallAgent Automation Suite for the N-Able Community, by the N-Able Community
InstallAgent Automation Suite for the N-Able Community, by the N-Able Community
Documentation states there is a Exit Code 10 and Event in application log with a code 10
Review and discuss disable service when uninstall fails
When no config or inputs are available, cust/token shows as an available install option.
In cases where there is a bad registry value or more than one UninstallKey value the the InstallAgent will be unable to properly remove the currently installed agent.
The default behavior of InstallAgent is if the MSI removal fails, it will exit the code with the fail.
There are several options available:
Given the further possible issues that could be added by a forced removal, it should initially be an optional flag in the partner config.
On some versions/languages/cultures of Windows the response for (Get-WmiObject Win32_OperatingSystem).OSArchitecture can vary, this will lead to improper detection of the Agent being installed
--== Installation ==--
Checking installation requirements...
The Script encountered an undocumented error.
== Command Details ==
Faulting Line Number: 2486
Faulting Command: $CurrentSource.Available = Test-Path ($CurrentSource.Path) -PathType Container
== Error Message ==
The network path was not found
Agent being disabled on some Win7/PS2 devices
Agent Installer Service\Script Result can be values other than Script Completed Successfully and still be valid/graceful exit.
Solution: Do not have threshold on value
I've created a GPO that does not point to \FQDN\Netlogon... but I've created a much more generic version of the GPO
I tried with %USERDNSDOMAIN% variable, but at the moment the script runs, it isn't aware of the USERDNS environment variables.
I run it with ..........\scripts\Agent\InstallAgent.ps1
It starts correct, it even installed an agent, but it said it ran as on-demand instead of Group Policy
Error retrieving token from using Customer ID (Partner Config) / AzNableProxy Token error when using AzNableProxy method.
Error caused by change from Invoke-RestMethod to more compatible Invoke-WebRequest which works fine in an IDE but requires -UseBasicParsing inside of CLI.
In the ApplianceConfig.xml the CustomerID may not always reflect the Customer ID, and instead be the value "-1". This causes the rogue agent/competitor agent installation workflow to incorrectly trigger an unnecessary re-install of the Agent.
The lookup of the system version is dependent on WMI/CIM, if that is faulting, the agent will not install
Symptops
$Agent.Registry.UninstallString is empty, however interrogation of the registry and input $Agent.Docs.Registry shows a valid value
Overall Script Result: Successful
Launcher - COMPLETE
Validation - COMPLETE
Diagnosis - COMPLETE
--== Validation ==--
Validating execution requirements...
All Required values in the Partner Configuration were successfully validated.
Valid CustomerId and Registration token found in Partner Configuration
AzNableProxyUri and AuthCode found
--== Validation Finished ==--
--== Diagnosis ==--
Diagnosing existing Agent Installation...
Found:
N-Central Agent Version - 2020.1.5.425 (Windows 12.3.1573.0)
Installed on 2020-05-29 at 07:04:47 PM
Device appears not to have Internet connectivity at present.
The Script will assess and perform Offline Repairs where possible until connectivity is restored.
Current Agent Status is Optimal:
No Action Required
--== Diagnosis Finished ==--Overall Script Result: Report This Error
Launcher - COMPLETEValidation - COMPLETEDiagnosis - EXITED (UNKNOWN)
--== Validation ==--
Validating execution requirements...
All Required values in the Partner Configuration were successfully validated.
Valid CustomerId and Registration token found in Partner Configuration
AzNableProxyUri and AuthCode found
--== Validation Finished ==--
--== Diagnosis ==--
Diagnosing existing Agent Installation...
Found:
N-Central Agent Version - 2020.1.5.425 (Windows 12.3.1573.0)
Installed on 2020-05-29 at 07:04:47 PM
Device appears not to have Internet connectivity at present.
The Script will assess and perform Offline Repairs where possible until connectivity is restored.
Current Agent Status is Optimal:
No Action Required
--== Diagnosis Finished ==--
**The Script encountered an undocumented error.
== Command Details ==
Faulting Line Number: 178
Faulting Command: Write-EventLog -LogName $Script.Results.EventLog -Source $Script.Results.ScriptSource -EventID (9000 + $Code) -EntryType $Script.Results.ErrorLevel -Message $Script.Results.EventMessage -Category 0
== Error Message ==
The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.**
The default PartnerConfig settings for the startup types for the agent differ to the defaults of the installed agent, in addition the agent will change to it's defaults eventually.
Solution: update defaults in PartnerConfig to reflect current 2020.x versions Agent service defaults.
At a given moment it detects incorrectly what version I'm currently running. 2 version strings are passed instead of one.
== Error Details ==
Function Name: ValidateVersion
Called at Line: 1781
Parameter Name: Version
Given Parameter: 2021.1.20391 12.3.1776 - Must be a Valid Version String
For whatever reason, EventCreate was designed only to log events that are associated with event log sources that EventCreate created. It does this by adding a REG_DWORD value called CustomSource in the source's registry key when it creates a new source, and checking for that value for a source that already exists. So in the above example, if the "MyStuff" source didn't already exist in the Application log, the above command would have created it and configured its key with a CustomSource value. Subsequent calls to EventCreate with the same source would succeed after verifying the existence of the CustomSource value. If, however, the "MyStuff" source had been created through another mechanism that didn't create a CustomSource flag, such as with the PowerShell New-EventLog cmdlet, then you'd get the error message. If you create a CustomSource value in an event source's key, then EventCreate will work with that source.
Need to have a different event source creation for powershell version should be solution
C:\temp\xx\xx\InstallAgent.ps1 : Missing an argument for parameter 'CustomerID'. Specify a parameter of type 'System.Object' and try again.
At line:1 char:86
~~~~~~~~~~~
LaunchInstaller.ps1 always runs waits for InstallAgent task to finish, rather than acting async unless the monitor flag is used for diagnostics
== Launcher Finished ==
Exiting...
1 was unexpected at this time.
In some environments ICMP outbound is blocked for security purposes, in these cases the default behavior of InstallAgent is to fail the install or go into offline repair mode of services.
In either case these environments need another method for determining connectivity to the server.
For backwards compatibility The System.Net.Sockets TCP class could possibly be used, but this class gives errors while running under CLI/Scripting due to some kind of .Net configuration issue, similar to the issue experienced.
Another less backwards compatible option is the Test-NetConnection -Port option, this only works on later versions of PowerShell and has some compat issues on Server 2012.
The last method may be to simply perform a https web request against the N-Central server itself, there are basic .Net methods that are compatible with all versions of powershell .
Rather than a new line per entry, logs generated are all on one line, presenting a poor log
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.