OU

Get computer objects from OUs

In this short article, I would like to share the PowerShell script for getting computer objects from parent Organizational Units (OUs). Organizational Unit (OU) is a container in the Active Directory domain that can contain different objects from the same AD domain: other containers, groups, user and computer accounts. Get computer objects Recently I was asked to prepare a report in Excel and count objects in each OU. To do …

occurrence

PowerShell Tip of the Week: Count occurrence of each element

How to count the occurrence of each element. Today I would like to share a few examples describing how it can be done. To do this we can use Group-Object cmdlet. Count the occurrence The Group-Object cmdlet displays objects in groups based on the value of a specified property. Group-Objectreturns a table with one row for each property value and a column that displays the number of items with that value. Example: Get …

Get Azure resources details using PowerShell

Hello scripters, Today I want to share with you my script for gathering Azure resources details. Script is connecting to Azure subscription and take all resources base on resource groups names provided as input parameter. In the result table with Azure resources details such as Resource Group, Resource Name and Resource Type will be created and expoted to CSV file. You can define folder to which CSV file should be …

Quick Test-NetConnection

PowerShell Tip of the Week: Quick connection test on remote machines

I’m often asked how to quickly test connectivity on remote machines. In this short article from PowerShell tip of the week series, I wanted to share such script with you. I hope that it can be useful for some of you. Quick connection test Basically, the script is based on Test-NetConnection command. I running it inside single Invoke-Command script block. The Invoke-Command cmdlet runs commands on a local or remote computer and …

netstat traceroute files

Get netstat and traceroute results from remote servers

Today you will find out how to get netstat and traceroute results from remote machines. I often had a situation where I was asked to do some basic checks from a network perspective. It’s easy once you already have a script for that. Netstat and traceroute There are multiple ways to do network checks. I guess that most of you are probably familiar with commands like ipconfig, tracert, netstat and …

Run SCCM client actions on remote machines using PowerShell script

It probably takes some time to run SCCM client actions on all machines in your environment. It’s getting more complicated when you have only server core machines. This is why I decided to write a PowerShell function for that. SCCM client actions Most common client schedule actions Hardware Inventory Cycle Software Inventory Cycle Discovery Data Collection Cycle (Send DDR) Machine Policy Retrieval & Evaluation Cycle Software Updates Deployment Evaluation Cycle …

Get pending updates in Software Center on remote machines

How to get updates from the Software Center on server core machines? Recently I had to investigate some patching problems on multiple servers. As I’m working mostly on GUI-less operating systems it was time-consuming to display that from the command prompt. I decided to create a script to generate such a report. Software Center updates If you want to open Software Center from the command prompt you can navigate to …

PowerShell Tip of the Week: Get AD sites with no subnets assigned

In this short article, you will find out how to get all AD sites where there are no subnets. Recently I had to find all the sites in my environment that are not used anymore and have no subnets assigned. To do this I wrote a simple script that I wanted to share with you. Active Directory sites To gather information about subnets we can use commands from the ActiveDirectory …

Get SCOM agents settings remotely using PowerShell

In one of the previous articles, I was describing how to get SCOM agent setting from the OS level. This time I would like to share a more advanced script. SCOM agents settings To find all SCOM agent details on a local machine we have to navigate to the registry. Check how to find SCOM agent version – article. At the end of the article you will find PowerShell script …