Monday, October 29, 2018

SCOM 1807 Universal Linux Monitoring

Recently discovered that some of the CentOS boxes that I've pushed the agent into came up as “Version Unknown” at the UNIX/Linux Computers within the Administration space in the SCOM console.

Checking further, there’s no monitoring data for the usual CPU / Memory / Logical Disk and Network from the servers.

Did a bit of troubleshooting and realized that from the “Microsoft System Center 1807 MP for UNIX and Linux” downloaded here, it seems to be missing the “Microsoft.Linux.Universal.Monitoring.mp”

image

Once imported the relevant mp from the SCOM 1801 media (notice the version difference), all started to work again Smile

Tuesday, October 9, 2018

Monitoring SNMP v1 Trap

Creating a post on some work I'd done couple of year ago so that it won’t be forgotten.

I know SNMPv1 is definitely obsolete by now but what if there are still some requirements to monitor SNMPv1 traps with SCOM ?

One of the way is to

  1. Create a custom MP on the trap you are going monitor with SCOM
  2. Export that custom MP as an XML
  3. Within the XML file, locate the version tag (<version>…</version>)
  4. Replace the string within the tag to 1, refer samples below


Before

image


After

image


and that should do the trick Smile

Monday, October 8, 2018

Setting OneDrive folder to be Always Available Offline

Was recently thrown with a challenge during a Windows 10 migration project for a client to set certain folders in their OneDrive for Business to be always available offline, once user’s data has been successfully migrated (to OneDrive) from on premise file server.

For the benefits of  everyone, latest version of OneDrive for Business client comes with improved features that allows you to either set files / folders to be always available offline or online (to free up spaces of your local storage)

image

While this option is available out of the box when the OneDrive sync client has been successfully setup, how do we further automate it so that certain files / folder can be set to “Always keep on this device (available offline)” without user’s intervention ?

Referring to the details online, we can create a PowerShell script using the attrib.exe, but based on my testing, “attrib -U +P /s” sets all the files / subfolder of the target folder you performed the command at to be available offline but not the parent folder.

To fix this, you can include a /D switch, as in “attrib -U +P /s /D”.

I’ve included a humble script of mine to apply the settings when the folder exists and the settings had not been applied.

$targetFolder = "<Target Folder>"

$rootDir = $env:userprofile + "\<your OneDrive Path>"
$FolderPath = $rootDir + "\" + $targetFolder


if (test-path $FolderPath)
{
     set-location $rootDir

    $Attrib = attrib $targetFolder

    $Attrib = $Attrib.trim()

    $arrayAttrib = $Attrib.Split("C:")

    $fileAttib = $arrayAttrib[0]
     $fileAttib = $fileAttib.TrimStart()
     $fileAttib = $fileAttib.TrimEnd()

    if ($fileAttib -ne 'P')
     {
         Set-Location $FolderPath
         attrib.exe +P -U /S /D

        Set-Location $rootDir
         attrib.exe +P -U /S /D $targetFolder
     }
}


Linking this script to a GPO logon script will make sure that the desired folder is always set available offline when user logs into their machine.

Enjoy… Smile

Thursday, January 18, 2018

SCOM PowerShell Script Monitors

I was recently asked if there’s a way to raise a SCOM alert when a scheduled task is not in “Running” state. From the community MPs, I reckoned it is only giving an alert when the tasks return a “Failed” state. I might be wrong, but if there’s one out there, appreciate if someone can enlighten me on this.

Have tried using vbscript via WMI calls but it worth taking note that, while it makes a query from “Win32_ScheduledJob” class, tasks created in the Windows Task Scheduler will not be listed.

We ended up exploring PowerShell and managed to write a simple script for this, but setting up the monitor was not as straight forward as it seemed.

Out of the box, SCOM provides the functionality to create VBScript based monitors, but if you are to create a similar monitor with PowerShell, first impression is that the monitor seemed working as expected (giving you a green tick), but as you test further, you will notice that the health state does not get updated, even when it qualifies for an unhealthy condition.

