Installing and Removing Actifile with PowerShell Scripts (Using Powershell and PSExec)

Scripts can be downloaded from: https://1drv.ms/f/s!AnGFvQ5rPFi4gegHtUk82C_7EkUKIA

PSexec can be downloaded from: https://download.sysinternals.com/files/PSTools.zip

DeployActifile.ps1:
deployActifile.ps1 checks if Actifile is installed and can therefore be used as a logon script (since it won’t run if Actifile is already deployed). If it isn’t installed, teh script will download the latest installer, and run the installation.

PowerShell Command (must be in elevated privilege Powershell and ExecutionPolicy bypass):
.\deployActifile.ps1 1234-1234-1234-1234
or
& ‘C:\Users.…replace.with.path….\Actifile Support\Installation Scripts\deployActifile.ps1’ 1234-1234-1234-1234

PSEXEC Command:
psexec \COMPUTERNAME -h -u USERNAME -p PASSWORD /s cmd /c %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -file “PATH\DeployActifile.ps1” 1234-1234-1234-1234

Parameters:
psexec – if not in path use the full path name (e.g. c:\pstools\psexec)
\COMPUTERNAME – Use computer resolvable name (e.g. \MARK-DESKTOP)
USERNAME – Use the admin users domain or workgroup name (e.g. HOME\admin)
PASSWORD – Use the above user’s password
PATH – Use a location accessible from the target computer
1234-1234-1234-1234 – Use the Actifile Tenant Install key (don’t mix keys between tenants!)

Printout:

PsExec v2.33 - Execute processes remotely
Copyright (C) 2001-2021 Mark Russinovich
Sysinternals - www.sysinternals.com

[2021/03/31 12:18:27] Actifile Download and Installation Script
[2021/03/31 12:18:27] v0.15
[2021/03/31 12:18:27] InstallKey: '1234-1234-11234-1234'
[2021/03/31 12:18:27] Actifile not previously installed - continuing...
[2021/03/31 12:18:27] Actifile Installer Previously Downloaded - continuing...
[2021/03/31 12:18:27] Now executing: MSIEXEC.EXE /i "C:\WINDOWS\TEMP\Actifile Install.msi" installkey=1234-1234-1234-1234 /quiet /l*v C:                \WINDOWS\TEMP\ActifileMSI.log
cmd exited on SURFACE3 with error code 0.

UninstallActifile.ps1:
Script uses elevated privilege to stops the services and dismount the driver, and then uses WMI to remove the installation.

PowerShell Command (must be in elevated privilege Powershell and ExecutionPolicy bypass):
.\uninstallActifile.ps1
or
& ‘C:\Users.…replace.with.path….\Actifile Support\Installation Scripts\uninstallActifile.ps1’

PSEXEC Command:
psexec \COMPUTERNAME -h -u USERNAME -p PASSWORD /s cmd /c %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -file “PATH\UninstallActifile.ps1”

Parameters:
psexec – if not in path use the full path name (e.g. c:\pstools\psexec)
\COMPUTERNAME – Use computer resolvable name (e.g. \MARK-DESKTOP)
USERNAME – Use the admin users domain or workgroup name (e.g. HOME\admin)
PASSWORD – Use the above user’s password
PATH – Use a location accessible from the target computer

Printout:
PsExec v2.33 – Execute processes remotely
Copyright (C) 2001-2021 Mark Russinovich
Sysinternals – www.sysinternals.com

[2021/03/31 12:01:21] Actifile Uninstallation Script
[2021/03/31 12:01:21] v0.12
[2021/03/31 12:01:21] Actifile installed - continuing...
[2021/03/31 12:01:21] Stopping service: 'Actifile Updater' using admin privileges
WARNING: Waiting for service 'Actifile Updater (Actifile Updater)' to stop...
[2021/03/31 12:01:24] Set the service: 'Actifile Updater' startup type to manual
[2021/03/31 12:01:24] Service: 'Actifile Updater' stopped successfully - continuing
[2021/03/31 12:01:24] Stopping service: 'Actifile Agent' using admin privileges
[2021/03/31 12:01:26] Set the service: 'Actifile Agent' startup type to manual
[2021/03/31 12:01:26] Service: 'Actifile Agent' stopped successfully - continuing
[2021/03/31 12:01:26] EaseFilter filter driver not found - continuing...
[2021/03/31 12:01:27] Actifile filter driver not found - continuing...
[2021/03/31 12:01:27] Retrieving the WMI object for the Actifile installation - it may take some time....
[2021/03/31 12:01:28] Rettrieved the WMI object: \\SURFACE3\root\cimv2:Win32_Product.IdentifyingNumber="{0D13F554-E542-4590-AACB-AA60CAE75A64}",Name="Actifile Agent",Version="2.0.65.0"
[2021/03/31 12:01:28] Now uninstalling...

