Kaseya Community

powershell

  • somebody can help with this..

    I have the following powershell ( when submtting manually it works but not from kaseya

    what should be the syntax in kaseya

    #requires -version 2
    <#

    .SYNOPSIS
    restartservice.ps1

    .PARAMETER server
    restart service

    #>


    param (
    [Parameter( Mandatory=$false)]
    [string]$server

    )

    restart-Service -InputObject $(Get-Service -Computer $server -Name "Kaseya Agent")

  • The most likely reason it won't work is because you are stopping the agent services that is required to process the agent procedure.

    Instead do a remote service restart from another machine and it will work. I think I shared a procedure that does that somewhere in the forums.

  • I'm trying to run this on a remote client.

    would you be able to find back your procedure

  • I used the search function on this site to find this:

    community.kaseya.com/.../1033.aspx

    And, my thanks again to HardKnoX and others who take the time to post their scripts here. Very kind.

  • thank you very much indeed