Guest User

Untitled

a guest
Nov 1st, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. #Get-EpoServer
  2. [CmdletBinding()]
  3. param (
  4. [string] $SiteListFile = 'C:\ProgramData\McAfee\*\SiteList.xml'
  5. ) #param
  6. process {
  7. $SiteListPath = (Resolve-Path -Path $SiteListFile).Path
  8. $GoForIt = Test-Path -Path $SiteListPath
  9. if ($GoForIt) {
  10. $SiteList = [xml](Get-Content -Path $SiteListPath -Encoding String)
  11. } #if
  12. $EpoServers = @()
  13. $SiteList.SiteLists.SiteList.SuperAgentSite | ForEach-Object {
  14. $EpoServers += New-Object -TypeName psobject -Property @{
  15. Type = [string]$_.Type
  16. Name = [string]$_.Name
  17. Order = [int]$_.Order
  18. Enabled = [string]$_.Enabled
  19. Local = [string]$_.Local
  20. SecurePort = [string]$_.SecurePort
  21. Server = [string]$_.Server
  22. ServerName = [string]$_.ServerName
  23. ServerIP = [string]$_.ServerIP
  24. Version = [string]$_.Version
  25. RelativePath = [string]$_.RelativePath
  26. UseAuth = [string]$_.UseAuth
  27. UserName = $_.UserName
  28. Password = $_.Password.'#text'
  29. }
  30. } #ForEach SuperAgentSite
  31. $SiteList.SiteLists.SiteList.SpipeSite | ForEach-Object {
  32. $EpoServers += New-Object -TypeName psobject -Property @{
  33. Type = [string]$_.Type
  34. Name = [string]$_.Name
  35. Order = [int]$_.Order
  36. Enabled = [string]$_.Enabled
  37. Local = [string]$_.Local
  38. SecurePort = [string]$_.SecurePort
  39. Server = [string]$_.Server
  40. ServerName = [string]$_.ServerName
  41. ServerIP = [string]$_.ServerIP
  42. Version = [string]$_.Version
  43. RelativePath = [string]$_.RelativePath
  44. UseAuth = [string]$_.UseAuth
  45. UserName = $_.UserName
  46. Password = $_.Password.'#text'
  47. }
  48. } #ForEach SpipeSite
  49. $EpoServers = $EpoServers |
  50. Select-Object -Property Type,Name,Order,Enabled,Local,SecurePort,Server,ServerName,ServerIP,Version,RelativePath,UseAuth,UserName,Password |
  51. Sort-Object -Property Order
  52. Write-Output -InputObject $EpoServers
  53. } #process
Add Comment
Please, Sign In to add comment