This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Get ARS Server name where $request has been performed

Hello, 

hope someone can answer this question, I have multiple ARS servers deployed all of which are running a PowerShell policy script logging to a common directory, due to differences in timezone I'd like to separate the various log files prepending them with the name of the ARS server where request is originating. 

Is there a way I can gather this value from within the $request itself? I can think of couple workarounds but I'd rather handle this directly from within ARS itself. 

Thanks in advance for any pointer!

  • This will get you the name of the AR Server executing the current request.

    Put this in the PoSh code that you are using to write your log file.

    # Connect to the root of the current AR server

    $AR = [ADSI]"EDMS://rootDSE"

    # Get the name of the current AR Server

    $ARServer = $AR.psbase.InvokeGet("edsvaServiceFullDns")