Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.
Microsoft cloud engineer - SharePoint, Office 365, Azure, DotNet, Angular, JavaScript.

CodePlex

SharePoint Online – Configure PowerShell with remote cmdlets

Check out this quick 7 minute video for how I configure my local PowerShell console with both Microsoft and community cmdlets.   Remotely manage Office 365 sites with Global Administrator rights or even simple Power User.   Options exist for all access levels.

Please leave a comment if you found this helpful.  Enjoy! 

shades_smile

 

Download

 

PowerShell

Import-Module Microsoft.Online.SharePoint.PowerShell
Import-Module SPOCmdlets
Import-Module C:\util\spps\spps.psm1

 

Video

SPLaunch – new CodePlex for PowerShell automation

Yesterday I published a new CodePlex project to automate PowerShell remoting.   Basically I got tired of RDP-ing to 10 machines to type the same command 10 times.  Why not use a local PowerShell window to read CSV with server names and execute remotely in bulk?    Well, now you can.

 

Give it a try for an hour to download, setup, and run.  You can save that much time in just a day by using this in instead of juggling RDP and typing multiple PowerShell commands.   Please leave a comment or CodePlex review to let me know what you think.  

Smile

 

http://splaunch.codeplex.com/

 

 

Business Challenge

  • Growing list of servers
  • Inconsistent configuration (DEV has, TEST lacks, PROD just crazy)
  • Need to reduce admin time. Make room for business analysis, teach how to use, evangelize features

Technical Solution

  • PowerShell remoting + automation wrapper = rapid fire commands
  • PS1 with functions
  • Noun CSV with server farms and login user
  • Verb CSV with "shortcut" alias PowerShell commands
  • Mix and match Noun/Verb CSV with automation wrapper (New-PSSession / Invoke-Command)

Examples

Open all servers in the "DCO" farm (Development Collaboration) and show total RAM size with percent used:

  • LaunchFarm DCO
  • LaunchShortcut ram | ft -a

Open just the first server across all farms and show the SharePoint build number:

  • LaunchFarm ALL 1
  • LaunchShortcut spver | ft -a

NOTE – MUST MANUALLY UPDATE "Noun" CSV file with target machine names, AD domain,
and user account before any commands can be run.

 

Screenshots

1

2

3

4

Getting Started

  • Enable PowerShell remoting and WSMan CredSSP on all target servers. "Enable-PSRemoting -Force"and "Enable-WSManCredSSP -Role Server" http://dustinhatch.tumblr.com/post/24589312635/enable-powershell-remoting-with-credssp-using-group
  • Enable PowerShell client with "Enable-PSRemoting -Force" and "Set-Item wsman:\localhost\client\trustedhosts * -Force"
  • Update NounCSV with servers and user names
  • Run "SPLaunch.ps1 -install" to add to $profile so it starts with new PowerShell windows
  • Run LaunchAFarm to see farms
  • Run LaunchAFarm DCO to connect to that farm (comma separated allows multiple farms)
  • Run LaunchAShortcut to see shortcuts
  • Run LaunchAShortcut RAM to execute the "RAM" command (end with " | ft" to format as table)
  • Enjoy!

Warnings

  • Account lockout – Possible if typing the password wrong and open many sessions at once.
  • System update – Verb CSV can modify configuration on many servers quickly. Use carefully for changes.

Please drop me a line via email spjeff@spjeff.com or Twitter @spjeff with ideas. I’m always open to suggestions and improvements.

Post-install scripting fun

Recently I’ve tested http://autospinstaller.codeplex.com/ from @brianlala to build new SharePoint farms.  It’s a wonderful script and a great way to learn SharePoint cmdlets with real examples.

A few more script ideas:

  • More service apps   (Access, Word, Excel, Visio, BCS, PPS)
  • Third party  (WSP, MSI, CAB, REG)

So I wrote a small script to run after Brian’s and setup these small things.   Caution:  my scripting skills are limited and the Third Party will always run (no detect if installed ) so you may not want to run this repeatedly.  Disclaimer aside, I think it’s pretty cool.  I plan to use this and thought others might find it helpful too.   I will update this blog post as needed and cross link to CodePlex.  Please leave a comment with feedback!  

Smile

 


Download Now:

Post script by SPJeff.ps1

 

image

 

image

image

image

 

 

Write-Host -ForegroundColor White "Verifying Enterprise Edition service applications"
$hosted = Get-SPServiceApplicationPool "SharePoint Hosted Services"

