Wednesday, February 21, 2018

PowerShell Courses Books Tools and Training

Free Books

List of Free PowerShell eBooks (11-2018)
https://www.hofferle.com/list-of-free-powershell-ebooks/

List of Free Books – PowerShell

 https://cincypowershell.org/Resources/

Huge List of Free Books – Including PowerShell

http://thecloudengineer.blogspot.com/2011/12/sharepointbooks.html

Free Microsoft Books – Including PowerShell

http://thecloudengineer.blogspot.com/2011/12/sharepointbooks.html

Free eBooks – PowerShell

https://powershell.org/category/books

https://leanpub.com/u/devopscollective

Scripting Guy
http://blogs.technet.com/b/heyscriptingguy/

Windows PowerShell Survival Guide (11-2018)
https://social.technet.microsoft.com/wiki/contents/articles/183.windows-powershell-survival-guide.aspx

Free Training

PowerShell and Active Directory Essentials

https://info.varonis.com/thank-you/course/powershell

Latest Books Recommended by Students

PowerShell for Dummies
https://www.amazon.com/Windows-PowerShell-Dummies-Steve-Seguis/dp/0470371986/ref=sr_1_1

Learn Windows PowerShell in a Month of Lunches

https://www.amazon.com/Learn-Windows-PowerShell-Month-Lunches/dp/1617294160/ref=sr_1_1

Great list from Ashley McGlone
https://blogs.technet.microsoft.com/ashleymcglone/2016/04/01/powershell-video-training-from-microsoft/   

Examples

Find Duplicate Files With PowerShell (11-2018)
http://blog.codeassassin.com/2007/10/13/find-duplicate-files-with-powershell/

Tools

Idera PowerShell Plus is now free
Free tool to learn and master PowerShell fast

  • Learn PowerShell fast with the interactive learning center
  • Execute PowerShell quickly and accurately with a Windows UI console
  • Access, organize and share pre-loaded scripts from the QuickClick™ library
  • Code & Debug PowerShell 10X faster with the advanced script editor
https://www.idera.com/Free-Tools/PowerShell-Plus/

User Groups


Cincy OH -
http://powershellgroup.org/cincinnati.oh
Columbus OH - http://powershellgroup.org/central.oh

Older Books on PowerShell


General - Must Have!

Automating Microsoft Windows Server 2008 R2 with Windows PowerShell 2.0
Windows PowerShell 2.0 allows you to automate nearly any task for managing Windows Server, going from dozens of clicks to a single command, and repeated tasks to automated tasks. Using screen shots and helpful exercises, this book walks you through the many benefits of automating Windows Server with PowerShell 2.0, such as allowing for scalable, flexible, and rapid deployments and changes; increasing cost effectiveness; providing a timely return on IT investment; lowering labor headcount; creating secure computing environments; and establishing reliable enterprise infrastructures. In addition, real-world examples provide reinforced learning, aimed at ensuring that you work as efficiently and effectively as possible by automating both simple and complex administrative tasks with Powershell 2.0.
Details from
Wiley Publishing  Matt Hester http://blogs.technet.com/b/matthewms/

SharePoint - Must Have!

Automating SharePoint 2010 with Windows PowerShell 2.0
Imagine being able to perform a task that requires dozens of clicks with just a single command, or automate a series of identical tasks rather than repeat them. This book shows you how to do just that?and more?by using Windows PowerShell cmdlets with SharePoint 2010. Focused on everyday and frequently performed tasks, this invaluable guide provides PowerShell solutions for maintaining a SharePoint environment and explains how more than 500 cmdlets that come with SharePoint 2010 allows you to automate just about anything. Step-by-step instructions walk you through the necessary concepts and real-world examples enhance your learning process.
Details from
Amazon  Gary LaPoint http://blog.falchionconsulting.com/

Recommended by students ...

