myITforum.com Community Forum myITforum.com Community Forum

Home  Forums  Blogs  Live Support chat  Search Articles  Wiki  FAQ  Email Lists  Register  Login  My Profile  Inbox  Address Book  My Subscription  My Forums 

Photo Gallery  Member List  Search  Calendars  FAQ  Ticket List  Log Out

All Forums RSS Feed Subscription:


  


Local Admins MOF

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
  Printable Version
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Local Admins MOF Page: [1]
Login
Message << Older Topic   Newer Topic >>
Local Admins MOF - 5/23/2008 10:42:12 AM   
pauldunn

 

Posts: 28
Score: 1
Joined: 10/4/2006
Status: offline
I have a question about the Local Admins MOF postsed on myITforum by Ward Lange.

I have manually compile the LocalAdmin.MOF on a couple of workstations (2 XP and 1 Vista) using the command:

mofcomp -autorecover localadmins.mof

This returned:

Microsoft (R) MOF Compiler Version 6.0.6000.16386
Copyright (c) Microsoft Corp. 1997-2006. All rights reserved.
Parsing MOF file: localadmins.mof
MOF file has been successfully parsed
Storing data in the repository...
Done!

So that seemed to work.

I added the text in LocalAdmins-Report.MOF to SMS_DEF.MOF.  I checked the DataLdr.log file on the server.  Did the update for LocalAdmins-Report work?

SMS_DEF.Mof change detected
Connected to SQL; waiting for Hinv action ID...
Done with wait for Hinv action ID.
Start of cimv2\sms-to-policy conversion
Resetting SMS_Report qualifier to FALSE on all classes and properties in cimv2\sms namespace
Running MOFCOMP on D:\SMS\inboxes\clifiles.src\hinv\sms_def.mof
MOF backed up to D:\SMS\data\hinvarchive\sms_def.mof.bak
Warning: cannot get SMS_Class_ID of SMS_Win32ProviderEx
End of cimv2\sms-to-policy conversion; returning 0x0

I added the new report in Word Lange's post and when I run it I get the following message:

An error occurred when the report was run. The details are as follows:
Invalid object name 'v_GS_LocalAdmins'.
Error Number: -2147217865
Source: Microsoft OLE DB Provider for SQL Server
Native Error: 208

When I check the SMS database I do not see the "v_GS_LocalAdmins" view with SQL Enterprise Manager.  What step has failed or have I missed something or just not waited long enough?

Thanks,
Pul
Post #: 1
RE: Local Admins MOF - 5/23/2008 10:55:47 AM   
mserafine

 

Posts: 1659
Score: 157
Joined: 4/7/2003
Status: offline
Run a hardware inventory cycle on the machines that received/compiled the updated MOF. If I remember correctly, hardware inventory views (like v_GS_LocalAdmins) aren't created until at least one client submits inventory for the classes in question.

_____________________________

Mark Serafine | Microsoft Corporation

Management Technologies (SMS, MOM, System Center) Premier Field Engineer | Microsoft Premier Support

(in reply to pauldunn)
Post #: 2
RE: Local Admins MOF - 5/23/2008 11:35:59 AM   
mseely

 

Posts: 35
Score: 1
Joined: 5/4/2008
Status: offline
1st Check the WMI Class on the client -  Is it showing any instances ? 
If not, then there won't be anything to go up the SMS for Inventory

2nd - What Operating System are you running the MOF on ?
The MOF won't work out-of-the-box on the newer operating systems  (The readme mentions Server2003, but Vista and 2008 would also be affected)
The newer OSes  don't recognize 'BUILTIN' as a domain.
If using one of these newer operating Systems, would need to modify the MOF so that it includes the name of the system inplace of 'BUILTIN'

3rd - as mserafine mentioned Make sure Hardware Inventory cycle has been run on the clients

4th - Check to see that 'v_gs_localadmins' was the view that was created for the inventory class. 
 Manually look through the list of views to see if something that looks close to 'V_GS_LocalAdmins' is there.


(in reply to mserafine)
Post #: 3
RE: Local Admins MOF - 5/23/2008 11:59:45 AM   
pauldunn

 

Posts: 28
Score: 1
Joined: 10/4/2006
Status: offline
I thought of that and had already ran a HW inventory before posting.  When I check the InventoryAgent.log on one of the workstations where I previously ran "mofcomp localadmins.mof" should I see the inventory attempting to query "Win32_GroupUser"?

If yes, I do not.see the query reference in the log file.

How can I check WMI to ensure that the class has been created?

Paul

