O R G A N I C / F E R T I L I Z E R: 08.09

Aug 31, 2009

using powershell to list active directory trusts

this is an easy concept to do for the current domain:

$myLocalDomain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain()



it’s a little different if you want to do it for another domain, such as the root domain, for example:

$myRootDirContext = New-Object System.DirectoryServices.ActiveDirectory.DirectoryContext('domain',"myDomain.com")

$myRootDomain = [System.DirectoryServices.ActiveDirectory.Domain]::GetDomain([System.DirectoryServices.ActiveDirectory.DirectoryContext]$myRootDirContext)


Aug 26, 2009

useful tasks for the extended ad mp

The 3rd District Fire Rescue Task Forces, Toky...if you’ve decided to start using the extended ad mp over on opsmanjam.com, you’ve probably noticed in the user guide (cough) that in order to pick up expensive/ineffecient ldap queries, you need to change some registry values.

first of all, what’s the fire engine have to do with this post?  actually nothing.  i just saw it and thought “red”.  yeah.

anyway, if you’re going to set it manually, it shows you how right here in guide:

  1. Open the Registry Editor
  2. Locate the following Registry key – HKLM\System\CurrentControlSet\Services\NTDS\Diagnostics\15 Field Engineering and change its value to 4 or 5.
  3. Open the Operations Console, and click the Authoring button.
  4. Expand Management Pack Objects, and then click Rules.
  5. In the Rules pane, type LDAP into the Look for box, and then click Find Now.
  6. Locate the LDAP Summary Report of Expensive or Inefficient Queries and/or the An expensive or inefficient LDAP query was performed rule.
  7. Right-click the rule, click Overrides, click Override the Rule, and then click “For all objects of type: Active Directory Domain Controller Server 2003 Computer Role.
  8. Enable the Override-controlled parameter labeled Enabled and set its Override Setting to True.
  9. Target the override to a custom Management Pack and not the Default Management Pack. Click OK to save your changes.

if you’d rather create tasks, here’s the basic premise:

  1. flip over to the authoring console node.
  2. create a new task as type: agent tasks/command line.
  3. choose the destination management pack of choice as long as it is NOT the default management pack.
  4. be creative with your task name (yes, that’s sarcasm).  for example, i named mine: enable ntds field engineering diagnostics.
  5. choose the task target.  i set mine to: active directory domain controller server 2003 computer role.  i did this namely so that someone wouldn’t try to point this to a regular computer.
  6. full path to file: %windir%\system32\reg.exe
  7. parameters: ADD HLKM\System\CurrentControlSet\Services\NTDS Diagnostics /v “15 Field Engineering” /t REG_DWORD /d 0x4 /f

for the love of all things holy, please do not forget the /f.  if you do, the task will never actually complete since the value should already exist on your domain controller.

one more thing to add, i created a task to turn this off.  all you need to do is change the parameter line to this: ADD HLKM\System\CurrentControlSet\Services\NTDS Diagnostics /v “15 Field Engineering” /t REG_DWORD /d 0x0 /f

if everything worked as planned, when you execute this task, it should look just like this:


Aug 21, 2009

configuration manager compliance summary reports by site

TPS Reports

Image by cell105 via Flickr

if you’ll recall from my last post, i had a bit of trouble trying to figure out a way to generate reports by authorization list.  well, i got by that hurdle.  the problem is the tables i was using to generate the report weren’t really designed for running on a massive scale.  in fact, i started timing it and realized that it was taking on average about 3-4 seconds per machine.  so for an average enterprise of 10,000 machines, it would take --

( ( 10,000 * 3 ) / 60 ) / 60 = 8.33 hours

no one really found this acceptable for obvious reasons.  well, with a bit more digging, i found i could do the same kind of thing without having to aggregate the report details to generate a compliance number.  instead of using v_updatecompliancestatus, i started using v_updateliststatus_live.  is it just me or do they seem to be named inappropriately?

anyway, i created a new set of reports, taking a bit from the old and a bit from existing reports such as the one i created before.  i think it’s more robust.  certainly runs faster than before.  MUCH faster!  (don’t mind the blank spaces.  the interesting thing about web reports is that when you use temporary tables, it displays a blank area).

UPDATE: to eliminate the blank spaces, use -

  • SET NOCOUNT ON at the beginning of your statements for your temporary table
  • SET NOCOUNT OFF at the end of your query after the temporary table is filled.

thanks to sudeesh rajashekharan’s answer on this post.

this is how the report set looks.  it starts with a summary based on each site (blanked out):



clicking the link takes you to the site details report which looks like this:



this report lists out each machine, the last logged on user, and its state.  i found it relevant to add the last known scan time and the last known heartbeat.  this way scans that are old with recent heartbeats would indicate that a machine is having a problem scanning.

now clicking on an individual machine will take you to a detailed report that displays the details of each update.  it would look something like this:



the report mof is available on system center central.  (link provided at the end).  once you import them, you’ll have to link them together to get the drill-downs working.  here’s how you do it.

  • Security Compliance (Summary)
    • link to Security Compliance (Site Details)
    • authlistid - column 6
    • collid – column 7
    • siteid – column 1



  • Security Compliance (Site Details)
    • link to Security Compliance (Machine Details)
    • authlistid – column 6
    • machinename – column 1



and there you have it.  here’s the link for the report: http://www.systemcentercentral.com/Downloads/DownloadsDetails/tabid/144/IndexID/24458/Default.aspx

Aug 13, 2009

generating a compliance summary report based on an authorization list