Windows PowerShell 2 For Dummies
Prepare for the future of Microsoft automation with this no-nonsense guide
Windows PowerShell 2 is the scripting language that enables automation within the Windows operating system. Packed with powerful new features, this latest version is complex, and Windows PowerShell 2 For Dummies is the perfect guide to help system administrators get up to speed.
Written by a Microsoft MVP with direct access to the program managers and developers, this book covers every new feature of Windows PowerShell 2 in a friendly, easy-to-follow format.
  • Windows PowerShell 2 is the updated scripting language that enables system administrators to automate Windows operating systems
  • System administrators with limited scripting experience will find this book helps them learn the fundamentals of Windows PowerShell 2 quickly and easily
  • Translates the jargon and complex syntax of Windows PowerShell 2
  • Covers script debugging improvements, the ability to invoke commands remotely, and the new user interface
  • Uses real-world applications to clarify the theory, fundamentals, and techniques of the scripting language
  • Written by a Microsoft MVP with direct access to the developers of Windows PowerShell 2
Windows PowerShell 2 For Dummies makes this tool easily accessible to administrators of every experience level.


Training Courses



10325A Automating Administration with Windows PowerShell 2.0

This course provides students with the knowledge and skills  to utilize Windows PowerShell for administering and automating administration of  Windows based servers. This course is intended for IT Professionals already  experienced in general Windows Server and Windows Client administration,  including Active Directory administration. No prior experience with any version  of Windows PowerShell, or any scripting language, is assumed. Topics covered include:

10961 Automating Administration with Windows PowerShell 3.0
Learn how with Windows PowerShell 3.0, you can remotely manage single or multiple Windows-based servers and automate day-to-day management and administration tasks.
This five day course provides students with the fundamental knowledge and skills to use Windows PowerShell 3.0 for administering and automating administration of Windows based servers. It focuses on primary Windows PowerShell command-line features and techniques, and will provide prerequisite skills supporting many different Microsoft products. This includes Windows Server, Windows Client, Exchange Server, SharePoint Server, SQL Server, System Center, and more. In keeping with that goal, this course will not focus on any one of those products, although Windows Server (which is the common platform for all of those) will serve as the example for the techniques being taught.

MVA


Basic - http://www.microsoftvirtualacademy.com/training-courses/getting-started-with-powershell-3-0-jump-start
Advanced - http://www.microsoftvirtualacademy.com/training-courses/advanced-tools-scripting-with-powershell-3-0-jump-start

Intermediate | Published: 30 July 2013  | Getting Started with Microsoft PowerShell
Instructor(s):
Jason Helmick and Jeffrey Snover


https://mva.microsoft.com/en-us/training-courses/getting-started-with-microsoft-powershell-8276?l=r54IrOWy_2304984382

Friday, December 22, 2017

SharePoint PowerShell 20339 Reference Guide

PowerShell SharePoint Code Examples

Here are examples inspired from the SharePoint Farm course 20339-1/20339-2

20339-1

Module 5: Installing and configuring SharePoint 2016

OOS Basic Setup

On OOS server …

New-OfficeWebAppsFarm -InternalURL “http://$env:COMPUTERNAME” –AllowHttp:$true –EditingEnabled:$true

On SharePoint server …

New-SPWOPIBinding -ServerName NYC-OOS –AllowHTTP:$true
Set-SPWOPIZone -Zone "internal-http"
$config = Get-SPSecurityTokenServiceConfig
$config.AllowOAuthOverHttp = $true
$config.Update()

Module 6 – Web Applications and Site Collections

Site Collection

New-SPContentDatabase -Name WSS_Content_TeamArchive -WebApplication http://teams.contoso.com

New-SPSite -Url "http://teams.contoso.com/team/archive" -ContentDatabase WSS_Content_TeamArchive -Name "Team Archive" -OwnerAlias CONTOSO\Administrator -Template "STS#0"


Module 7 – Service Applications

Managed Metadata

New-ADUser -SamAccountName SPSalesMMS -Name "SharePoint Sales MMS" -UserPrincipalName "SPSalesMMS@contoso.com" -AccountPassword (Read-host “enter password” -AsSecureString) -Path “OU=SharePoint,DC=Contoso,DC=com” -Enabled $true -PasswordNeverExpires $true -ChangePasswordAtLogon $false

New-SPManagedAccount

$AppPool = New-SPServiceApplicationPool -Name ContosoSalesMMSAppPool -Account SPSalesMMS@contoso.com

$MMS = New-SPMetadataServiceApplication -Name "Contoso Sales Managed Metadata" -ApplicationPool $AppPool -DatabaseName ContosoSalesMMS -HubUri http://sales.contoso.com

New-SPMetadataServiceApplicationProxy -Name "Contoso Sales Managed Metadata" -ServiceApplication $MMS -DefaultProxyGroup