Looking at the OperationsManager event logs, you should see event 21405, saying the process failed to create System.PropertyBagData…, and interestingly, SCOM was trying to execute your PowerShell script using cscript.exe

Command executed:    "C:\Windows\system32\cscript.exe" /nologo "<your ps script>.ps1", as you can see below


To fix this, you either create a new custom MP to include the PowerShell script monitor (either Silect , VSAE) OR import a PowerShell script community based MP. I chose the latter since it is only a simple monitor and didn’t want to spend more time into it.

Once imported, you should be able to create a script based monitor, only this time, instead of VBScript, it will be in PowerShell.

Hope this helps :)

Monday, October 31, 2016

SCOM Dynamic Groups and Regex

Came across the need to create SCOM groups that consist of both Development and Production servers. While it is easier to have them explicitly populated into the correspondent groups but that would required exhaustive administrative effort from the SCOM admins to always validate the membership of the groups from time to time.

Most of you may know that not every organization has a standard naming convention for their servers like XXX-XXX , and the question now is what will be the regex expression for servers that either ends with d or p indicating whether this is a development or production servers ?

Well it might sound complicated (or at least to me) where how many characters or numbers that we need to consider, since the server names do no have a fixed length.

After some trials and errors, turned out to be quite a simple fix. The following expression will fit in

(?i:p$) –> means case insensitive and ending with a p (or P). Feel free to change the expression to suit your needs.

Thursday, November 26, 2015

SCCM 2012 R2 Clients failed downloading content

Was required to manage clients in untrusted domain in a recent SCCM deployment and one of pilot machine (Windows 7) was not able to have the published app successfully installed, while the other got installed successfully.

Checking on the DataTransferService.log, it includes log saying “DAV request. HTTP code 401, status 'Unauthorized'”

Checked and verified that the network access account for SCCM has been configured and there’s no firewall restriction between the client and SCCM server.

Googled around and found out that KB2522623 might be able to fix the problem, and it really did once the patch was applied.

Monday, July 13, 2015

Automated Profile Migration with SCCM–Orchestrator

Had a chance to be involved in a project whereby a client had requested to implement user state and profile migration via SCCM / USMT.

This basically requires configuring the State Migration Point in the SCCM site server and creating computer association, determining from which machine (Source) the user’s profile and data files are being migrated over to (Target)

Then, there will be 2 separate Task Sequences to capture and restore user’s profile and files via USMT scanstate and loadstate executions. As the rule of thumb, the Task Sequence to restore user’s data should only be run after the data capture has successfully executed.

I decided to take a step further by further automating the entire process via System Center 2012 R2 Orchestrator.

It consists of several runbooks, ranging from

  • Performing readiness check, making sure both machines are ready for user’s profile and data transfer

    image
  • Performing user’s profile and data migration by
    • creating the computer association
    • pushing the task sequences to both source and target machines and verify its execution
    image
  • Replicating all the SCCM direct membership collections from the source to destination, ensuring additional software / applications are successfully pushed to the target machine

    image

which are all called from a main runbook

image

Wednesday, March 18, 2015

SCOM 2012 R2 UR 5

With the recently launched of the SCOM 2012 R2 UR5, one of the issue it addressed was the “Specific Case is not valid” error when you remove the agent in a server that has SQL server installed, without removing it from the SQL runas account distribution. Please refer to the previous posting here. This should save us the hassle of having to manually update the SCOM databases, without fearing that it might affect the supportability from Microsoft.

As for how to apply the patch, this is one of my favorite blog for SCOM resources

http://blogs.technet.com/b/kevinholman/archive/2015/02/22/ur5-for-scom-2012-r2-step-by-step.aspx 

Information about the patch can be found here, as well as the link to download

https://support.microsoft.com/en-us/kb/3023138

Monday, February 9, 2015

