#Written by Donald Phillips #https://github.rackspace.com/adam5185/dpsecuritypci/blob/master/Create_Install_XML.ps1 #Initially create the XML file based on the documentation from FortiSIEM wiki: https://one.rackspace.com/display/gss/FortiSIEM+Windows+Agent+PCI+Playbook $CreateXML = New-Item -Path C:\Windows\Temp\FortiSIEM\InstallSettings.xml -ItemType File #Modify the XML by adding the content as seen within the ' ' below. $ModifyXML = Set-Content -Path C:\Windows\Temp\FortiSIEM\InstallSettings.xml -value ` ' 1 Super supervisor.prod.isiem.rackspace.net 443 DomainName Super/ISIEMAgentAdmin nPv@t4jF ignore ' #Identify FQDN for input to XML File "HostName" $FQDN = (Get-WmiObject win32_computersystem).DNSHostName+"."+(Get-WmiObject win32_computersystem).Domain #Grab XML and input to PowerShell for readability [xml]$InstallXML = Get-Content C:\Windows\Temp\FortiSIEM\InstallSettings.xml #Modify the Default HostName value from "Domain Name" to the server's FQDN $InstallXML.InstallConfig.Hostname = $FQDN #Save the XML and exit the editing process with XML fully configured $InstallXML.Save("C:\Windows\Temp\FortiSIEM\InstallSettings.xml")