Word Automation

New-ADUser -SamAccountName SPWordAutomation -Name "SP Word Automation" -UserPrincipalName "SPWordAutomation@contoso.com" -AccountPassword (Read-host “enter password” -AsSecureString) -Path “OU=SharePoint,DC=Contoso,DC=com” -Enabled $true -PasswordNeverExpires $true -ChangePasswordAtLogon $false

New-SPManagedAccount

$AppPool = New-SPServiceApplicationPool -Name ContosoWordAutomationAppPool -Account SPWordAutomation@contoso.com

$WCS = New-SPWordConversionServiceApplication -Name "Contoso Word Automation Service" -ApplicationPool $AppPool -DatabaseName ContosoWordAutomation

20339-2

Module 1

Farm configuration

New-SPConfigurationDatabase –DatabaseServer “ContosoDB” –DatabaseName “SharePoint_Config” –AdministrationContentDatabaseName “SharePoint Farm Content” –Passphrase (Read-Host –Prompt “Enter Farm PassPhrase” –AsSecureString) –FarmCredentials (Get-Credential –Message “Enter Farm Account Credential”) –LocalServerRole “Custom”

To create the ACL resources

Initialize-SPResourceSecurity

Install the required services

Install-SPService

Install the SharePoint features

Install-SPFeature -AllExistingFeatures

Create Central Administration

New-SPCentralAdministration -Port 50000 -WindowsAuthProvider NTLM

Install the Help Collection

Install-SPHelpCollection -All

Complete the installation of Central Administration

Install-SPApplicationContent

Create Default App Pool – Note that spservices account must be setup in AD

$appPoolCred = Get-Credential –Credential “contoso\spServices”

$saAppPoolAccount = New-SPManagedAccount -Credential $appPoolCred

$saAppPool = New-SPServiceApplicationPool -Name "SharePoint Web Services Default" -Account “contoso\spServices”

Search

$saAppPool = Get-SPServiceApplicationPool -Identity "SharePoint Web Services Default"

Start-SPEnterpriseSearchServiceInstance $env:COMPUTERNAME

Start-SPEnterpriseSearchQueryAndSiteSettingsServiceInstance $env:COMPUTERNAME

$searchServiceApp = New-SPEnterpriseSearchServiceApplication -Name “Search Service Application” -ApplicationPool $saAppPool -DatabaseServer “ContosoDB” -DatabaseName “Farm_SSA”

$searchProxy = New-SPEnterpriseSearchServiceApplicationProxy -Name “Search Service Application Proxy” -SearchApplication $searchServiceApp

[IO.Directory]::CreateDirectory(“c:\spSearchIndex”)

$clone = $searchServiceApp.ActiveTopology.Clone()

$searchServiceInstance = Get-SPEnterpriseSearchServiceInstance –Local

New-SPEnterpriseSearchAdminComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance;

New-SPEnterpriseSearchContentProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance;

New-SPEnterpriseSearchAnalyticsProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance;

New-SPEnterpriseSearchCrawlComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance;

New-SPEnterpriseSearchIndexComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance -RootDirectory “c:\spSearchIndex”;

New-SPEnterpriseSearchQueryProcessingComponent –SearchTopology $clone -SearchServiceInstance $searchServiceInstance

$clone.Activate()


User Profile Service

$saAppPool = Get-SPServiceApplicationPool -Identity "SharePoint Web Services Default"

$upa = New-SPProfileServiceApplication –Name “User Profile Service” -ApplicationPool $saAppPool -ProfileDBName “Farm_UPA_Profile” -ProfileSyncDBServer “ContosoDB” -SocialDBName “Farm_UPA_Social” -SocialDBServer “ContosoDB” -ProfileSyncDBName “Farm_UPA_Sync” -ProfileDBServer “ContosoDB”

New-SPProfileServiceApplicationProxy -Name " User Profile Service Proxy" -ServiceApplication $upa –DefaultProxyGroup

Get-SPServiceInstance | where-object {$_.TypeName -eq “User Profile Service”} | Start-SPServiceInstance

Module 2

Office 365 Prerequisites

Create Default App Pool – Note that spservices account must be setup in AD

$appPoolCred = Get-Credential –Credential “contoso\spServices”

