new-blogentry -topic "Powershell and More"

My observations about Powershell, Windows, System Center and life.

Recent comments

Tags

Don't show

    Disclaimer

    Any opinions expressed herein are completely accidental. But if one happens to slip in, it represents my own personal opinion and NO one elses. I'm also not concerned with changing anyone elses opinion, so any rants about anything presented on this site are likely to be 100% ignored.

    © Copyright 2010

    Operations Manager Command Shell

    I run Windows 2008 64bit on my main workstation, so when I installed the Operations Manager Console and Command Shell for remote administration of OpsMgr, it only added the snapin for 64bit Powershell. However, I generally use Powershell Plus (which is 32bit only), and thus couldn’t access the Operations Manager Command Shell stuff from my normal environment.

    InstallUtil didn’t work against Microsoft.EnterpriseManagement.OperationsManager.ClientShell.dll, so I resigned myself to using the native powershell console.

    Until now. By using Add-Module from Powershell v2 CTP2, I was able to load the DLL and provide access to the cmdlets for Operations Manager. I’m NOT a developer and have no idea what’s going on underneath. So here’s the script I use to initialize the Operations Manager Command Shell in my 32bit Powershell Plus environment. I’ll leave it to someone like Joel to explain just WHY this works! It’s also possible this doesn’t provide 100% functionality, but so far everything I’ve tried has worked.

    param ( $OpsmgrPath = "C:\Program Files\System Center Operations Manager 2007\", $ManagementServer = "", $SavePrompt = $true ) if (Test-Path $opsmgrpath) { if ($SavePrompt) { $pr = gc function:prompt } $shelldll = "Microsoft.EnterpriseManagement.OperationsManager.ClientShell.dll" $functionpath = "Microsoft.EnterpriseManagement.OperationsManager.ClientShell.Functions.ps1" Add-Module $(Join-Path $opsmgrpath $shelldll) &$(Join-Path $opsmgrpath $functionpath) Start-OperationsManagerClientShell -ManagementServerName: $ManagementServer -PersistConnection: $true -Interactive: $true; if ($SavePrompt) { $pr | sc function:prompt } } else { Write-Host -foregroundcolor yellow "Unable to find the Operations Manager Install Directory. Pass the correct Install Direcotry with the -OpsmgrPath argument." }

    Posted by gaurhoth on Sunday, September 28, 2008 12:32 PM
    E-mail | Permalink | Comments (36) | Post RSSRSS comment feed

    Micro-Rant: SCOM's Criteria Expression Syntax

    In SCOM (System Center Operations Manager 2007) related powershell cmdlets, there is a parameter to specify a search criteria. My rant involves the fact that the syntax for it doesn’t match Powershell’s comparison operators at all :(

    I’m sure there are very good reasons (the underlying SDK was probably designed long before powershell support was decided on), but it’s still frustrating to learn a different syntax for each tool (such as WMI, which has it’s own syntax. Admittedly, WMI predates Powershell by a LONG time.

    Ah well.

     

    * Apologies if this is a duplicate in anyone’s RSS feed. An issue with my web host provider caused the removal of my site's content. My latest backup was prior to this post.


    Posted by gaurhoth on Thursday, July 24, 2008 3:49 PM
    E-mail | Permalink | Comments (39) | Post RSSRSS comment feed

    Windows 2008 or else

    Maybe it's senility, but I sure don't remember MS pushing a new Server OS quite as hard as they seem to be with Windows 2008. System Center Virtual Machine Manager 2008 Beta and the new ISA portion of Forefront Stirling both require Windows 2008. Given that Windows 2008 is brand spanking new, this surprises me. I can remember using Windows 2000 for several years after 2003's release and most everything worked just fine with it.

    Ah well. I'm particularly saddened by SCVMM 2008's reluctance to embrace Server 2003. I understand part of it's mission is to support Hyper-V but that's a small piece of the entire VMM package.

     

    gaurhoth


    Posted by gaurhoth on Tuesday, May 06, 2008 11:38 AM
    E-mail | Permalink | Comments (16) | Post RSSRSS comment feed