7

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

1
  • What are you trying to do? Commented Dec 3, 2011 at 2:43

4 Answers 4

5

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

0
1

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

1

Try HttpContext.Current.Server.MachineName

0

POSH Scripts to get you server info

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

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

1
  • there should be line after Get-SPServer (this editor didn't pick it up) Commented Dec 2, 2011 at 17:06

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.