Skip to main content

Windows platform specifics

note
  • To execute commands, Windows Remoting must be enabled.

    In Windows Server 2012 or later this is enabled by default. For older machines, use the command Enable-PSRemoting as Administrator. This will also open required firewall ports.

  • PowerShell version 3 or later must be installed.

  • The user that executes the scan must be a member of the Local administrator group.

Remote copy mode

On the computer that will run the script for remote scan:

  1. Copy the files snowagent.exe and snowagent.config to the current folder (copy from an existing agent installation). If Oracle inventory option is to be used, place sios.jar in the same folder.

  2. Run the following commands one-by-one or put them into .ps1 script:


    $remoteSession = New-PSSession -ComputerName <TARGET_NAME> -Credential <Domain\User>

    Invoke-Command -Session $remoteSession {mkdir <TEMP_DIR>\snowagent}

    Copy-Item -Path snowagent.exe -Destination <TEMP_DIR>\snowagent -ToSession $remoteSession

    Copy-Item -Path snowagent.config -Destination <TEMP_DIR>\snowagent -ToSession $remoteSession

    Invoke-Command -Session $remoteSession {cd <TEMP_DIR>\snowagent\snowagent; .\snowagent.exe}

    Invoke-Command -Session $remoteSession {cd ..;Remove-Item -Recurse -Path <TEMP_DIR>\snowagent -Force}

    Remove-PSSession -Session $remoteSession

    Where:

    ParameterDescription
    <TARGET_NAME>Domain name of the computer to be scanned
    <Domain\User>User that will execute the scan. It needs to have Local Administrator privileges.
    <TEMP_DIR>Temporary folder where a temporary agent folder will be created, for example C:\temp.
    <DRIVE_LETTER>Drive letter of the disk where <TEMP_DIR> is located, i.e. C or D.
    <TEMP_DIR_WITHOUT_DRIVE>Temporary folder where a temporary agent folder will be created, with no drive letter present. For example: temp\
    <LOCAL_DROP_LOCATION>The folder where to drop data to on the local computer.
  3. If Oracle inventory scan is required, add the following command to the script after copying snowagent.config:

    Copy-Item -Path sios.jar -Destination <TEMP_DIR>\sios.jar -ToSession $remoteSession
  4. If a server endpoint is not configured, run snowagent with only scan option and then retrieve result files from the machine:


    Invoke-Command -Session $remoteSession {cd <TEMP_DIR>\snowagent\snowagent; .\snowagent.exe scan}

    Copy-Item -Recurse -Path '\\<TARGET_NAME>\<DRIVE_LETTER>$\<TEMP_DIR_WITHOUT_DRIVE>\snowagent\data' -Destination <LOCAL_DROP_LOCATION>

Net share mode

On the computer that will run the script for remote scan:

  1. Copy the files snowagent.exe and snowagent.config to the shared network folder

    \\<NET_SHARE_ADDRESS>\<NET_SHARE_FOLDER> (copy from an existing agent installation).

    If Oracle inventory option is to be used, place sios.jar in the same folder.

    The recommendation is to create a separate folder for each agent variation (32- and 64-bit). In this example, we assume that 32-bit snowagent.exe is to be put in the following folder:

    \\<NET_SHARE_ADDRESS>\<NET_SHARE_FOLDER>\win32\

  2. Run the following commands one-by-one or put them into a .ps1 script:

    $remoteSession = New-PSSession -ComputerName <TARGET_NAME> -Credential <Domain\User>

    Invoke-Command -Session $remoteSession {cd \\<NET_SHARE_ADDRESS>\<NET_SHARE_FOLDER>\win32; mkdir <TARGET_NAME>}

    Invoke-Command -Session $remoteSession {cd \\<NET_SHARE_ADDRESS>\<NET_SHARE_FOLDER>\win32\<TARGET_NAME>; ..\snowagent}

    Remove-PSSession -Session $remoteSession

    Where:

    ParameterDescription
    <TARGET_NAME>Domain name of the computer to be scanned.
    <Domain\User>User that will execute the scan. It needs to have Local Administrator privileges.
    <TEMP_DIR>Temporary folder where a temporary agent folder will be created, for example C:\temp.
    <NET_SHARE_ADDRESS>Host name or IP address of the machine that hosts the shared folder.
    <NET_SHARE_FOLDER>Name of the shared folder on the <NET_SHARE_ADDRESS> machine.
  3. If a server endpoint is not configured, run snowagent with only scan option:


    Invoke-Command -Session $remoteSession {cd
    \\<NET_SHARE_ADDRESS>\<NET_SHARE_FOLDER>\win32\<TARGET_NAME>; ..\snowagent
    scan}