Archive files using PowerShell

In this article I will show you how to archive files using PowerShell. Some of the administrative tasks like archiving old event logs require to use tool which will compress size of the folder. If we want to script those task is highly recommended to archiving files using PowerShell. PowerShell gives us possibility to archive files using .Net class called io.compression.zipfile. Basically script require only this class to be imported, …

PowerShell one-liner: Test connectivity

In this one-liner series I would like to show you several ways to test connectivity. There are lots of methods and basic commands to check network connection like ping, telnet, tracert etc. However it this post you will find out how to combine other PowerShell commands into one-liner script. Most common PowerShell command is Test-Connection which returns basically the same output as Ping. To use it for a bunch of …

Create-Table function – working with Data Tables in PowerShell

In this article, I will share with you one of the PowerShell modules I wrote for myself which I use every day for daily tasks and in my other scripts to simplify working with data and presenting them in the script or export to CSV, Excel, etc. The module is based on .NET Framework class “System.Data”. To create and work with a table containing a data you can use a …

PowerShell one-liner: Find BitLocker key

As you probably know PowerShell is a powerful tool and getting BitLocker key is one of its capabilities. In this article you will find out how to use one-liner script based on ActiveDirectory module to gather BitLocker key information. The easiest way is to use Get-BitLockerVolume command but we need to have BitLocker module installed: Get-ADObject is one of the AD module commands which helps to gets an Active Directory …

How to check SCOM Maintenance Mode history (version 2)?

Few months ago I added here simple script for checking SCOM maintenance mode history – link. I decided to adjust it a little bit and convert it into more advanced function. To get SCOM maintenance mode history remotely for some specific server basically we can run just this command: Usage: Function will create an object for each server and add it to $Results array. Object will contains the following properties: …

How to check password for WiFi networks?

In this article I want to show you how to check password for WiFi networks. In big companies there is often situation that some guest want to connect to network in office but nobody knows what is the password. WiFi network profile is always saved on your computer, so there is no problem to gahter all information about it. Script using netsh command to scan for all WiFi networks cached …

PowerShell module browser is now available!

On 5th of August Microsoft announce general avaialability of PowerShell module browser. It can be found under this address https://docs.microsoft.com/en-us/powershell/module/ Why it is so cool? If you wrote some PowerShell scripts in your life you know that sometimes is hard to find proper command for your needs. Now you don’t need to search google in order to find proper solution for you, everything what you need is in one place! …

PowerShell one-liner: Find AD user based on property

While working in Active Directory based environment you are often dealing with AD user accounts and probably using often Get-ADUser command. In this article I want to present several simple examples how to use it. Normally when we want to display user details we use -Identity : To list names of all available user properties we can use Get-Member command: The case will be a little bit different when we …

Use PowerShell function to get reboot details remotely

In this article you will find useful function which will help you get reboot details from remote machines. Script use Get-WinEvent command to find reboot related log entries. Additionally it also check last reboot time and calculate it’s up time. Script will collect following information: – BootUpTime – UpTime – RebootDate – UserName – Action – Process – Reason Write-Host command has been used for displaying “UpTime” and “BootUpTime” values …

Check when user was added to AD group

Today I will show you script to check when user was added to AD group. Script is using functionality of repadmin tool to check when users were modified inside the group. Showobjmeta displays the replication metadata for a specified object stored in Active Directory, so it can be used not only for group membership checking. You can find other functionalities of this tool on TechNet site. Output from repadmin tool …