Answered by:
Local Admins Group, sms_def.mof

Question
-
Hi. I added data
// Local Admins#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;
};
to sms_def.mof, ran mofcomp.exe and hardware inventory on clients and SCCM server, but did not see v_GS_LocalAdmin in database.
мой блог - http://ccmexec.blogspot.com/Thursday, November 26, 2009 3:51 PM
Answers
-
I added
#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;
};
to sms_def.mof and compile
#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;
};
on my Windows XP client. Am i right?
Sorry about my English.
мой блог - http://ccmexec.blogspot.com/- Marked as answer by error008MVP Saturday, November 28, 2009 5:07 PM
Friday, November 27, 2009 2:40 PM -
That is correct. To get the client to report, do the following.
- Run Machine Policy Retrieval and Evaluation. Wait at least 2 minutes (more to be safe).
- Compile the LocalAdmins.MOF using mofcomp.exe on the XP client.
- Run Hardware Inventory.
- Wait on the updated Hardware Inventory for that client appearing on the server.
Regards,
Tom Watson,
E-Mail: Tom_... @...
Blog: http://myitforum.com/cs2/blogs/tom_watson- Marked as answer by error008MVP Saturday, November 28, 2009 5:07 PM
Friday, November 27, 2009 2:51 PM
All replies
-
See http://myitforum.com/cs2/blogs/skissinger/archive/2008/06/08/report-on-local-administrators-group-membership-updated.aspx for some guidance on this.
Basically you needed to add :-
//`'`*._.*`'`*-
// Local Administrators Data Class
//`'`*._.*`'`*-
#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;
};
to SMS_DEF.MOF.
Depending on what clients you want to report, will determine what you need to do. If you have only Windows XP clients (or Win2k), then you can compile directly:-
//------------------------------------------
// Local Administrators
// Requires Localadmins.MOF to be compile
//------------------------------------------
#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;
};
However, clients above Windows XP need the BUILTIN changed to the actual computer name. See http://www.myitforum.com/forums/m_179546/tm.htm for some scripts on doing this. These can be sent out as packages.
Regards,
Tom Watson,
E-Mail: Tom_...@...
Blog: http://myitforum.com/cs2/blogs/tom_watson- Proposed as answer by Sherry Kissinger Friday, November 27, 2009 2:33 PM
Friday, November 27, 2009 10:17 AM -
I added
#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;
};
to sms_def.mof and compile
#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;
};
on my Windows XP client. Am i right?
Sorry about my English.
мой блог - http://ccmexec.blogspot.com/- Marked as answer by error008MVP Saturday, November 28, 2009 5:07 PM
Friday, November 27, 2009 2:40 PM -
That is correct. To get the client to report, do the following.
- Run Machine Policy Retrieval and Evaluation. Wait at least 2 minutes (more to be safe).
- Compile the LocalAdmins.MOF using mofcomp.exe on the XP client.
- Run Hardware Inventory.
- Wait on the updated Hardware Inventory for that client appearing on the server.
Regards,
Tom Watson,
E-Mail: Tom_... @...
Blog: http://myitforum.com/cs2/blogs/tom_watson- Marked as answer by error008MVP Saturday, November 28, 2009 5:07 PM
Friday, November 27, 2009 2:51 PM