Tag: PowerShell
Comparing files via checksum with Powershell
August 1st, 2009, 2 Comments
Have you ever had to push Gigabytes of files accross the network, knowing that the same version of many of those files already existed on the other end, but you didn’t have an immediate way of checking which ones were already in place?
If so, we can mitigate that problem somewhat with checksums.
Below is a simple [...]
Disabling Admin UAC with Powershell
July 31st, 2009, No Comments
Well apparently some people don’t like User Account Control getting in the way of the Administrator account(s), and so they need a way to disable this annoying
behavior. Here’s a quick function I threw together today at the request of a friend, that will do just that. Please excuse the formatting…
function Set-AdminUAC([int] $value = 0) {
$computers = [...]
Checking for pending reboots with PowerShell
July 29th, 2009, 3 Comments
I found out the hard way a few days ago that our old, tried-and-true method of determining if there were pending reboots had changed with the latest Windows Server OS, Server 2008. In the old days (last year), we could check for pending reboots on Windows 2003 simply by looking at the ‘PendingFileRenameOperations’ property in [...]
Base64 encoding and decoding with PowerShell
July 19th, 2009, No Comments
A few days ago, I needed to perfom some simple obfuscation on a string. Since I had used Base-64 encoding for this purpose in the past, I needed to find a quick way to perform Base-64 encoding and decoding with PowerShell. Surprisingly, I couldn’t find a blog post or tutorial detailing a simple, straight-forward way [...]
Verifying valid email addresses with PowerShell…sort of…
July 11th, 2009, No Comments
I was recently asked to whip up a quick function that would verify email addresses from a list, and extract the ones that were valid and unique. Apparently, someone had run a report which should have resulted in a list of email addresses, sent it to the requester, and then left for the day. Unfortunately, [...]
Getting a list of installed Windows Components remotely with PowerShell
July 11th, 2009, No Comments
Here we go again! Last time, we covered how to get a relatively accurate list of installed programs with PowerShell. This time around, we’re going to show you how to get a list of Windows Components and their installation states with PowerShell. Let’s begin by showing you the finished product, as a function. Then, [...]
Getting a list of installed programs remotely with PowerShell (part 2)
December 14th, 2008, 5 Comments
As an alternative to using WMI, another way of retrieving a list of installed programs on a remote machine is to use the [Microsoft.Win32.RegistryKey] class.
function Get-InstalledPrograms($computer = ‘.’) {
$programs_installed = @{};
$error_action = ‘Stop’;
$reg_uninstall_paths = @(’Software\Microsoft\Windows’`
+ ‘\CurrentVersion\Uninstall’);
$reg_uninstall_paths += @(’Software\Wow6432Node\Microsoft’`
+ ‘\Windows\CurrentVersion\Uninstall’);
$pattern_valid_name = ‘^{[\w\W}]+\Z’;
trap { ;
continue } $wmi_output = @(get-wmiobject -class ‘Win32_Product’`
-computer $computer -ErrorAction $error_action);
if ($?) [...]
Getting a list of installed programs remotely with PowerShell (part 1)
November 28th, 2008, 3 Comments
Something that I’ve found useful, and has been often needed, is a way to get an accurate list of the programs installed on a remote machine. Initially, I would have thought that something so simple would have had it’s own cmdlet. It appears that I was mistaken. In an effort to prevent people from reinventing [...]
Migrating “Auto Accept” accounts from Exchange 2003 to Exchange 2007
December 20th, 2007, No Comments
We had some auto accept accounts that we set up with the 2003 agent that needed to be migrated to 2007. The way it was done:
1. I first removed the auto accept feature from the accounts to be migrated.
You must run a similar command that you registered with to unregister the mailbox…
RegisterMailbox.vbs /u /m:conference@yourcompany.internal
2. Then [...]
Add Multiple Users to Active Sync Policy “Exchange 2007″
December 20th, 2007, 4 Comments
After I migrated to Exchange 2007 I wanted to make sure my Active Sync policies were still there… They were not. I had to recreate them and the “GUI” way to do it was to go to each user and apply it that way. If you have more than say 10 users that is not [...]




