Trevor Sullivan's Tech Room

Minding the gap between administration and development

Archive for the ‘Uncategorized’ Category

Welcome to Chicago PowerShell User Group (CPUG)!

Posted by Trevor Sullivan on 2014/03/31


Hello and welcome to the Chicago PowerShell User Group (CPUG)! We are just getting started, and will be sending out details for our first meeting very soon!

In the meantime, please take this opportunity to connect with us on social media:

http://www.facebook.com/ChicagoPUG

http://www.twitter.com/ChitownPUG

https://www.linkedin.com/groups?gid=6658869

https://plus.google.com/u/1/107609488743705777763/posts

https://www.youtube.com/channel/UCmoMFKgORHGMG4JNQFbky2A

Advertisements

Posted in Uncategorized | Tagged: , , , | Leave a Comment »

Blog has moved! Same address.

Posted by Trevor Sullivan on 2012/02/08


Hey folks, notice something different at http://trevorsullivan.net? That’s right, my blog has officially moved from WordPress.org hosting to my own webhost!

If you’re subscribed to my blog on WordPress.org, please note that I will no longer be updating this one. I’m putting this post out there for any folks who might somehow be linked back to my WordPress.org blog, but for those going directly to http://trevorsullivan.net, you’re all set!

Thanks everyone for your continued support of my blog, and I hope to continue providing valuable content in the future!

Cheers,
Trevor Sullivan

Posted in Uncategorized | Leave a Comment »

PowerShell / ConfigMgr: Retrieve List of Client Names by Collection ID

Posted by Trevor Sullivan on 2011/11/01


Here’s a simple PowerShell script that you can use to retrieve a list of system names based off of a collection ID in Microsoft System Center Configuration Manager (SCCM / ConfigMgr) 2007. This has not been tested against collections that contain anything except system resources (computers objects in SCCM). Use at your own risk.

# Variables
$SiteCode = '123';
$SccmServer = 'sccmserver.mydomain.com';
$CollectionID = '12345678';

# Commands to retrieve client name list
$ClientList = Get-WmiObject -ComputerName $SccmServer `
    -Namespace "root\sms\site_$SiteCode" `
    -Class SMS_FullCollectionMembership `
    -Filter "CollectionID = '$CollectionID'" `
    -Property @('Name');
$ClientNames = $ClientList | Select-Object Name
$ClientNames

Posted in Uncategorized | Leave a Comment »

Links to Interesting Stuff

Posted by Trevor Sullivan on 2011/07/23


Updated on 2011-08-03

Here are some links to interesting blogs, software, and other random tidbits!

Read the rest of this entry »

Posted in Uncategorized | Tagged: , , , , , | Leave a Comment »

Office 2010 SP1: Silent Installation

Posted by Trevor Sullivan on 2011/06/30


Just the other day, Microsoft released Microsoft Office 2010 Service Pack 1 (SP1). To deploy the update via software distribution in System Center Configuration Manager (SCCM / ConfigMgr) 2007, or simply via script, you can use the following command line:

officesuite2010sp1-kb2460049-x86-fullfile-en-us.exe /quiet /norestart

As a best practice I always try to use any available logging parameters, however in this case, it didn’t work. I’ve had some challenges with other Microsoft update executables before, where they do not interpret the /log parameter correctly. This held true for the Internet Explorer 9 (IE9) installer as well.

image

Posted in Uncategorized | Tagged: , , , , , | Leave a Comment »

Introduction to Google Music Beta

Posted by Trevor Sullivan on 2011/05/11


The Introductory E-mail

Hello Motorola XOOM user,
We’d like to tell you about some changes to the Music player on your tablet. The latest app update now supports Music Beta, a new service from Google. As a Verizon Motorola XOOM user, you’ve been extended an early invitation to beta test this service.
Music Beta lets you store your personal music collection online and access it instantly without the hassle of wires or syncing.

· Enjoy your music anywhere — listen on any web browser, your Motorola XOOM, or any other device running Android 2.2 or higher.

