Tag Archives: Powershell

SCOM Agents not Remotely Managable

This is posted just as a reminder to me, All credit to Kevin HolMan

Log into the SQL Server for SCOM 2012

Select the OperationsManager DB, then run the following SQL on it to identify the offending clients

select bme.DisplayName from MT_HealthService mths
INNER JOIN BaseManagedEntity bme on bme.BaseManagedEntityId = mths.BaseManagedEntityId
where IsManuallyInstalled = 1

If that shows you the clients you expect to cause you issues then run

UPDATE MT_HealthService
SET IsManuallyInstalled=0
WHERE IsManuallyInstalled=1

To get them back to being remotely manageable.

Thanks Kevin 🙂

SCOM 2012R2 Enable Proxy on Clients

We all know that the enabling Proxy on the clients is useful for many Management Packs, so here (mainly so I can remember it, but if it helps you then that’s great) is a quick command to check, and then enable the Agent Proxy.

To check

Get-SCOMAgent | where {$_.ProxyingEnabled.Value -eq $False}

That should give you something like

HealthState DisplayName Version ActionAccountIdentity ProxyingEnabled
----------- ----------- ------- --------------------- ---------------
Success servername 7.1.10133.0 SYSTEM False

So if we add a Enable-SCOMAgentProxy to that then we can set the servers, so

Get-SCOMAgent | where {$_.ProxyingEnabled.Value -eq $False} | Enable-SCOMAgentProxy will enable it for all the servers.

Packed Bitstream in Win7

The Windows 7 ‘SuperCodec’ does not like Packed Bitstream xVids and DivX’s. It shows itself by looking like the playback is at 15-20fps instead of 23.997/25/29.997. Not a problem though, we can fix that with a little PowerShell and MPEG4ModifierCL (see below).

The script is as below, just save this into a UpdateVideoPacking.ps1

# Enumerate through avi files in directory
# and run MMCL to uncompress them if required

foreach ($file in get-childitem *.avi)
  $FileTrim = $file.name.TrimEnd(".avi")
  $FileNew = $fileTrim + ".up.avi"
  write-host "Working on " $FileTrim "Output To " $FileNew
  mmcl –unpack $file.name $FileNew
  if($LASTEXITCODE -eq 0)
      if (Test-Path $FileNew)
         write-host "Would delete "$file
         del $file
   write-host "Completed Folder"

Make sure that the MPEG4Modifier executable (mmcl.exe) is in the path, or the same folder as the script/video’s.

Now pull down and install PowerShell if you have not, launch it and type set-ExecutionPolicy unrestricted (will allow the PS1 to run)

Now change folder to the video folder you want to process and type fullpathtoscript\UpdateVideoPacking.ps1 this will run the script in the folder, I put both the script and the mmcl.exe in my c:\utils folder, which is in my path.

The script will read the file in, determine if the file needs unpacking, if it does it will create a file with the same name as the original but put .up before the .avi. It will then make sure the unpack worked without error, and delete the original, if you don’t want it to delete the file put a # in front of the line del $file this will then just echo the file’s name out to the screen that would have been deleted.

Yes I know the code is a little clunky, and this version only does one folder at a time, I do have a version that will traverse the tree, and will post it if anyone wants it.

MPEG4ModifierCL Download