Get-WMIQualifierValue (revisited)

August 31, 2009

An updated version of my Get-WMIQualifierValue function. With this version you can query remote computers, specify the NameSpace of the class and also specify a property name to get just its values instead of all properties. Sample Usage: Get-WMIQualifierValue -Class Win32_LogicalDisk -ComputerName computer1 –Property StatusInfo   function Get-WMIQualifierValue {    param(       $Class=$(Throw “Parameter ‘Class’ cannot be empty”),       $ComputerName=".",       $NameSpace="ROOT\cimv2",       $Property="*"   )    if($PSVersionTable)   {      #PowerShell v2 detected      $wmi = Get-WmiObject meta_class -Filter "__Class = '$class'" -Amended  `     -ComputerName $ComputerName -Namespace $NameSpace   }    else   {      #PowerShell v1 detected     $wmi="\\$ComputerName\$($NameSpace):$class"      $wmi.psbase.options.useAmendedQualifiers=$true    }...
no comments

Mailbox Users Storage limit

August 30, 2009

My morning task today includes the following: get all mailboxes (Exchange 2003) larger than X megs where the associated user mailbox storage limits are overriding the settings of the Mailbox store. Storage limit information for user accounts is available in Active Directory Users and Computers on the user ‘Exchange General’ tab (click on ‘Storage Limits’ at the bottom). The ‘Storage Limits’ dialog box specifies the mailbox storage limits for warning or prohibiting a mailbox-enabled user from sending or receiving email. You can also use this dialog box to specify the number of days a deleted item is stored in the...

Force a VM to enter BIOS setup screen on next reboot

August 27, 2009

With the following PowerCLI filter you can force entry of virtual machine(s) into the BIOS setup screen next time the VM boots. You can configure the option in the VM options tab but with Set-VMBIOSSetup you can toggle the value programmatically: Note that setting a VM to enter BIOS mode is a one time action. Once the VM reboots and enters the BIOS screen the ‘Force BIOS Setup’ flag is unchecked so that subsequent boots proceed normally. filter Set-VMBIOSSetup {    param(         $Disable,         $PassThru    )    if($_ -is )     {        trap { throw $_...

New PowerShell videos

August 26, 2009

via @makovec Osama Sajid, PowerShell Program Manager, and Jeffrey Snover , Architect of PowerShell and Microsoft Distinguished Engineer,  discussing the foundations and vision for PowerShell as a critical component of Microsoft's platform management strategy.   Discussions with the Architect, Part 1 Discussions with the Architect, Part 2 Discussions with the Architect, Part 3   And two more with James Brundage, PowerShell Test Team SDE: PowerShell "How-To" : Variables, Types, and Operators PowerShell "How-To" : Arrays, Conditionals, Collections,...
no comments

Exchange 2007 SP2

Exchange 2007 SP2 was released yesterday (version 08.02.0176.002).  Below is some information regarding this release.  Exchange 2007 SP2 Download Microsoft Exchange Server 2007 Service Pack 2 (SP2) has been designed specifically to help meet the challenges of any business and the needs of all the different groups with a stake in the messaging system. Exchange Server 2007 SP2 is a mission-critical communications tool that enables employees to be more productive and access their information anywhere and anytime while providing a messaging system that enables rich, efficient access to e-mail, calendar items, voice mail, and contacts. For...
one comment

Active Directory PowerShell scripts pack

August 19, 2009

As announced yesterday, Idera, the company behind PowerShellPlus , has released the Active Directory scripts pack. The scripts pack, authored by Aleksandar Nikolic and myself, is a set of more than 30 PowerShell 1.0 ADSI functions and filters designed to help IT administrators automate everyday Active Directory management tasks. You can download the scripts pack HERE (registration needed). We hope you'll find it useful and if you have any questions or find any bugs you can report them to one of us. We are also available on Twitter (@alexandair and @ShayLevy).

Where do the functions come from?

August 17, 2009

With PowerShell 2.0 you can tell exactly where a function came from, whether the function was defined in your profile or dot-sourced in a script file. You may find it useful when you want to edit a function source code but don’t know or remember the function source file.  The one-liner below gets all functions from the built-in Function provider (contains a view of the functions stored in session state), filters just those that have a value in the ScriptBlock.File member and creates a new calculated property to display the location of the file the function came...
no comments

Exchange White Space

August 13, 2009

A common posting on PowerShell newsgroups and forums from Exchange administrators is how to parse event id 1221 from the Exchange server application log file. A typical event message would look like: Event Type:  Information Event Source: MSExchangeIS Mailbox Store Event Category: General  Event ID: 1221 Date:  10/01/2009 Time: 13:27:31 User:  N/A Computer: SERVER Description: The database "First Storage Group\Mailbox Store (SERVER)" has 7.2 megabytes of free space after online defragmentation has terminated. Usual solutions are based on regular expressions to process the message description and extract the name of the database(s) and the number of free megabytes. The bellow...