Hello,
We present you a Powershell command line to retrieve the server list of published application.
The specificity is that we will take the fact that applications can be published directly on servers and/or by a worker group.
The script will then get list of servers contained in the worker group:
[important]Get-XAApplicationReport * | select DisplayName,FolderPath,@{N=’ServerNames’;E={$_.serverNames+($_|?{$_.WorkerGroupNames}|%{Get-XAWorkerGroup $_.WorkerGroupNames}).ServerNames}} |convertto-csv >> export.csv[/important]
Thanks to Hypervisor.fr for the “OneLiner” form.
You can export a CSV file, here export.csv but you can change the ‘ConvertTo-Csv’ to ‘ConvertTo-Html’ and generate a usable HTML file.
As always feel free to comment 🙂
UPDATE :
This command is ONLY functionnal if your worker group is populate with Server Farm ( not by OU or ServerGroup )
I will update the command in a second post.
Thanks to Glen for his help about this.
UPDATE 2 :
This is a Powershell command allow you to get all servers without regarding their type:
Get-XAWorkerGroupServer NAMEOFYOURWORKER |select servername
You can try command who is NOT finished because if you don’t have a publication publishing with a worker it return a $null
I will make an update (again )
Get-XAApplicationReport * | select DisplayName,FolderPath,@{N=’ServerNames’;E={$_.serverNames+($_|?{$_.WorkerGroupNames}|%{Get-XAWorkerGroup $_.WorkerGroupNames}).ServerNames}}
5 comments
Skip to comment form
The script is not pulling the list of servers contained in the workergroups. any suggestions?
Is there an updated script for OU or ServerGroup ?
Author
Yes i will update it very soon. Sorry for delay
Ok.
Thanks
Hello,
Very helpful .
Thank you
MLY