PowerShell: Get-Unique; Group Addition Logging; OWA on SmartPhone


  • Prof. PowerShell: Get-Unique -- Same But Different
  • Redmond Radio: Microsoft Hires Yahoo Exec; Patch Tuesday; More
  • Forums: Group Addition Logging; OWA on SmartPhone; More
  • Special Offers: DB Security; Exchange and UC; VSLive! SF; More
-

SQL Server 2008: Maximize Performance & Reduce Costs with Dell and AMD
No registration required to watch this 3 minute video on how Dell™ customer, ServiceU, maximized their on-demand software business and decreased their power and cooling needs by 50%! All achieved by running Microsoft® SQL Server® 2008 on Dell servers powered by high efficiency AMD Opteron™ processors.

Watch the video today.

-

Prof. Powershell: Get-Unique -- Same But Different

I still prefer the Select-Object cmdlet, but Get-Unique has a way of weeding out the dupes that's, well, different.

By Jeffery Hicks

Last time I showed you how to get unique properties using Select-Object. Another tool for getting unique items is the Get-Unique cmdlet. It is possible to use this cmdlet to get the same information we got last time, but in a slightly more complicated fashion. Try this:

PS C:\> get-wmiobject win32_service | select startname | sort startname | get-unique -AsString

While this works, it is not as efficient as using Select-Object, and it's not something I would use for returning unique properties. Get-Unique is really designed to return unique objects from a collection. Here's a very simple illustration:

PS C:\> 6,1,3,3,2,5,5,5,5,6 | sort | get-unique

The array of integers is sorted (you should sort objects before you pipe them to Get-Unique for best results) and then piped to Get-Unique. Here's another example. It's not uncommon to have multiple processes with the same name and this expression weeds out the duplicates:

PS C:\> get-process | sort-object | select processname | get-unique -AsString

This will return a unique list of process names. The AsString parameter instructs Get-Unique to treat the incoming the data as string. The cmdlet's default behavior is to treat incoming data as an object as I showed in the earlier example. You can explicitly tell Get-Unique to treat data as an object using the OnType parameter:

PS C:\> 1,"a","b",3,4.5 | sort | get-unique -ontype
1
4.5
a

I've piped an array with a few different types of objects, sorted them and then used Get-Unique to return unique objects based on type.

Most cmdlets return objects of the same type so often Get-Unique isn't very useful. But if you have an array you've created with a variety of different object types, as I did in my last example, then Get-Unique can weed out the duplicate objects.

 Business Continuity Solutions for SQL Server 2005 on Dell PowerEdge Servers
Are you about to implement a business continuity strategy for your customer? This report from Dell gives you options and techniques available at the database layer. The Dell Engineering team explains the features Microsoft has built into the SQL Database engine and how they fit into a business continuity strategy.

-

Redmond Radio for the Week of Dec. 15
Hosted by Michael Domingo

Check out what's been happing in the week of IT and Microsoft news from the last week:

  • Microsoft Hires Former Yahoo Search Exec
  • Patch Tuesday Explodes with 28 Fixes
  • Open Source Thrives in the Enterprise
  • U.S. is Biggest Malware Culprit

Listen: http://mcpmag.com/webcasts/mcpradio/radio.asp?id=319

IT/CERT DISCUSSION FORUMS

Need troubleshooting help? Post your questions to MCPmag.com's IT/Certification Discussion Forums, where experts Andy Barkl and Andy Goodman, as well as a host of regular members, can offer solutions to your most difficult IT dilemmas.

The messages are always free to read, but registration (which is also free) is required to post. Go to http://mcpmag.com/forums/ and start posting.

Check out these recent posts:

Group Addition Logging: I was wondering if anyone is aware how to determine who added a specific user to a group? The short of it is that a new admin all the sudden ended up in a restricted group, but we're curious why he's there and who put him in there. Looked through some of the logs but didn't find anything. Wondering if anyone is familiar with a way to figure this out.

Comment here.

RDP to SBS 2008: When I RDP from a Vista PC to SBS 2008 I am prompted for password every time, even though I have selected to remember password. Can RDP to SBS 2003 with saved password. Vista PC is not a member of the domain. How can I configure so password is remembered?

Comment here.

OWA Not Working on Voyager: One of our VPs has a new Voyager cell phone from Verizon. The phone is pretty good at Internet stuff. When he uses OWA, however, there are problems. He connects to the site and the first Window comes up but it is wrong. The left menu is fine but when Inbox is clicked, the Right pane actually shows the HTML behind the page. Does anyone have any suggestions?

Comment here.

Port 3389 on XP SP2: I have a stand-alone PC and Port 3389 is not listening. I did not have any firewall on the PC. I even turn off the Windows Firewall.

Comment here.

Career Kickstart!!: I have recently gained the MCDST and will be sitting the CompTIA A+ exams. My problem is finding my first IT job -- although I have some certs and some skills I have no valid work experience, so can't get a job without experience. I find myself in the old catch-22 situation. Could anyone suggest the main points actually covered on a day-to-day basis for a technician so that I can practice and if anyone in Scotland reads this, some tips on where to find work would be a bonus. I need to kickstart my career soon.

-

 Take Advantage of this Special Holiday Offer
UltraBac Software presents a great gift for businesses. Enjoy a 25% discount on new orders of our award winning backup and disaster recovery software. In the market for a product that performs fast dissimilar hardware and virtual restores? Now is the time to buy! Use coupon code EOY25. Not applicable with any other discounts or offers. Expires Dec. 31, 2008.

Click here to order!

-

White Paper: "Database Security: Preventing Enterprise Data Leaks at the Source"
This IDC paper presents a pre-emptive approach to information protection and control (IPC). It discusses the growing internal threats, the impact of government regulations, and how enterprises must adopt database security best practices to protect sensitive customer data or company information.

Read it now in the Tech Library!

VSLive! February 24-26, 2009 in San Francisco
Save $200. Register by January 21.

For agenda, sessions, and more, visit: http://vslive.com/2009/sf/

Webcast: Unlock the Voice of Microsoft Exchange
Learn how to add voice capabilities to Exchange Server 2007 for a complete Unified Communications solution at this webcast. You will also explore the Unified Messaging features of Exchange Server 2007 and discover how an integrated VoIP and messaging solution will improve your business communications.

Sign up for this webcast!

Special from RCPmag.com: Virtualization -- The Next Real Thing
RCPmag.com contributor Fred Bayles outlines the benefits and challenges of virtualization in a way that can help you pitch the hot technology to customers.

Read it now in the Tech Library!

Discounts on Windows 2008/Books at Amazon.com
Not quite up to speed on Windows Server 2008, yet your company is looking to you for migration guidance? Get a jump on studying with new books at deep discount from Amazon.com. Check out Introducing Windows Server 2008 by Mitch Tulloch and the Microsoft Windows Server Team (Microsoft Press) and Windows Server 2008 Unleashed from Rand Morimoto et al. (Sams).

Also available: Windows Server 2008 Standard Edition with 5 CALs along with the Windows Server 2008 Resource Kit, both at less than retail.

-
-