Skip to main content

Posts

Powershell – Another windows registry “module” with a little remote trick

Well it is time for another pure powershell post. This time I have been working with the registry. Feels like I have been living in different hives no matter what area I have been working in in the last 15 years. It has become rather pleasant if I could say so compared to the old VBSCRIPT days and before that reg.exe and ini files. Fist a little history and a discussion. You have a couple of options in regards to reading and/or editing settings in the registry Use the built-in PS-drives (gives you access to HKLM and HKCU) Codeplex module (search on codeplex or in your favorite searchengine – most used and referenced: http://psrr.codeplex.com/ ) Use the .Net class (normally [microsoft.win32.registrykey]). This gives you access to all the hives in the registry Powershell Desired State Configuration (There is a built-in resource to access the registry) WMI/CIM Which one you pick depends upon your current needs and what you want to accomplish. If you are also in a hu...

More Powershell DSC resources released

  The PowerShell Blog has released information about the second wave of resources to use in your Desired State Configuration. Looks like the guys have been really busy  and released some neat resources for us. Here is the list: Resource Description Module Name Link xADDomain Create and manage an Active Directory Domain xActiveDirectory click here xADDomainController Create and manage an AD Domain Controller xActiveDirectory click here xADUser Create and manage an AD User xActiveDirectory click here xWaitForADDomain Pause configuration implementation until the AD Domain is available.  Used for cross machine synchronization. xActiveDirectory click here xSqlServerInstall Create and manage a SQL Server Installation. xSqlps click here xSqlHAService Create and manage a SQL High Availability Service. xSqlps click here xSqlHAEndpoint Create and manage the endpoint used to access a SQL High Availability Group. xSqlps ...

Bulk Import Operations Manager 2012 Management Packs

Read a post today from Joe Thompson regarding this subject. Really liked the idea with bulk import of Management Packs. The scenario is like this: You have a folder or several folders with a bunch of Management Packs and you want to install only those that is currently not installed. I hope Mr Thompson does not mind me changing his Powershell script and "improving" it slightly if you ask me :-) [cmdletbinding()] Param ( [ValidateScript({Test-Path $_ -PathType 'Container'})] [string] $ManagementPacksPath ) Write-Verbose "Creating an array of file names from the path $ManagementPacksPath" $MPfiles = (Get-Item -Path "$ManagementPacksPath\*" -Include *.mp*).Name [int]$CountMatching = 0 $InstallList = @() foreach($MP in $MPfiles) { Write-Verbose "Getting MP properties using SCOM cmdlet and the parameter 'ManagementPackFile'" $MPproperties = Get-SCOMManagementPack -ManagementPackFile "$ManagementPacksPath\...

Monitoring Orchestrator runbook events from Operations Manager

Today I will follow up on my colleague’s post Mr ITblog (Knut Huglen) about monitoring Orchestrator Runbook events .  He has build a nice double up SNMP loopback feature that does self monitoring in Orchestrator resulting in entries written to a special Windows Eventlog. Now we need to raise alerts in SCOM when one of his runbooks fails or sends a platform event, who knows there could be trouble lurking in his paradise. We are not going to do anything fancy, however these are the steps we will be focusing on today: Create a Management Pack for our customizations Create rules that collects the events from the orchestrator server Off we go then and fire up the SCOM console and a powershell window. First we create a MP, I am going to use powershell to do this, however you may use the SCOM console as well (Administration – ManagementPacks – Action: Create Management Pack): Import the Management Pack into SCOM and move on to the Authoring section in the SCOM console. Create a new...

OpsMgr 2012 - DeleteDisabledDiscoverySources

Back again for a short post regarding a resent event I experienced. I have been tidying up my lab to prepare for an upgrade test I have been waiting to complete. Prior to the upgrade I wanted to remove some of the management packs what was targeted to IIS on some of my servers. Usually this is done by: Create a new ManagementPack (IIS7.disabled.xml) Create a new group and target it to the newly created MP (IIS7.disabled.xml) Disable the discovery rules for IIS7 and target the new Group This should prevent the members of the group to “apply” the managementpack, however the the servers will still show up in views that target IIS7 MP. To remove these objects from the view, we need to run a powershell SCOM-cmdlet called Remove-SCOMDisabledClassInstance. So off I went and loaded the OperationsManager Module in my always open powershell console window and fired off the cmdlet. It threw the usual warning message at me: I sat back and was planning to enjoy my coffee...

Powershell - Desired State Configuration (DSC) - Is it desired?

Finally found some time to play around with DSC on 2012 R2 and with the release of Windows Management Framework 4 , I can finally play with 2008 R2, Windows 7 and Windows 8 clients (if you upgrade to 8.1). As always with new releases of the Management Framework, some server configurations/applications do not play nicely with the new framework: System Center 2012 Configuration Manager ( not including SP1) System Center Virtual Machine Manager 2008 R2 (including SP1) Microsoft Exchange Server 2013 , Microsoft Exchange Server 2010 and Microsoft Exchange Server 2007 Microsoft SharePoint 2013 and M icrosoft SharePoint 2010 Windows Small Business Server 2011 Standard Please also note that .Net 4.5 is required before you install the Framework, otherwise the Framework installation will actually silently fail. As I previously wrote, if you were hoping for support for Windows Server 2008 support, you are not getting it. You will have to fall back to Windows Management Fram...

System Center Operations Manager 2012 (SCOM) - SNMP device discovery

Lately I have been working in SCOM with SNMP devices. Needless to say I have learned some new tricks I would like to share with you. Firstly you may have run into the dreaded "No response SNMP" message in Network Devices Pending Management in the SCOM console. First thing that jumps out is network connectivity, however I have seen cases that that is not the issue. Based upon my experience the message is very generic and could have several causes: 1. Network connectivity Firewall (on the SCOM server or one of the SCOM servers that is a member of the resourcepool specified in the discovery rule) or between the SCOM-server and the SNMP device. 2. SNMP-device configuration The target SNMP device needs to enable the whole system MIB/OID-tree to be discoverable in SCOM. If any of the following OIDs are missing, you will not be able to discover the device: 1.3.6.1.2.1.1.1.0 --> system.sysDescr 1.3.6.1.2.1.1.2.0 --> system.sysObjectID 1.3.6.1.2.1.1.4.0 --...