Relative Content

Tag Archive for powershellautomationactive-directorysplunk

Need A powershell script that updates splunk’s server.conf to the hostname correctly

Goal of this is to have powershell search my AD Domain and find all machines with the splunk forwarder installed. Then validate if the machine host name matches the server name located in the server.conf file. Once it does not match, output those machines and the value that is has. Next step is to rename the line of where the server = $HOSTNAME$ is changed to be correct, then restart the splunk service on those machines.
Anyone have something like this? So far i was able to come up with this script from combined AI generators and other sources.*