< Back

Connect-ePoServer

Sat Jan 18, 2020 7:47 pm

NAME Connect-ePoServer



SYNOPSIS

The Connect-ePoServer function establishes a connection the McAfee EPO Server.





SYNTAX

Connect-ePoServer [-epoServer] <String> [[-Credentials] <Object>] [<CommonParameters>]





DESCRIPTION

The Connect-ePoServer function establishes a connection the McAfee EPO Server. All results are returned in XML

format. The System.Net below is to bypass unstrusted https, since by default ePo server self signs its cert. Lists

all

of the commands available after a successful connection has been made.





PARAMETERS

-epoServer <String>

The url used to access the McAfee EPO.



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue, ByPropertyName)

Accept wildcard characters? false



-Credentials <Object>



Required? false

Position? 2

Default value (Get-Credential)

Accept pipeline input? true (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





This function currently creates three script scope variables.

The variable names are: Credentials, ePOServer, and ePoCommands. ePOServer is the url of the McAfee

EPO Server. ePoCommands is a custom PowerShell object with the Command and CommandText for each

command found using the core.help API command. The Credentials variable is used for subsequent calls

to the McAfee ePo API.

Added logic to check that the connection to the ePoServer works.

Changed to use Invoke-RestMethod as previous WebClient method was not securing password.

Module requires PowerShell verison 3 or higher.



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>Connect-ePoServer



Connects to the default McAfee EPO Server.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>Connect-ePoServer -ePOServer "https://yourserver:8443"



Connects to the McAfee EPO Server at https://yourserver:8443









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Connect-ePoServer -ePoServer -ePOServer "https://yourserver"



$ePoCommands | Where {$_.Command -like "*system*"} | Get-ePoCommandHelp



This makes an active connection to the server. It then gets the command help for all of the commands that have the

word system in it.











RELATED LINKS