Register : : Login
menuleft menuright
submenu
 
Oct 30

Written by: Don Jones
10/30/2007 9:41 AM  RssIcon

So I had someone ask if there was a simple way to define a set of services which would be a server's "baseline" set - and ask if there was a way to compare the currently-running services to that baseline. So I set out writing a script that would export current services to a file (easy enough in PowerShell, right? gsv > services.txt ), and the started using diff.exe...

Wait a sec. I shouldn't be doing this with text - PSH is about objects.

gsv | export-clixml c:\services.xml. That's the first step: Serialized objects in an XML file, representing the baseline services a machine should have. ACL the file against unwanted modifications.

Compare a server's current services to the baseline: diff (import-clixml c:\services.xml) (gsv) -prop name. Instance "difference list" and a very easy thing to run periodically. Maybe not something an auditor would accept, but certainly something you could use between audits to sort of check yourself, and make sure servers (or clients) hadn't picked up any new services recently.

The Diff cmdlet (Compare-Object, actually - Diff is an alias, of course) is really neat that way: It'll either compare entire objects (meaning it compares every property, and an object is only the "same" if ALL the properties match), or you can specify a comparison property (which is often the way to go).

Tags:
Categories:

2 comment(s) so far...


Re: My new favorite trick

Good point about objects! I recently had the same concept occur to me when looking for differences in the registry. My first attempt included exporting the keys to reg files and then reading them in to variables and comparing them. Then I thought "What the heck am I doing?" I replaced it with a gci against the registry and compared those objects.

Remember the Tootsie Roll commercials? "Whatever it is I think I see, becomes a PowerShell object to me!"

By kkidder on   11/1/2007 10:45 AM
Gravatar

Re: My new favorite trick

You just came Chanel Replicas across this really cool bumper sticker printing website that offers colorful, custom stickers at great prices. Unfortunately, Chanel Handbags you're just not sure that you want to put Chanel Bags a sticker of any kind on your Prada Handbags car. What reason would you have to do UGG so?

Trust us;Discount UGGs there are plenty of reasons to Prada Replicas smack one of these great stickers on your ride. The Prada Bags first of which is for a cause. UGGs Is there something that you feel particularly strong about? Are you completely against illegal Gucci Replicas immigration? Do you support organ and tissue donation? Are you a gun control advocate? Are you all about owning a firearm? Gucci Handbags These days there are plenty of things to be passionate UGG Boots on Sale about, from wars in foreign countries, to animal adoption. Gucci Bags People from your hometown to places on the opposite side of the country are promoting their causes with bumper sticker printing.UGG Boots

You don't want to let everyone know Louis Vuitton Replicas how you feel about the death penalty. That's okay! People are putting bumper stickers on their Christian Louboutin Shoes on Sale cars for other reasons too. Discount UGG Boots How about advertising? Do you own a business? Louis Vuitton Handbags Do you have a friend who owns a business? What about UGG Boots Outlet your parents? Individuals who own businesses are beginning to realize that it doesn't really make sense to pay for elaborate Louis Vuitton Bags and expensive advertising when you could just advertise on your own vehicle for essentially free. Bumper sticker advertising is not Discount UGG Boots only inexpensive, it's portable. If you're promoting your business from the back window of your car, then people from your house, to the mall, to the Coach Bags Outlet beach where you're planning to go this weekend will see your advertisement.UGG Boots on Sale Talk about Christian Louboutin Outlet reaching a mass market!

What about politics? Are you a Democrat who is against the new Republican congress and you're already dreaming Coach Handbags about campaigning for the future? Come up with a slogan and make it happen! Or, you can Cheap UGG Boots just promote the candidate with whom you most relate. If you're passionate about politics and you want to help your favorite candidate get the word out, a Coach Bags bumper sticker is definitely the way to go. Political stickers are almost as The North Face Outlet prevalent on the roadway as....cars! Christian Louboutin Shoes

Another type of sticker that's seen on Coach Outlet Online the roadways quite frequently is the sports team sticker. Show off your UGG Boots Volunteer Pride or your love for the Baltimore Orioles with a big, orange "T" or an "O" Discount Christian Louboutin Shoes that takes up half of the back window on your SUV. There are sports team stickers available everywhere online. If Cheap Christian Louboutin Shoes you aren't seeing one you love, a custom bumper sticker printing company can certainly produce one for you and it'll Coach Outlet be a bumper sticker you're proud to have on your car. The North Face Jackets

People also put stickers on North Face Jackets their cars for religious and spiritual reasons. From the Jesus fish, to the cross, people Coach Handbags Outlet are praising the Lord in the pew and on their bumper!

On a more somber note, people also use Coach Handbags bumper stickers to remember relatives and friends who have passed away.

If you're UGGs interested in ordering your Coach Bags Outlet own custom bumper sticker, you're making a great decision! Have a seat in front of your computer and visit a bumper sticker printing company's website. You can customize your own sticker Coach Bags or choose one from the thousands they have to offer. Don't just stop at one though! You can order stickers in bulk, which is especially handy if you're using your bumper stickers to promote your small business. Your Coach Outlet sticker order should ship The North Face Jacket within a couple of days and you'll be well on your way to showing off your cause, political affiliation, or favorite sports team! North Face Jacket

By swei on   10/13/2011 10:14 PM
 
Blogs
  
Search Blogs
  
Archives
  
   
footer Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2 footer
footer