Testing remote connectivity for PowerShell

Some things to keep in mind:

The account you run this with needs to be a member of either Local Administrators or Remote Desktop Users, and needs to be a member of SharePoint Shell admin access – assuming you want to access the SharePoint Farm programmatically via powershell.

 

If you have access to an account like this and this account is both a local admin and has Shell Admin access for the SharePoint farm, you can use this powershell to test remote connectivity to your farm using powershell.

You’ll want to run powershell as this account, so right click on the icon and choose the run as option

You might not know the name of your server, if that is the case just follow these steps:

 

Open a command prompt

Type NSlookup and then press enter

Type in the name of a site that you know exists on the server, for example portal.mycompany.com and then press enter

The command will return an ip address, e.g. 10.0.0.1 or something

Type exit and then press enter

Type tracert 10.0.0.1 (NOTE: the 10.0.0.1 is just an example, you will use whatever IP you got back in the earlier step) and press enter and you’ll get the name of the server that the IP is related to, unless the site, portal.mycompany.com is behind a load balancer.  You will need to modify the list of servers with you server’s name.  If you know all the servers in the farm (Get-SPFarm).servers, you can make the comma separated list as show in the examples on this post and if you have a single server farm on a server named DansSharePoint.glorifyIT.com, you would type this $Servers=”DansSharePoint” versus $Servers=”2016APPSRCH”,”2016WFEDC”

 

If you want to build in some logic to make sure that you’re logged in with the setup account, add the following lines to your script

 

Your script would then look like this:

 

Leave a Reply