#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.
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
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.