i hope someone doesn’t respond to this post and say… hey it was already done – right here!  i searched for awhile and couldn’t find any canned reports someone had done to display security update compliance by machine based on an authorization list.  i’m no sql expert, and my skillz at writing sql queries are not m@dd by any stretch of the imagination.  however, i was able to finagle what appears to be decent output.

here’s a screen capture of the query output we’ll be working with:



this report contains links that will generate another report of the specific updates used in the calculation of the summary:




the reason why we find this report immensely useful is because it limits the data set based on your authorization list.  when you execute the report, you will have to provide two things:

  • a collection id – which set of machines do you want to look at?
  • an authorization list id – which authorization list do you want to check against?

this way, when you look at compliance numbers, they are based on the things that you authorized for your environment and not just the massive list of things that could potentially apply to a machine.  this seems to matter in larger environments where updates are governed by their necessity and not as simple as going to windows update and running install everything!


installing the report

if you notice in the first report, the scope id is the 6th column of the list.  the reason it’s in there is because the second report requires it, otherwise, you’d get a return of everything that’s applicable, and not just the ones you authorized.

you can get the two report MOFs required to generate this report from system center central at this LINK.  one issue with reports that utilize drill through models is that the relationship doesn’t come through properly during the mof export.  because of this, i removed the “linked” relationship and exported them.  once you import the report mof, you’ll need to make the following changes:

  1. open the Compliance Summary Report by Collection and Authorization List report.
  2. under the Links tab, change the link type to Link to another report.
  3. select the report named Compliance Summary Report Detail by Computer.
  4. by default, the MachineName prompt will fill in with column 1.  this is valid and does not require changing.
  5. change the column id for AuthListID to 6.



that’s it!  now when you click the arrow for a computer in the main report, you’ll be able to drill through to the detailed report.



before you go off and try this, here are a few things to understand:

  • if the machine is failing to scan or failing to send up state messages related to the update compliance state, these will not show up in the report and will skew your numbers.
  • from technet: “Unlike other software updates state messages that are replicated up the hierarchy to the central site, state messages for deployments are replicated up the hierarchy to the site where the deployment was created. Software update deployment enforcement, evaluation, and compliance information will be missing from reports when they are run from a site higher in the hierarchy than where the deployment was created.”
  • the client version must be >= 4.00.
  • this report is defined to pull microsoft security updates only.



hope you find this helpful.  i can get a list of about 1000 machines in about 30 seconds so the return is not too terrible. :)

Aug 6, 2009

bug with synthetic transactions (exchange 2007 native mp)

Computer bug

Image by Hil via Flickr

if you’re using the native exchange 2007 mp with clustered mailbox servers, you may have noticed that your synthetic transaction executions are timing out.

you should be able to recognize the alerts.  they look something like this:

Some of the MAPI connectivity transactions failed. Detailed information:

Target: System mailbox for XYZ

Error: The transaction did not complete in the alotted time (20 seconds).


here is an explanation from microsoft:

“In the core OpsMgr code, there is a “cluster override” that disables all workflows for objects that are contained by a cluster virtual server, unless the workflows are running on the Active Node.  When we create the relationship between the Synthetic Transaction object and the Cluster Virtual Node for the Mailbox Server, the CAS Server is now subject to the "cluster override" even though it isn't a member of the cluster, because now the Synthetic Transaction hosted on the CAS server is contained by the Cluster virtual server.”


the workaround is to disable the discovery that builds this relationship.  when you do this, be cognizant that the maintenance mode model changes.  the discovery mentioned above that requires disabling is:

name: rms target relationship discovery
target: root management server


this is the net effect of disabling this discovery:

  1. Mailbox Server is put into Maintenance Mode and taken offline
  2. The CAS Synthetic Transactions that target that Mailbox Server will not be put in MM and will continue to run
  3. The transactions will fail and will go into a critical state


oh well!  at least your synthetic transactions will run.  by the way, since this is a bug, it’s being worked on.  :)

Aug 4, 2009

how to properly target machines with the dfs management pack


Image by GravitysAppleNZ via Flickr

if you’re planning to install the microsoft windows dfs 2003 management pack (yes, the converted one), you should be certain to target properly.  if you don’t, you’ll end up with some trash data coming from other dfs sources (e.g. domain controllers) that you may not want in your dfs views.

i spent a disproportionate amount of time on this to figure out all the ins and outs of targeting inside of this mp.  i would love to say it was for my edification, but in actuality, it was because the agents apparently didn’t work right until they were restarted.  :|

anyway, so the bottom line is, it was much easier than what i describe in this post on system center central.  it may still be confusing to others however so i’m posting it here.

the first thing you’ll want to do is create a new group.  there isn’t much to do here except target your members properly.  i used something like this to target a few of my dfs servers.  specifically, i’m using the mom 2005 backward compatibility windows server target since this is the target that one of the discovery rules uses later.



once that’s setup, open the object discoveries section.  to make it simpler, change your scope to microsoft windows 2003 servers with distributed file system service installation.

you should find this discovery -


- targeting the mom 2005 backward compatibility windows computer object.



this is the rule that you want to override.

  • right-click the rule
  • go to overrides > override the object discovery > for all objects of class: mom 2005 backward compatibility windows computer
  • once open, choose override on the enabled parameter and change the override value to “false”.
  • be sure to add this to your own, custom management pack.



now we’ve effectively blocked the discovery from executing against the class above (which subsequently includes damn near everything).  before you go anywhere, let’s create another override. 

  • overrides > override the object discovery > for a group…
  • choose the group that you created prior.  the override value probably shows up as “true” already so this may appear counterintuitive.
  • select the override anyway.
  • again, add this to your own custom mp.



if done right, you should only see the dfs servers you targeted in the custom group you created.  here’s how mine looks:



hope this helps!