Use PowerShell function to check if servers are accessible

Recently I had to check quickly if all of managed servers are accessible. As SCOM monitoring wasn’t set yet in my environment I had to create simple script to do that. One of the easiest method to check if server is up is to test availability of network share. Test-Path There are many ways to check if server is accessible like for example using ping, checking some specific service but …

Generate patch report from WSUS

Hey scripters, today I want to share with you my script for generate patch report from WSUS. On our blog we already show you how to check if specific patch is installed on your machine. But what in case that we want to generate report for servers\workstations which are managed by WSUS? There are many of other tools which can better manage patch management process, however some environments still need …

PowerShell one-liner: Get eventlog

Use PowerShell one-liner to get eventlog details quickly and easily. In this article you will find several useful examples which will help you in daily operational tasks. Get-Eventlog The Get-EventLog cmdlet actually serves two purposes: it enables you to manage your event logs, and it also enables you to get at the events contained within those event logs. To get lognames list we just have to use parameter -list : …

Create custom Azure AD B2B invitation

Today I want to share with you my script for creating custom Azure AD B2B invitation. What is Azure AD B2B? Azure AD B2B (business-to-business) allows organization which are using Azure Active Directory to cooperate with other organizations in secure way. Companies which are using Azure AD can proivde access to applications, resources etc. to their customers and have full control on security. Script which I prepared allows to send …

Configure PowerShell remoting for Azure VMs

Hey scripters, in todays article I want to show you how to configure PowerShell remoting for Azure VMs. Recently I wanted to run the script which will check installed software on all of my Azure VMs. Unfortunately I received following error from each of the machine. I thought that it is only the problem with firewall configuration on Azure VM, so I configure additional rulles to allow connection on port …

Get Application Pools using PowerShell function

Getting Application Pools status remotely is relatively easy. Adding them into a data table and then sending it in html formatted report is more complex process. Today I would like to show how to do this by breaking apart one of my functions. In one of the previous articles I described how to get status of application pools and additionally reset IIS if needed – link. This time we just …

Get Office 365 users licenses

Hey scripters, today I want to show you how in easy way get Office 365 users licenses. Script which I’ve prepared connect to Office 365 tenant and in first step check all licenses. Once it is done all users which have attribute isLicensed flagged as True are gathered. In next steps script is filtering users base on license name and export those information to CSV files. Note: Remember to install …

Generating random password using PowerShell

Not so long time ago, I had to create a bunch of fake users for some testing purposes. Every user had to have a password set. I knew, that I could use one password for all users, but I wanted to try generating unique passwords for them. I knew we have Get-Random in PowerShell, but how to use it to generate a “random” password?

Use Set-ADUser command to update user attributes

How to use Set-ADUser command? Updating user properties manually can be time consuming. This is why its good to have a script for bulk modifications. One of the ActiveDirectory module command is called Set-ADUser and it allows us to modify user properties. Below you can find script for adding or updating AD user mobile phone. To update phone number for one specific user we can just run the following command: …

PowerShell in Azure Cloud Shell now available!

On Ignite conference Microsoft announced public preview of PowerShell in Azure Cloud Shell! It’s really good news for Microsoft Azure Cloud and PowerShell enthusiasts 🙂 Till now only Bash was available in Cloud Shell, now end user can choose what is best for him. Probably some of you may ask “What is the difference between using PowerShell with Azure module on desktop and via Cloud Shell?” Here are some points …