SCOM Run As Account - Specific Cast Is Not Valid

Got the following error when i tried to add new servers into my SQL MP RunaAs account distribution

image

Once you click “Close”, you won’t get to see any other computers which this run as account has been distributed previously.

image

Well, the cause of this is actually due to agents are manually removed from the “Agent Managed” within the SCOM console, but without cleaning up the distribution of the RunAs Account.

In order to resolve this, i had deleted the specific entry from the OperationsManager database based on the solution found in http://www.ssistalk.com/2014/03/03/scom-2012-r2-specified-cast-is-not-valid-error/ 

Once done, the server which this account is distributed is visible again

image

p/s: updating the data directly in SCOM databases might impact the supportability from Microsoft. So do it at your own risk

Thursday, January 8, 2015

Windows Data Deduplication – Garbage Collection

Running on a limited SSD storage in machine, the first thing after it was setup is to create 2 logical disk partitions (OS and Data) and to enable data deduplication on the data drive (well, you might know now that we are not able enable data deduplication for OS partition)

Windows 8.1 does not come with a data dedup feature but i supposed there should be lot’s of links in the net that can guide you to enable data deduplication in windows 8.1

Once configured, you should be able to reap the rewards of huge disk space saving especially if you the machine is hosting some test VMs. But after a while, you might find that the disk space does not decrease over time, even after you manually run the “start-dedupJob” cmdlets.

image

One of the reason is that, there’s a garbage collection job, scheduled at 2.45 am every Saturday and if the machine is not turned on all the time, the job might not even been executed.

One of the way is to manually run the dedup job again using the “GarbageCollection” parameter

Start-DedupJob -Volume <volume> -Type GarbageCollection

and this should get rid of the unwanted file chunks.

Wednesday, January 7, 2015

Install Windows Roles & Features from Configuration File

Used to be launching the wizard while installing the Roles & Features for every new server setup, but it might be tiring and repetitive if you have multiple servers to setup at the same time.

One of the ways is to construct a powershell script to include all the features that are needed and run in.

As for someone with limited powershell knowledge like me, there is actually another way to simplify the amount of time needed to each configuration, via an exported configuration settings file

For a start, you will still need to launch the add Roles & Features wizard to customize the required components you need. However, towards the end of the wizard (just before confirming the installation), you can actually click on the “Export configuration settings” and save it as an xml file (default filename is DeploymentConfigTemplate.xml).

image 

Next, once you have the xml file, login in to the server you want to have the exact Roles & Features install, run the following powershell command (with admin rights of course !!) and the server will now start the install the roles and features according to what’s in the configuration template.

install-WindowsFeature –configurationfilepath <full path of your config file>

and displays a status once done

image

* if you include .net framework 3.5, make sure in include the –source pointing to the sxs folder, if not it will attempt to download from the internet

Monday, October 27, 2014

Agent Installation Error (Error Code : 80072971)

At times,we might experience another frequently seen error as below, where the agent management task status displays something like “….failed to acquire lock to remote computer….”

image 

This is due to when SCOM agent is pushed from the SCOM Management Server, the MS will first copy the install (& the patches) to the target machine at c:\windows\422C3AB1-32E0-4411-BF66-A84FEEFCC8E2 folder, and if you managed to browse to the folder,there should be a file named LockTimeFile. This file is to determine which SCOM MS is attending the target server at the moment.

By default, once the installation is completed, the folder will be automatically deleted when the installation completes, however there is changes that the folder / files are not successfully removed.

image

In order to resolve this, one of the way is to delete the LockTimeFile and the SCOM agent was successfully installed

Wednesday, October 8, 2014

SCOM SharePoint 2010 MP troubleshooting

Encountered the following error message in SCOM event viewer for one of the SharePoint 2010 servers. Searching around the net, found 2 links with valuable information on resolving it.

http://www.scom2k7.com/advanced-troubleshooting-of-the-sharepoint-2010-mp/

