Get all the machines in sharepoint farm
10,329
If Get-SPDatabase | Select NormalizedDataSource
returns all the databases, you can filter the results by using the -Unique
switch:
Get-SPDatabase | Select NormalizedDataSource -unique
You can get all the SP application servers by filtering by role:
get-spserver | ? { $_.Role -eq "Application" }
Author by
alex
software architect sharepoint ibm websphere MQ ibm datapower Oracle weblogic server
Updated on June 23, 2022Comments
-
alex over 1 year
im writing really big script that will get a lot of info on the farm I want to make it dynamically so I want :
1. Get all the database servers in the sharepoint farm 2. And I want to get all the sharepoint machines in farmThe problem is that with
Get-SPServer
I get all the server together mixed up and I get the smtp server as well And with
Get-SPDatabase | Select NormalizedDataSource
I get them multiple times
Please help
-
Andy Arismendi almost 12 yearsWhat order do you want to the objects from
Get-SPServer
to be in? -
alex almost 12 yearsi dont care . do you know a way how to parse them ?
-
Andy Arismendi almost 12 yearsIt sounds like what you want to do is sort the objects returned by
Get-SPServer
and possibly filter some objects out as well. To sort by object properties you can use theSort-Ojbect
cmdlet and to filter out specific objects use theWhere-Object
cmdlet.
-