Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Get-EpoServer
- [CmdletBinding()]
- param (
- [string] $SiteListFile = 'C:\ProgramData\McAfee\*\SiteList.xml'
- ) #param
- process {
- $SiteListPath = (Resolve-Path -Path $SiteListFile).Path
- $GoForIt = Test-Path -Path $SiteListPath
- if ($GoForIt) {
- $SiteList = [xml](Get-Content -Path $SiteListPath -Encoding String)
- } #if
- $EpoServers = @()
- $SiteList.SiteLists.SiteList.SuperAgentSite | ForEach-Object {
- $EpoServers += New-Object -TypeName psobject -Property @{
- Type = [string]$_.Type
- Name = [string]$_.Name
- Order = [int]$_.Order
- Enabled = [string]$_.Enabled
- Local = [string]$_.Local
- SecurePort = [string]$_.SecurePort
- Server = [string]$_.Server
- ServerName = [string]$_.ServerName
- ServerIP = [string]$_.ServerIP
- Version = [string]$_.Version
- RelativePath = [string]$_.RelativePath
- UseAuth = [string]$_.UseAuth
- UserName = $_.UserName
- Password = $_.Password.'#text'
- }
- } #ForEach SuperAgentSite
- $SiteList.SiteLists.SiteList.SpipeSite | ForEach-Object {
- $EpoServers += New-Object -TypeName psobject -Property @{
- Type = [string]$_.Type
- Name = [string]$_.Name
- Order = [int]$_.Order
- Enabled = [string]$_.Enabled
- Local = [string]$_.Local
- SecurePort = [string]$_.SecurePort
- Server = [string]$_.Server
- ServerName = [string]$_.ServerName
- ServerIP = [string]$_.ServerIP
- Version = [string]$_.Version
- RelativePath = [string]$_.RelativePath
- UseAuth = [string]$_.UseAuth
- UserName = $_.UserName
- Password = $_.Password.'#text'
- }
- } #ForEach SpipeSite
- $EpoServers = $EpoServers |
- Select-Object -Property Type,Name,Order,Enabled,Local,SecurePort,Server,ServerName,ServerIP,Version,RelativePath,UseAuth,UserName,Password |
- Sort-Object -Property Order
- Write-Output -InputObject $EpoServers
- } #process
Add Comment
Please, Sign In to add comment