http://thoughtsonopsmgr.blogspot.com.au/2013/04/troubleshooting-sharepoint-server-2013.html

Basically it seemed might have to do with PowerShell 3.0 (for Sharepoint 2010), and one of the solution was to uninstall the PowerShell 3.0, but before doing so, you might want to verify it further by granting the SCOM SharePoint MP account to have SP farm admin rights, to see if it is able to launch the SP cmdlets.

Hope this helps :)

Friday, September 19, 2014

Failed to capture windows 8 reference image via SCCM 2012 R2 capture media

Had recently started to play around with SCCM 2012 R2 and wanted to explore more on OSD and task sequencing. Tried to capture a Windows 8 image after i had set it up with latest updates, it failed when the capture media was inserted and TSMBAutorun.exe was executed.

As expected, once the sysprep commands are completed, the machine will be rebooted the capturing should start. In this case, it didn’t and went into “sysprep” mode whereby i was asked to personalize the windows 8 again.

Tried asking around and this seemed to have to do with the RAM allocated (mine was a VM, running on dynamic RAM 512 – 1024).

What i did next, shut down the VM, set the RAM to be static 2GB and run the capture media again, and voila…. it works. :)

many thanks to my fellow MVP for this similar blog post here

Monday, August 25, 2014

Agent Installation Error (Error Code :80004005)

Faced a problem recently when trying to upgrade the version of the SCOM agent to the latest 2012 R2.
Error message is similar to the below
The Operations Manager Server could not execute WMI Query "Select * from Win32_Environment where NAME='PROCESSOR_ARCHITECTURE'"
Operation: Agent Install
Install account: <SCOM runAs>
Error Code: 80004005
Error Description: Unspecified error
This is due the 'PROCESSOR_ARCHITECTURE' variable, does not return a value, which causes agent push to failed. (the manual installation seemed to work though) Checking on the web and it does not seemed to have a permanent solution, however, there is a workaround which should help to complete the agent installation via push method. Many thanks to stefanroth.net for such sharing



Friday, August 23, 2013

Deploying SCOM 2012 SP1 in FIPS Enabled Environment (pt2)

Part 1 was more how to detect if FIPS is enabled and fixing the problem encountered by SSRS, this post will be more on SCOM Management Servers and how to resolve it.

Assuming that SSRS is now successfully fix, where you are able to browse the reports via the browser, and you proceed to bring up the SCOM server, after a while, your SCOM server will have a Warning, indicating that the XML for the configurations cannot be loaded due to some FIPS complaints issue.
image

Well, you should be able to resolve the issue, with the solutions posted in this article, and it should work nicely.

If you are installing SCOM MS in Windows Server 2012, you might probably need to install Windows SDK or Visual Studio Command prompts to execute the gacutil.exe, another way to proceed without installing the additional stuff is to use the remotegscutil, from http://remotegacutil.codeplex.com/, which allows install the dll required easily, and the only requirement for this tool to work, is the installation of .Net 3.5

Monday, August 12, 2013

Deploying SCOM 2012 SP1 in FIPS Enabled Environment (pt1)

One of my earliest post on SCOM Installation checklist, on of the items to do is to check if the deployment environment is enabled with FIPS (Federal Information Processing Standards). (You can know more about FIPS here).

As time goes by, i stumbled upon yet another SCOM deployment where FIPS is enabled as part of the client’s security hardening. What i did was, to first install the SQL Server and Reporting Services, and then verifying that the SSRS webpage is accessible, before building up my SCOM servers. What was least expected, was the report page is completely blank. Set IE not to display any friendly error messages too, did not show any error on the page. i got stuck,  and after a few searching here and there, it might be due to the enabling of FIPS in the environment.

In order to know if FIPS is enabled, what we need to do is to launch the registry editor and locate the following key

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa\fipsalgorithmpolicy

If it is enabled, the value will be 1.

image

