Git Product home page Git Product logo

installagent's People

Contributors

angryprogrammerinside avatar robby-swartenbroekx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

installagent's Issues

InstallAgent will not upgrade agent if there are corrupt UninstallKey entries

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:

  • Reuse the previous AgentCleanup4.exe
  • Code up forced removal of the previous agent

Given the further possible issues that could be added by a forced removal, it should initially be an optional flag in the partner config.

64-bit detection issues on other platforms

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

On-Demand failing when network path to new sysvol source unavailable

--== 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

Custom Service Package

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

Incorrectly detected as On-Demand execution

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

False positive error when running script when offline and agent is in optimal condition

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.**

Repair occurring too often under default XML configuration settings

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.

Validation of versions incorrect.

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

ERROR: Source parameter is used to identify custom applications/scripts only (not installed applications).

Per: https://stackoverflow.com/questions/48288243/eventcreate-exe-creates-a-customsource-value-what-does-it-mean

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

Error when starting script when only 1 parameter specified

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

  • ... "C:\temp\xx\xx" -DebugMode -CustomerID -Regis ...
  •                                                   ~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [InstallAgent.ps1], ParameterBindingException
    • FullyQualifiedErrorId : MissingArgument,InstallAgent.ps1

InstallAgent will not function correctly in environments where outbound ICMP is disabled

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 .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.