I developing a simple Windows Forms Application that using a PowerShell script to add WSP solutions to multiple SharePoint front ends automatically.

I am not a SharePoint developer but it's required task from me, i worked also on SharePoint 2010

PowerShell script take one parameter $webUrl so i need to foreach on every Front End and get it's Web Application URL then pass it to script.

The above is too easy, i done all required steps except that i didn't know how to get Web Application URL from only the front end server name.

i think i want to check if this front end server have SharePoint installed in it, then i get the Web Application URL.

I know that SharePoint can have multiple web application URL configured on IIS.

I think the result should be some thing like that:


1 Answer 1


I don't think it'll be possible to get a list of web applications only from the server name. You'll have to run the script from the server to get the local farm instance and then iterate through the web applications in the farm. Steps are outlined here : http://blog.falchionconsulting.com/index.php/2009/04/getting-an-spwebapplication-object-using-powershell/

Though if multiple servers are connected to a farm you'll have to run this on only one server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.