(in reply to mserafine)
Post #: 4
RE: Local Admins MOF - 5/23/2008 12:40:16 PM   
mseely

 

Posts: 35
Score: 1
Joined: 5/4/2008
Status: offline
InventoryAgent would be querying the Win32_LocalAdmins class.

Also - one other thing that needs to be done would be to ensure that the Machine Policy Refresh has run on the system prior to running HW Inventory.

Should be able to use wbemtest to see whether the class is there and see what it is populated with.

(in reply to pauldunn)
Post #: 5
RE: Local Admins MOF - 5/23/2008 1:19:42 PM   
pauldunn

 

Posts: 28
Score: 1
Joined: 10/4/2006
Status: offline
I ran the HW inventory again and I now see the views with SQL Enterprise Manager.

You mentioned that you can't use "BUILTIN" on the newer OS's and that it would have to be replaced by the name of the system.  I was hoping to use SMS to roll out the "LocalAdmins.MOF" to all workstations.  Can a windows variable (ComputerName) somehow be substituted inplace of "BUILTIN" in the MOF file?

Thanks,
Paul

(in reply to pauldunn)
Post #: 6
RE: Local Admins MOF - 5/24/2008 2:11:49 PM   
mseely

 

Posts: 35
Score: 1
Joined: 5/4/2008
Status: offline
I haven't been able to find a way to put a variable w/in a mof.

Best way I can come up to implement the localadmin mof would be through a SWD Advertisement that
1) creates a local copy of the localadmin.mof
2) modifies the localcopy by replacing 'BUILTIN'  with <ComputerName>
3) Runs mofcomp against the local copy of the mof.


(in reply to pauldunn)
Post #: 7
RE: Local Admins MOF - 5/26/2008 11:03:46 AM   
Tom_Watson

 

Posts: 92
Score: 4
Joined: 9/13/2006
Status: offline
I made mention of a possible method to do this in another thread:-

http://www.myitforum.com/forums/m_135090/mpage_1/key_/tm.htm

However, I was toying with the idea of doing this within a VBS script instead.  If I get time to do one, I'll post it here.

Regards,
Tom Watson

(in reply to mseely)
Post #: 8
RE: Local Admins MOF - 5/26/2008 5:04:15 PM   
mseely

 

Posts: 35
Score: 1
Joined: 5/4/2008
Status: offline
A basic VBScript file that will do what is being asked is here:
[Basic in that there is no error checking, no return codes, etc]

(also, on my VISTA system, I noticed that the MS_INSTANCE_VIEW_PROVIDER had not been registered on the system yet, so I needed to register the Provider in order for it to work)

--Mark


---
CONST TemporaryFolder = 2
Set ofso = CreateObject("Scripting.FileSystemObject")
Set oWNet = CreateObject("Wscript.Network")
Set oWshell = CreateObject("Wscript.Shell")
TempFolder = ofso.GetSpecialFolder(TemporaryFolder)
curFolder = ofso.GetParentFolderName(wscript.scriptfullname)
if ofso.FileExists(ofso.BuildPath(curFolder,"LocalAdmin.MOF")) Then
Set inFile = ofso.OpenTextFile(ofso.BuildPath(curFolder,"LocalAdmin.MOF"))
szMOF = inFile.ReadAll
szMOF = Replace(szMOF,"BUILTIN",oWNet.ComputerName)
inFile.Close
Set outFile = ofso.CreateTextFile(ofso.BuildPath(TempFolder,"LocalAdmin.MOF"))
outFile.Write szMOF
outFile.Close
TempMOF = ofso.BuildPath(curFolder,"LocalAdmin.MOF")
if ofso.FileExists(TempMOF)) then
owshell.Run "MOFCOMP.EXE " & CHR(34) & TempMOF & chr(34),,1
ofso.DeleteFile TempMOF,vbtrue
end If
end if
---


< Message edited by mseely -- 5/26/2008 5:05:56 PM >

(in reply to Tom_Watson)
Post #: 9
RE: Local Admins MOF - 5/27/2008 3:38:59 AM   
Tom_Watson

 

Posts: 92
Score: 4
Joined: 9/13/2006
Status: offline
Does the trick, and saved me some work.  Cheers.

BTW. It seems like you can also run this on XP systems, and I'm guessing 2000 as well, since they seem to like either BUILTIN or the computer name explicitly.  However, I'd double check beforehand.

(in reply to mseely)
Post #: 10
Page:   [1]
All Forums >> [Management Products] >> Microsoft Systems Management Server >> SMS 2003 >> Local Admins MOF Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts



  
Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI

0.547