· Save your favorite albums, artists, and playlists on your smartphone or tablet so you can keep listening even when you’re not connected.

· Create your own custom playlists or build them automatically from a single song.

To get started, click the button below and sign in with your Google ID: yourgoogleaccount@gmail.com

Get Started

Regards,
The Android Team

©2011 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043

Music Beta is available by invitation only in the U.S. and is free for a limited time. You have received this mandatory email service announcement to update you about important changes to your Android OS.

Read the rest of this entry »

Posted in Uncategorized | Tagged: , , , | Leave a Comment »

VMware Workstation Error: Acquiring Memory

Posted by Trevor Sullivan on 2011/05/09


I’ve been getting this error message a lot lately – does anyone have any idea what might cause it? I’ve usually got plenty of free memory when I get the message. I think it usually comes up after coming out of sleep and/or hibernate on my Windows 7 host OS.

image

This virtual machine has encountered a problem acquiring the memory needed for it to run. Would you like to suspend the virtual machine to prevent data loss or allow it to continue running?

Here is a screenshot of the memory configuration I’m using. I don’t want a lot of swapping going on, even though I’ve got a SSD – I’ve got 8GB of DDR3 in my laptop (Dell Latitude E6410), so I’d prefer to reserve all the RAM necessary for each VM.

image

Posted in Uncategorized | Leave a Comment »

Microsoft Community Contributor Award

Posted by Trevor Sullivan on 2011/03/01


Hey folks,

I was recently presented with a Microsoft Community Contributor award for participation in various online IT communities. Thanks to the folks at Microsoft for this!

I genuinely hope that my contributions to the community have been helpful to my readers, and to anyone else that has sought help on topics that I’ve written about. This is something that I’m truly passionate about, so it’s very rewarding for me to find that others have found my content to be helpful.

For the rest of you out there … if you aren’t already, I strongly suggest that you start a blog, and participate in discussion forums, mailing lists, Twitter, and other forms of social media. There are lots of people out there that need help in their technical field(s), and I’m sure that your knowledge and experience would be quite beneficial to them!

MCC Certificate

Cheers,
Trevor

Posted in Uncategorized | Tagged: , , | 3 Comments »

MSDN Ultimate Giveaway

Posted by Trevor Sullivan on 2011/01/25


Howdy folks,MSDN Logo

The other day, I helped out Rob Collie (@powerpivotpro) with something, and in return he provided me a MSDN Ultimate subscription. I don’t really have a need for this, however, as I have MSDN and Technet access already, so I’m giving it away to someone in the community. I can’t think of any super creative ways to choose a winner, so I’ll go with the old “pick a number” routine, somewhere between 1 and 2000. The number has some significance to me, though I wouldn’t expect anyone else to know why that is.

The main rule is that you can only submit one number per 24-hour interval, and if you post more than once in 24 hours, you will be disqualified. So go ahead … post your guesses in the comments section! Comments will be closed at 9 AM Central Time on Friday, January 28th, 2011. The person with the closest number at that time will win the subscription.

Posted in Uncategorized | 56 Comments »

PowerShell: WMI Eventing: Monitor CPU Speed

Posted by Trevor Sullivan on 2011/01/17


Introduction

I haven’t written any articles in a while, and the last major stuff I had been working with involved permanent WMI event subscriptions. I’ve been itching to write an article like this for a while now, but just had never gotten around to it. The purpose of this article is to describe how to use PowerShell with WMI eventing to monitor changes in CPU speed. Unlike early generation CPUs, modern CPUs have embedded technology that can dynamically change the processor’s clock speed dependent on load (eg. Intel SpeedStep or AMD’s Cool ‘n Quiet).

WMI Events

Thankfully, the Windows Management Instrumentation (WMI) service, built into Microsoft Windows, offers information about CPU speed, as well as For some background on temporary WMI event subscriptions with PowerShell, check out my article on WMI events. If you’re interested in permanent event subscriptions, that don’t depend on PowerShell running in the background, check out the PowerShell PowerEvents module.