__GENUS          : 2
__CLASS          : __PARAMETERS
__SUPERCLASS     :
__DYNASTY        : __PARAMETERS
__RELPATH        :
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
ReturnValue      : 0
PSComputerName   :

cmd exited on SURFACE3 with error code 0.

ReinstallScript:
Script uses elevated privilege to stops the services and dismount the driver, and then uses WMI to remove the installation. It then downloads the newest installer and reinstalls the product.

PowerShell Command (must be in elevated privilege Powershell and ExecutionPolicy bypass):
.\ReinstallScript.ps1 1234-1234-1234-1234
or
& ‘C:\Users.…replace.with.path….\Actifile Support\Installation Scripts\ReinstallScript.ps1’ 1234-1234-1234-1234

Command:
psexec \COMPUTERNAME -h -u USERNAME -p PASSWORD /s cmd /c %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -file “PATH\ReinstallScript.ps1” 1234-1234-1234-1234

Parameters:
psexec – if not in path use the full path name (e.g. c:\pstools\psexec)
\COMPUTERNAME – Use computer resolvable name (e.g. \MARK-DESKTOP)
USERNAME – Use the admin users domain or workgroup name (e.g. HOME\admin)
PASSWORD – Use the above user’s password
PATH – Use a location accessible from the target computer
1234-1234-1234-1234 – Use the Actifile Tenant Install key (don’t mix keys between tenants!)

Printout:
PsExec v2.33 – Execute processes remotely
Copyright (C) 2001-2021 Mark Russinovich
Sysinternals – www.sysinternals.com

[2021/03/31 11:55:35] Actifile Reinstallation Script
[2021/03/31 11:55:35] v0.12
[2021/03/31 11:55:35] InstallKey: '1234-1234-1234-1234'
[2021/03/31 11:55:35] Actifile installed - continuing...
[2021/03/31 11:55:35] Stopping service: 'Actifile Updater' using admin privileges
[2021/03/31 11:55:36] Set the service: 'Actifile Updater' startup type to manual
[2021/03/31 11:55:36] Service: 'Actifile Updater' stopped successfully - continuing
[2021/03/31 11:55:36] Stopping service: 'Actifile Agent' using admin privileges
[2021/03/31 11:55:37] Set the service: 'Actifile Agent' startup type to manual
[2021/03/31 11:55:37] Service: 'Actifile Agent' stopped successfully - continuing
[2021/03/31 11:55:37] EaseFilter filter driver not found - continuing...
[2021/03/31 11:55:38] Actifile filter driver not found - continuing...
[2021/03/31 11:55:38] Retrieving the WMI object for the Actifile installation - it may take some time....
[2021/03/31 11:55:58] Rettrieved the WMI object: \\SURFACE3\root\cimv2:Win32_Product.IdentifyingNumber="{0D13F554-E542-4590-AACB-AA60CAE75A64}",Name="Actifile Agent",Version="2.0.63.0"
[2021/03/31 11:55:58] Now uninstalling...

__GENUS          : 2
__CLASS          : __PARAMETERS
__SUPERCLASS     :
__DYNASTY        : __PARAMETERS
__RELPATH        :
__PROPERTY_COUNT : 1
__DERIVATION     : {}
__SERVER         :
__NAMESPACE      :
__PATH           :
ReturnValue      : 0
PSComputerName   :

[2021/03/31 11:56:05] Actifile successfully uninstalled - continuing...
[2021/03/31 11:56:05] Downloading from: 'https://app.actifile.com/Home/DownloadAgentMsi' to: 'C:\WINDOWS\TEMP\Actifile Install.msi'
[2021/03/31 11:56:29] Now executing: MSIEXEC.EXE /i "C:\WINDOWS\TEMP\Actifile Install.msi" installkey=1234-1234-1234-1234 /quiet /l*v C:\WINDOWS\TEMP\ActifileMSI.log


cmd exited on SURFACE3 with error code 0.

Powered by BetterDocs