Archive for December 2011

Working with multiple computers in Bash

Warning: count(): Parameter must be an array or an object that implements Countable in /home/fbsqlcom/public_html/ on line 31

Working with multiple computers in Powershell is absurdly easy using the Get-Content cmdlet to read computer names from a text file. It’s as easy as this… ?View Code POWERSHELL$a = Get-Content "C:\Scripts\Test.txt"   foreach ($i in $a) {$i + "`n" + "=========================="; Get-WMIObject Win32_BIOS -computername $i} As I’m doing more and more bash scripting I thought […]

List AD Organizational Units with Powershell

Here’s a quick Powershell one-liner to list all the Organizational Units, or OUs, in your Active Directory domain. Firstly you’ll probably need to load the ActiveDirectory module. This can be done at the Powershell prompt with the below command; ?View Code POWERSHELLImport-Module ActiveDirectory; Then we can use the Get-ADOrganizationalUnit cmdlet to retrieve a list of […]