Tag: Powershell

[PS] Get-MyUpTime

Uptime of Windows boxes An cmdlet that is still missing in WMF5 as a default command. So I decided to write a function for it. This script determines the version of the WSMAN : 2.0 Windows 7,2008,2008R2 3.0 Windows 8 and higher Because the WSMAN v2.0 is not CIM capable only WMI Get-help Get-MyUpTime -Full […]


Well I needed to check if a specific port was reachable on a set of servers. This script is created for checking if a specific port is accessible or not. Parameters used : -server <server1,server2> : Provide server(s) to check -port <port> : Provide the port to check -list <list.csv> : Also a list of […]

PowerShell cheatsheets

On the internet I found some useful Powershell cheatsheets for you to use as reference. Here is a summary of cheatsheets I found so far PowerShell v4 Desired State Configuration Cheat Sheet by Microsoft Powershell 4 QuickRef by Microsoft PowerShell 3.0 Quick References Guide by PowerShell Magazine Mastering PowerShell by Dr. Tobias Weltner PowerShell 2.0 One Cmdlet […]

How to disable Windows Firewall with PowerShell in Windows Server 2012

When you build non-production lab environment internal  Windows Firewall could be source of connectivity errors. Usually I’m disabling Windows Firewall at all. From command prompt with PowerShell you can easily disable Firewall in Windows Server 2012: Command: Get-NetFirewallProfile | Set-NetFirewallProfile –Enabled False For your information: we can easy find Firewall-related PowerShell cmdlets with following request: […]

Add Files to ZIP

Add files to a zipfile using powershell. This script is creating a zip file from files in a specific folder. See also the other scripts I created. Usage : dir c:\demo\files*.* -Recurse | Copy-Zip c:\demo\myzip.zip       Other Scripts in this range New-zip Get-zip Extract-Zip Move-Zip Copy-Zip        

Uptime (Powershell)

Generate HTML file with uptime of servers. This script will generate an uptime File called uptime.html in the folder c:housekeeping This script is orginally created by Ed Wilson of Microsoft. I adjusted it so that the date and time stamp is added to the file. This way you can see the history if you schedule […]