How to test a registry key in PowerShell

By , 31 august, 2008 23:25

In PowerShell you easley can test a registry key with the cmdlet Get-ItemProperty.

PS C:\> $key = $(Get-ItemProperty «HKLM:\SOFTWARE\LJS»).LarsJostein -eq «Silihagen»
PS C:\> $key
True

PowerShell example where  you test the installed Operations Manager Console version:
function OpsMgrVer
{
return $ver = $(Get-ItemProperty «HKLM:\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Setup»).CurrentVersion
}
function TestVersion
{
$nr = OpsMgrVer
if (OpsMgrVer -ge «6.0.6270.0″)
{ Write-Host «SCOM 2007 SP1 is installed. ServerVersion: $nr» } else { Write-Host «SCOM 2007 SP1 is not installed. ServerVersion: $nr» }
}

Post to Twitter Post to Facebook Post to LinkedIn

MCP SCCM 2007

By , 31 august, 2008 23:02

Friday 29th August I was glad for passing the exam 70-401 TS: Microsoft System Center Configuration Manager 2007, Configuring . In June I took the exam 70-400 TS: Microsoft System Center Operations Manager 2007, Configuring. So now I am waiting for the 70-403 exam to become MCITP in System Center, but I’m not sure when Microsoft will release the 70-402 exam.

Links:

Operations Manager: http://www.microsoft.com/learning/en/us/exams/70-400.mspx

Configuration Manager: http://www.microsoft.com/learning/en/us/exams/70-401.mspx

Post to Twitter Post to Facebook Post to LinkedIn

Cmdlet verb names

By , 31 august, 2008 22:36

Last week I worked with a PowerShell script where I did a big blunder!   I had created a function with the name “Start” and I did not find the reason of why my script failed before at least one hour. Start is one of the PowerShell reserved verbs so stay away from them in your function names or variables!

List of reserved PowerShell verbs at Microsoft: http://msdn.microsoft.com/en-us/library/ms714428.aspx

Or you can of course list the verbs with PowerShell:
$verbs = [System.Reflection.Assembly]::LoadWithPartialName(«System.Management.Automation»)
$verbs.GetTypes() | where {$_.Name -match «Verbs»} | foreach {$_.GetFields() | foreach {$_.Name}} | sort

Post to Twitter Post to Facebook Post to LinkedIn

System Center Product Timeline

By , 25 august, 2008 21:24

DirectionsonMicrosoft.com has written and created a nice illustration of the System Center Product Timeline.  
Link: http://www.directionsonmicrosoft.com/sample/DOMIS/update/2008/06jun/0608smpr_illo.htm

Post to Twitter Post to Facebook Post to LinkedIn

VMware have now released the full version of VMware Infrastructure Toolkit 1.0

By , 19 august, 2008 10:05

With the VI toolkit you can automate standard management tasks like cloning, moving, starting or stopping virtual machines and hosts true PowerShell. VI Toolkit takses advantage of the exisiting VMware Infrastructure SDK and translate it into a PowerShell interface.

http://www.vmware.com/sdk/vitk_win/index.html?src=EM_0803_VMW_OTHER_VITOOLKIT_DOWNLOAD

After you have installed PowerShell and VI Toolkit on your computer, you have to add the VI Toolkit powershell snapin:

# List the snappins you allready have installed:
PS C:\> get-pssnapin

# List registered snapins:
PS C:\> Get-PSSnapin -Registered

# Add the VMware.VimAutomation.Core snappin:
PS C:\> Add-PSSnapin VMware.VimAutomation.Core

# Connect to your Virtual Center server:
PS C:\> Get-VIServer x.x.x.x -User admin -Password xxxxxxx

# List virtual maschines who are powered on:
PS C:\> get-vm | Where-Object {$_.powerstate -eq ‘PoweredOn’}

Post to Twitter Post to Facebook Post to LinkedIn

Great PowerShell book

By , 13 august, 2008 09:02

For those of you who wish to learn or read more about PowerShell I will  recommend the book PowerShell in Action by Bruce Payette. Bruce Payette is  one of the co-designers of the PowerShell language. The book contents great examples and is easy readability.

PowerShell in Action

  

 

http://manning.com/payette/

 

 

 

Post to Twitter Post to Facebook Post to LinkedIn

VMware ESX Server 3.0.3 is available for download

By , 12 august, 2008 08:18

Release higlights:

  • Support for Quad-Core AMD Opteron 8300 and 2300 series processor families (codename Barcelona)
  • Support for Dual-Core Intel Xeon 5200 series processors (codename Wolfdale)
  • Enhanced patch management
  • Support for new / updated guest OS; Windows 2003 R2 Data Center Edition and Red Hat Enterprise 5.1
  • Update for service console from RHEL3 U8 to RHEL3 U9

http://www.vmware.com/support/vi3/doc/releasenotes_esx303.html#resolvedissues

Post to Twitter Post to Facebook Post to LinkedIn

Long PowerShell statements

By , 11 august, 2008 20:36

PowerShell statements can be large, and it’s not always practial to enter it on a single line in the console or in a script. In PowerShell, as wel as in most other programming lanuages or consoles it is posible to write statements over several lines.

When the console determines a line is incomplete, powershell continues to the next line processing the statement. For example, where the first line in a statement ends with the pipe operator, as in:

Long statement example:

18# Get-Process | Where {$_.ProcessName -eq ‘msiexec’} | Format-table ID, CPU, Name
Id CPU Name
– — —-
4808 0,046875 msiexec

Same statemen over three lines:

19# Get-Process |
>> Where {$_.ProcessName -eq ‘msiexec’} |
>> Format-table ID, CPU, Name
>>
Id CPU Name
– — —-
4808 0,046875 msiexec

In a PS1 script you can use the ` tag:

$excel = New-Object -comobject `
excel.application

Post to Twitter Post to Facebook Post to LinkedIn

The Face of Windows Server 2008

By , 11 august, 2008 20:29

Post to Twitter Post to Facebook Post to LinkedIn

Some great links for virtualization security best practices

By , 11 august, 2008 20:14

Guidance on best practices of VMware Virtual Infrastructure:
http://www.vmware.com/overview/security/best_practices.html

Security implications of the Virtual Data Center:
http://www.malanmurphy.com/Security_Implications_of_the_Virtual.pdf

Security technical implementation guide (Department Of Defense USA)
http://iase.disa.mil/stigs/stig/esx_server_stig_v1r1_final.pdf

I would also recommend to read the whitepaper VMware VI Architecture Overview:
http://www.vmware.com/pdf/vi_architecture_wp.pdf

Post to Twitter Post to Facebook Post to LinkedIn

Panorama Theme by Themocracy