Temporary: Monitoring CPU Speed

Using a temporary event subscription, we can easily monitor CPU speed by running the following PowerShell command:

Register-WmiEvent –Query "select * from __InstanceModificationEvent within 2 where TargetInstance ISA 'Win32_Processor' and TargetInstance.CurrentClockSpeed <> PreviousInstance.CurrentClockSpeed" –Action { Write-Host "Clock speed changed" }

This will simply echo the text “Clock speed changed,” at each occurrence, to the PowerShell console. If you want to do something more fancy, you can dynamically retrieve the new clock speed from the event object in the Action block.

Register-WmiEvent –Query "select * from __InstanceModificationEvent within 2 where TargetInstance ISA 'Win32_Processor' and TargetInstance.CurrentClockSpeed <> PreviousInstance.CurrentClockSpeed" –Action { Write-Host ("Clock speed changed to: " + $Event.SourceEventArgs.NewEvent.TargetInstance.CurrentClockSpeed + "Mhz") }

image

To make things even more dynamic, we can set up a PowerShell function to respond to our event, and then call that function in the event handler. By doing this, we now allow ourselves the flexibility of redefining the event handler function, without having to delete and re-create the event registration.

function ClockSpeedChanged($tEvent)
{
    Write-Host $tEvent.SourceEventArgs.NewEvent.TargetInstance.CurrentClockSpeed
}

Register-WmiEvent –Query "select * from __InstanceModificationEvent within 2 where TargetInstance ISA 'Win32_Processor' and TargetInstance.CurrentClockSpeed <> PreviousInstance.CurrentClockSpeed" –Action { ClockSpeedChanged $Event }

Permanent: Monitoring CPU Speed

So, now we’ve looked at how to create a temporary event registration to monitor CPU speed, but this depends on having PowerShell.exe running all the time. What if we wanted to perform some action in response to the CPU speed changing, but not have to worry about invoking, and leaving, a PowerShell session? This is where the power of WMI permanent event subscriptions comes into play. The PowerEvents module for PowerShell makes these quite easy to work with.

To recap on permanent event consumers, you need to create three objects:

  1. A filter that defines the events you’re catching / responding to
  2. A consumer which defines the action that will be taken in response to event instances
  3. A binding which binds a filter to a consumer, and enables the flow of events

First, we need to create a filter object. Filters in WMI are simply objects that define which events you want to capture and respond to. The actually action of responding is handled by a different object, called a consumer. Here’s what our filter would look like:

$Filter = New-WmiEventFilter –Name CPUClockSpeedChanged –Query "select * from __InstanceModificationEvent within 2 where TargetInstance ISA 'Win32_Processor' and TargetInstance.CurrentClockSpeed <> PreviousInstance.CurrentClockSpeed"

Next, we need to create a WMI event consumer. The consumer’s purpose is to respond to the events defined in our filter. Let’s say in this case, that we want to simply log the clock speed change to a text file:

$Consumer = New-WmiEventConsumer -Name CPUClockSpeedChanged -ConsumerType LogFile -FileName c:\temp\ClockSpeed.log -Text "Clock speed on %TargetInstance.SocketDesignation% changed to: %TargetInstance.CurrentClockSpeed%" 

Note: For the above example, make sure that the folder c:\temp exists, otherwise it will not be created. The consumer will only create the text file, if it does not exist.

Finally, we create a binding between the filter and the consumer:

New-WmiFilterToConsumerBinding -Filter $Filter -Consumer $Consumer

And that’s all there is to it! Now you should start seeing events get logged to c:\temp\ClockSpeed.log when your processor’s speed changes. If you’re on a laptop, try unplugging your AC adapter to invoke a speed change. If you’re on a desktop computer, try putting it under load by starting a bunch of programs, and then letting it settle. Assuming that you’ve not disabled power saving features in your BIOS, you should see the clock speeds changing, and getting logged.

image

Posted in Uncategorized | 4 Comments »