Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Local admins

11 views
Skip to first unread message

Dylan

unread,
Nov 3, 2009, 5:26:01 AM11/3/09
to
Good morning, I've been trying with out much luck to use sccm to create a
report of local admins. I've added the following lines to the sms_def.mof:

#pragma namespace ("\\\\.\\root\\cimv2")
[union, ViewSources{"Select * from Win32_GroupUser where
GroupComponent=\"Win32_Group.Domain='BUILTIN',Name='Administrators'\""},
ViewSpaces{"\\\\.\\root\\CIMV2"}, Dynamic : ToInstance,
provider("MS_VIEW_INSTANCE_PROVIDER")]

class Win32_LocalAdmins
{
[PropertySources("PartComponent"), key] Win32_Account ref AccountName;
[PropertySources("GroupComponent"), key] Win32_Group ref GroupName;
};

#pragma namespace ("\\\\.\\root\\cimv2\\sms")

[ SMS_Report (TRUE),
SMS_Group_Name ("LocalAdmins"),
SMS_Class_ID ("MICROSOFT|LocalAdmins|1.0")]

class Win32_LocalAdmins : SMS_Class_Template
{
[SMS_Report(TRUE), key]
string AccountName;
[SMS_Report(TRUE), key]
string GroupName;
};

And I've created the following report:

select distinct Name0 as 'Computer Name',
substring(AccountName0,charindex('Domain=',Accountname0)+8,(charindex('Name=',Accountname0)-charindex('Domain=',Accountname0)-10))
as 'Domain Name',
substring(AccountName0,len(AccountName0)-charindex('"',reverse(AccountName0),2)+2,charindex('"',reverse(AccountName0),2)-2) as 'User Name'
from v_GS_SYSTEM INNER JOIN v_GS_LocalAdmins ON v_GS_SYSTEM.ResourceID =
v_GS_LocalAdmins.ResourceID where (AccountName0 not like '%Administrator%'
AND AccountName0 not like '%Domain Admins%')

But not results are returned. This is my first attempt at modifying the
sms_def.mof file. I found the instructions at
http://www.myitforum.com/articles/8/view.asp?id=9735

Am I missing something, do I need to do anything on the client? Any help
much appreciated.

Many thanks, Dylan.


Garth

unread,
Nov 3, 2009, 8:42:56 AM11/3/09
to
Is the data being collected?

Have you tried a simple query like:

Select * from
v_GS_LocalAdmins

"Dylan" <Dy...@discussions.microsoft.com> wrote in message
news:47E423EB-9B60-4476...@microsoft.com:


--

Garth Jones
Chief Architect

www.Enhansoft.com
Enhancing Your Business


Sherry Kissinger [MVP]

unread,
Nov 4, 2009, 9:58:05 AM11/4/09
to
There is a mildley conflicting issue I see.

You mention you are using SCCM. But then you say you put the edit in
sms_def.mof. That edit, below, (and that original article) was essentially
written for SMS2003, AND for computers which were xp or older, or Server 2000
and older.

So... If you are ConfigMgr, just 1 edit to sms_def.mof won't work. I
suspect your change was rejected. If you need to use this (old) edit, you'd
need to split it up into the sms_def.mof section, and the configuration.mof
section. Personally, it's not as effective using the original edit, because
of the limitations to the older Operating Systems. But that's of course up
to you. The article has a link to the new method--the one that works with
Vista & Win7 & Server03/08, as well as the older OS'

If you are on SMS2003, editing just sms_def.mof will work... sort of. Now
you'll have to follow through and have your test clients mofcomp sms_def.mof
so that they know "how" to report on this new custom data you are asking of
them. Until that happens, your sms2003 clients won't be reporting anything
either, even if they are xp workstations.

0 new messages