First, fix the SSRS blank page issue, you may want to browse <driver>:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\LogFiles. Open the log files and search for FIPS. If it is a FIPS related issue, you will see something similar like this.

image

 

 

 

When you see the error message above, do the following.

    1. In a text editor such as Notepad, open the Report Manager Web.config file which is located in the default path: <driver>:\Program Files\Microsoft SQL Server\MSRS10.MSSQLSERVER\Reporting Services\ReportManager.
    2. In the Web.config file, locate the <system.web> section.
    3. Add the following <machineKey> section to in the <system.web> section:
      <machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="3DES" decryption="3DES"/>
    4. Save the Web.config file.
    5. Once done, restart the Reporting Services, and try to access the Reports page again, by now, you should be able to access the page.

 

Wednesday, April 10, 2013

Exchange MP and PowerShell 2.0

Normally after you imported the Management Pack, once all the discoveries had completed, you will begin to see the health status begin to appear in the SCOM console, following by SCOM periodically executing the scripts defined within the MP to capture performance data and this includes the Exchange MP.

In a particular assignment, after the Exchange 2007 MP has been imported, servers with the Exchange roles are successfully discovered, but lacking on certain information and one of the them is the number of mailbox for each of the mailbox servers. At first i thought it might be due to MS is still collecting the data but after some time (or even days) the value is still not out yet.

With the help from the SCOM guru and checking on the mailbox servers, only we found that there are quite a number of errors in the OperationsManager event log, with the following message.

image

Checked further from the net only to deduce that the servers hosting the Exchange roles (which is running on windows server 2003) needs to be installed with PowerShell 2.0. Fortunately there is a DR server which we can try to prove our point. Once PowerShell 2.0 was installed, things just started to work as expected. Winking smile

Monitoring Java EE Application Servers

We all know that with SCOM is fantastic in monitoring Microsoft roles and services with the relevant Management Packs, but what about those from non-windows platform ?

I had recently deployed a SCOM agent to monitor an Ubuntu server (and the Ubuntu server is hosted pretty much well in a Windows 2012 hostSmile) , and the server was installed with Apache Tomcat and MySQL.

We are able to monitor the service availability of Tomcat server via a simple service monitor, but what if we are required to perform a deeper monitoring in terms of the availability of the applications hosted and also the performance of the Tomcat ?

You can either purchase a third party MP or you can actually download the JAVA EE MP from the Microsoft website to do the same.

The JAVA EE management packs can be downloaded from the official website http://www.microsoft.com/en-us/download/details.aspx?id=29270, and for the first time users, it will be useful to go through the SC2012OM_JEE_Readme.txt included at the MP download page.

For a start, i am testing on Tomcat Apache 6.0 web server. During the MP is imported, things were not automatically discovered even after i had deployed the BeanSpy.

Next, what needs to be done is to copy the following powershell scripts and put it in a single folder, and run the NewJEEAppServer.ps1

JEEAppServerLibrary.ps1
NewJEEAppServer.ps1
RemoveJEEAppServer.ps1  (optional as i am not removing any server)

image

If everything goes smoothly, it should display you the response as above. and when discovery is done, some of the views (state and performance) are what you should be able to see.

image

image

image

SCOM Cross Platform monitoring

Based on one of my SCOM assignments which requires Ubuntu to be monitored, we all know that with the previous SCOM 2012, this might not possible (well, we can still use SNMP to monitor whether the server is up or down, but nothing further than that i guess)

With the release of System Center SP1, which monitoring of the version and variants of cross platform OS has been extended, i am quite eager to see how this is possible.

What i have in the lab is a virtual Ubuntu 12.04 server hosted in a Windows Server 2012 server, with apache Tomcat and MySQL services installed. First is to install the SCOM Agent and to make things easier, i have been using root account for the agent installation.

Some of the screen from the monitoring are as below.

image

imageimageimage

Stay tuned to my upcoming posts on monitoring Apache Tomcat Web Server via Microsoft JEE Application Server MP.