If((Get-SPServiceApplication | ? {$_.GetType().ToString() -eq "Microsoft.Office.Access.Server.MossHost.AccessServerWebServiceApplication"}) -eq $null)
{
	Write-Host -ForegroundColor White " - Creating Access Service:"
	New-SPAccessServiceApplication -Name "Access SA" -ApplicationPool $hosted
	Write-Host -ForegroundColor Blue "   Complete"
} else {
	Write-Host -ForegroundColor White " - Already installed: Access Service"
}

If((Get-SPServiceApplication | ? {$_.GetType().ToString() -eq "Microsoft.SharePoint.BusinessData.SharedService.BdcServiceApplication"}) -eq $null)
{
	Write-Host -ForegroundColor White " - Creating Business Data Connectivity Service:"
	New-SPBusinessDataCatalogServiceApplication -Name "Business Data Connectivity SA" -ApplicationPool $hosted
	Write-Host -ForegroundColor Blue "   Complete"
} else {
	Write-Host -ForegroundColor White " - Already installed: Business Data Connectivity Service"
}

If((Get-SPServiceApplication | ? {$_.GetType().ToString() -eq "Microsoft.Office.Excel.Server.MossHost.ExcelServerWebServiceApplication"}) -eq $null)
{
	Write-Host -ForegroundColor White " - Creating Excel Service:"
	New-SPExcelServiceApplication -Name "Excel SA" -ApplicationPool $hosted
	Write-Host -ForegroundColor Blue "   Complete"
} else {
	Write-Host -ForegroundColor White " - Already installed: Excel Service"
}

If((Get-SPServiceApplication | ? {$_.GetType().ToString() -eq "Microsoft.PerformancePoint.Scorecards.BIMonitoringServiceApplication"}) -eq $null)
{
	Write-Host -ForegroundColor White " - Creating Performance Point Service:"
	New-SPPerformancePointServiceApplication -Name "PerformancePoint SA" -ApplicationPool $hosted
	New-SPPerformancePointServiceApplicationProxy -Name "PerformancePoint SA Proxy" -ServiceApplication "PerformancePoint SA"
	Write-Host -ForegroundColor Blue "   Complete"
} else {
	Write-Host -ForegroundColor White " - Already installed: PerformancePoint Service"
}

If((Get-SPServiceApplication | ? {$_.GetType().ToString() -eq "Microsoft.Office.Visio.Server.Administration.VisioGraphicsServiceApplication"}) -eq $null)
{
	Write-Host -ForegroundColor White " - Creating Visio Service:"
	New-SPVisioServiceApplication -Name "Visio SA" -ApplicationPool $hosted
	New-SPVisioServiceApplicationProxy -Name "Visio SA Proxy" -ServiceApplication "Visio SA"
	Write-Host -ForegroundColor Blue "   Complete"
} else {
	Write-Host -ForegroundColor White " - Already installed: Visio Service"
}

If((Get-SPServiceApplication | ? {$_.GetType().ToString() -eq "Microsoft.Office.Word.Server.Service.WordServiceApplication"}) -eq $null)
{
	Write-Host -ForegroundColor White " - Creating Word Service:"
	New-SPWordConversionServiceApplication -Name "Word SA" -ApplicationPool $hosted
	Write-Host -ForegroundColor Blue "   Complete"
} else {
	Write-Host -ForegroundColor White " - Already installed: Word Service"
}

Write-Host -ForegroundColor White "Verifying .REG extras"
foreach ($reg in Get-Childitem "REG" -include *.REG -recurse)
{
	Write-Host -ForegroundColor White " - Loading "$reg
	Start-Process -Wait -NoNewWindow -FilePath regedit.exe -ArgumentList "/s `"$reg`""
}

Write-Host -ForegroundColor White "Verifying .MSI extras"
foreach ($msi in Get-Childitem "MSI" -include *.MSI -recurse)
{
	Write-Host -ForegroundColor White " - Loading "$msi
	Start-Process -Wait -NoNewWindow -FilePath msiexec.exe -ArgumentList "/i `"$msi`" /qb"
}

Write-Host -ForegroundColor White "Verifying .CAB extras"
foreach ($cab in Get-Childitem "CAB" -include *.CAB -recurse)
{
	Write-Host -ForegroundColor White " - Loading "$cab
	Start-Process -Wait -NoNewWindow -FilePath stsadm.exe -ArgumentList "-o addwppack -filename `"$cab`""
}

Write-Host -ForegroundColor White "Verifying .WSP extras"
foreach ($wsp in Get-Childitem "WSP" -include *.WSP -recurse)
{
	Write-Host -ForegroundColor White " - Loading "$wsp
	Start-Process -Wait -NoNewWindow -FilePath stsadm.exe -ArgumentList "-o addsolution -filename `"$wsp`""
}

© Copyright 2016
@ SPJeff

Return to Top ▲Return to Top ▲