Tuesday, October 31, 2017
Thursday, October 19, 2017
Tuesday, August 29, 2017
Daily PowerShell
Get Installed Apps – thx Jeffrey Hicks – 5.0 5.1
get-package –providername msi,programs | sort name | select name,version
Whatif – thx Ed Wilson
get-process notepad | Stop-Process -WhatIf
https://blogs.technet.microsoft.com/heyscriptingguy/2011/11/21/make-a-simple-change-to-powershell-to-prevent-accidents/
File Rename
http://tweaks.com/windows/49459/batch-file-rename-with-windows-powershell/
Keyword Rename
http://blogs.technet.com/b/heyscriptingguy/archive/2013/11/22/use-powershell-to-rename-files-in-bulk.aspx
Automate DHCP
https://deploymentresearch.com/Research/Post/649/Automate-DHCP-Server-Configuration-via-PowerShell
Redirection
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_redirection?view=powershell-6
Tuesday, June 27, 2017
SharePoint Remote PowerShell
Yes it is possible, Please follow the steps below.
On the client machine (the management server):
Enable-WSManCredSSP -Role Client -DelegateComputer * -ForceSet-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentials -Name WSMan -Value WSMAN/*
Set-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Control\Lsa\Credssp\PolicyDefaults\AllowFreshCredentialsDomain -Name WSMan -Value WSMAN/*
On the SharePoint server:
Enable-PSRemoting -ForceEnable-WSManCredSSP -Role Server -Force
Afterwards it is possible to connect to the server using PowerShell from your management server, using the following cmdlet:
- Enter-PSSession SPServer -Authentication CredSSP -Credential DOMAIN\username
Add the SharePoint PowerShell SnapInAdd-PSSnapIn Microsoft.SharePoint.PowerShell
To see if it works, run a simple SharePoint cmdlet:
Get-SPSitePowerShell Remoting for SharePoint
Original Ref
https://blogs.msdn.microsoft.com/besidethepoint/2010/05/26/powershell-remoting-for-sharepoint/
Friday, June 16, 2017
Wednesday, June 7, 2017
Windows 10 Troubleshooting PowerShell Reference Guide
Course 10982 – Windows 10 Troubleshooting
Windows PowerShell Remoting
Invoke-Command –ComputerName LON-CL1 –ScriptBlock {Get-EventLog –log system}
$s = New-PSWorkflowSession –ComputerName LON-CL1
Enter-PSSession $s
Get-Command
Invoke-Command -Session $s -ScriptBlock {$c = Get-command}
Invoke-Command -Session $s -ScriptBlock {$c.count}
Invoke-Command -ComputerName LON-CL1, LON-CL3 -ScriptBlock {Get-Culture}
$s = New-PSWorkflowSession -ComputerName LON-CL1, LON-CL3
Invoke-Command -Session $s -ScriptBlock {$c = Get-command}
Invoke-Command -Session $s -ScriptBlock {$c.count}
ISE Remoting
Get-Service | Where-Object {$_.Status -eq “Running”}
Get-NetIPConfiguration
Restart-Computer -Force
Wednesday, May 3, 2017
PowerShell Library
Here are some site to help with you building your powershell library
GitHub
http://thecloudengineer.blogspot.com/2017/05/github.html