Showing posts with label snapin. Show all posts
Showing posts with label snapin. Show all posts

Wednesday 17 November 2010

Powershell - Running as a farm administrator using the SharePoint plug-in on Powershell

Problem: I need to run SharePoint Powershell commands in Production/UAT, I get remote access to the servers however the account is not the SharePoint farm account as the Famr account runns windows services and should not have remote access to the servers. 

Initial Hypothesis: Remote desktop into the WFE server, use the command prompt to launch Powershell using the farm account.  Lastly, add the SharePoint snapin for SharePoint 2010.
Update 6 Dec 2010 - Alternatively, hold down the shift key and right click the program you wish to run, you are given the "run as .." menu option.

Resolution:
1.> Remote desktop into the machine using a remote desktop access account i.e. demo\
2.> Open the cmd prompt and run the following cmd:
cmd > runas /user:demo\farm_admin c:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe
3.> In the new Powershell windows add the PowerShell snapin
ps c:\windews\system32> Add-PSSnapin Microsoft.SharePoint.PowerShell
Read More:
http://social.technet.microsoft.com/Forums/en-US/sharepoint2010setup/thread/fcb77654-0f13-42e0-b181-6e52242fe9d6  Adding the SharePoint snapin to PowerShell.