Category: Powershell (Tutorial)

Get-Hotfix Powershell to find Patches installed on Specific Date.

Get-Hotfix Powershell Command to find Patches installed on Specific Date.

There was a request to verify the list of servers if those were patched recently. I succeeded in verifying the servers using the below powershell command.

get-hotfix -CN “Server1″,”Server2″,”Server3” -CRED “Domain\username” | select csname,hotfixid,installedon,description,installedby | where {$_.installedon -gt “8/1/2017”} | Sort-Object csname | format-table

Thanks,
WintelAdmin

Filed under: Powershell (Tutorial), Windows(2003/2008/2012)Tagged with: , , , , ,

PART 1: Getting started with PowerShell.

Powershell Tutorial – Part 1

To begin PowerShell you need to start using the console. Forget the command prompt and move on to PowerShell. Powershell is a combination of DOS and Unix shell with an update. It accepts both Windows and Unix commands with many new features. Powershell scripting is to do more in less time.

Powershell can be used in two ways – the Console and the integrated Scripted Environment (ISE). ISE is preferred for scripting and console for command execution.

First thing you need to know is how to start PowerShell, simplest is just by typing powershell. Other way to star powershell is double click .ps1 file.

cmdlets (commandlets) are self contained scripts that required to be called like a command. For example, get-service (which list all services and its status), get-command (it lists all comdlets that can be used). multiple cmdlets can be used to make some tasks very simple thats called command pipelining. One comand can take input from another command. and process it.

The command for getting help is get-help and it accepts varietly of arguments.
get-help

Example:
get-help services
This will search and list all command and help files relating to services.

get-help start-service -online
Using the parameter “online” you can open the browser to view the help on TechNet.

get-help start-service -examples
This will list the example for start-services.

 

Thanks,

WintelAdmin

Filed under: Powershell (Tutorial)Tagged with: , , , , ,

PowerShell for Administrators – Coming Soon

PowerShell essentials for administrators coming soon on WintelAdmin to help with your daily operations.

Stay Tuned…..

WintelAdmin.com

Filed under: Powershell (Tutorial)Tagged with: , , , , , , , , , , , , , , , , ,