Simple question... how do I get the machine name off of the SPContext object.

  • What are you trying to do? – Mike Oryszak Dec 3 '11 at 2:43

Maybe SPServer.Local is what you are looking for...


I'm not sure why you would use SPContext for that - perhaps you are looking for this instead: Environment.MachineName


Try HttpContext.Current.Server.MachineName


POSH Scripts to get you server info

(Get-SPServer has other params - check for unique server)

$myserver = Get-SPServer $myserver | select-object *

  • there should be line after Get-SPServer (this editor didn't pick it up) – Supriyo SB Chatterjee Dec 2 '11 at 17:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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