$saAppPoolAccount = New-SPManagedAccount -Credential $appPoolCred

$saAppPool = New-SPServiceApplicationPool -Name "SharePoint Web Services Default" -Account “contoso\spServices”

App Management

$appPool = Get-SPServiceApplicationPool -Identity "SharePoint Web Services Default"

$amsa = New-SPAppManagementServiceApplication -Name “App Management Service” -DatabaseName “Farm_App_Management” –ApplicationPool $appPool

$amsaProxy = New-SPAppManagementServiceApplicationProxy -Name " App Management Service Proxy" -UseDefaultProxyGroup -ServiceApplication $amsa

Get-SPServiceInstance | Where-Object {$_.TypeName -like "*App Management Service*"} | Start-SPServiceInstance

Subscription Service

$appPool = Get-SPServiceApplicationPool -Identity "SharePoint Web Services Default"

$SSSA = New-SPSubscriptionSettingsServiceApplication -ApplicationPool $appPool -Name "Subscription Settings Service"

$sssaProxy = New-SPSubscriptionSettingsServiceApplicationProxy -ServiceApplication $SSSA

$spInstances = Get-SPServiceInstance; $spInstances.Where{$_.TypeName -like "*Subscription Settings Service*"} | Start-SPServiceInstance


Appendix

State Service

$serviceApp = New-SPStateServiceApplication -Name "StateService-App"

New-SPStateServiceDatabase -Name "SS-Database" -ServiceApplication $serviceApp

New-SPStateServiceApplicationProxy -Name "StateService-App" -ServiceApplication $serviceApp -DefaultProxyGroup

Tuesday, November 28, 2017

Windows 10 PowerShell Reference Guide

Course 20697-1 Implementing and Managing Windows 10

Module 3

Get-ExecutionPolicy

Set-ExecutionPolicy Unrestricted

Get-PrinterProperty –PrinterName “HP Photosmart 7520”
Note
: The property named Config:DuplexUnit is set to TRUE.

Set-PrinterProperty –PrinterName “HP Photosmart 7520” –PropertyName “Config:DuplexUnit” –Value FALSE
Note:
You must use all caps for the TRUE or FALSE values.

Get-PrinterProperty –PrinterName “HP Photosmart 7520”
Note:
The property named Config:DuplexUnit is now FALSE.

# *** Answer *** List Running Services in Green

$services = get-service

foreach ($service in $services) {

    if ($service.status –eq “Running”) {

        $color = “Green” }

    Else {

        $color = “Red” }

    write-host $service.Name “ – “ $service.Status –ForegroundColor $color

}

write-host “A total of “ $services.count “services were evaluated”

write-host “Script execution is complete” –ForegroundColor gray –BackgroundColor Black

Additional Notes Try …

$services | Group-Object -Property status

Module 4

Get-NetIPAddress

test-connection LON-DC1

Get-DnsClientCache

Clear-DnsClientCache

test-connection www

Get-DnsClientCache | fl

Resolve-Dnsname LON-DC1 | fl

Module 5

$MaxSize = (Get-PartitionSupportedSize –DriveLetter e).sizeMax
Resize-Partition –DriveLetter e –Size $MaxSize

Clear-Disk –Number 1 –RemoveData
Note: Delete all partitions from disk

Get-Disk | Where partitionstyle -eq 'raw' | Initialize-Disk -PartitionStyle MBR

Module 6

Install-WindowsFeature FS-SyncShareService
Note: After the feature installs, you will receive a warning message because Windows automatic updating is not enabled. You can ignore the warning.

Module 7

add-appxpackage \\lon-dc1\apps\app1.appx

Module 8

Sorry but no noteworthy PowerShell

Module 9

Invoke-Gpupdate –force

Module 10

Run Get-NetIPsecMainModeSA

Note: To examine the Main Mode Security Associations (SAs), at the Windows PowerShell prompt, type the following cmdlet, and then press Enter:
Get-NetIPsecMainModeSA

Run Get-NetIPsecQuickModeSA

Note: To examine the Quick Mode SAs, at the Windows PowerShell prompt, type the following cmdlet, and then press Enter:
Get-NetIPsecQuickModeSA

Module 11

Sorry but no noteworthy PowerShell

Module 12

Sorry but no noteworthy PowerShell