none
SCCM report for finding machines with local shares RRS feed

  • Question

  • Hello all,

    Is there a report or does anyone have an idea of I could create a query that will the give me a count of the number of machines with local shares?  It would be idea if the query or report could return back the NetBIOS name and any share names.

    Thanks,

    MDH
    Tuesday, July 28, 2009 1:37 PM

Answers

  • Do you already have win32_share enabled in sms_def.mof?  check <your primary site>\inboxes\clifiles.src\hinv, sms_def.mof. 

    You'll like want TRUE on at least Name.  Maybe Path.  and the report itself.  If so, then you'll have a view called v_gs_share, and you can build reports using that view.

    [ SMS_Report (TRUE), SMS_Group_Name ("Shares"), SMS_Class_ID ("MICROSOFT|SHARE|1.0") ]
    class Win32_Share : SMS_Class_Template
    {
        [SMS_Report (FALSE), SMS_Units("DecimalString")]        uint32     AccessMask;
        [SMS_Report (FALSE)     ]        boolean    AllowMaximum;
        [SMS_Report (FALSE)     ]        string     Caption;
        [SMS_Report (FALSE)     ]        string     Description;
        [SMS_Report (FALSE)     ]        datetime   InstallDate;
        [SMS_Report (FALSE)     ]        uint32     MaximumAllowed;
        [SMS_Report (TRUE), key]        string     Name;
        [SMS_Report (TRUE)     ]        string     Path;
        [SMS_Report (FALSE)     ]        string     Status;
        [SMS_Report (FALSE), SMS_Units("DecimalString")]        uint32     Type;
    };


    Standardize. Simplify. Automate.
    Tuesday, July 28, 2009 5:26 PM
    Moderator

All replies

  • Do you already have win32_share enabled in sms_def.mof?  check <your primary site>\inboxes\clifiles.src\hinv, sms_def.mof. 

    You'll like want TRUE on at least Name.  Maybe Path.  and the report itself.  If so, then you'll have a view called v_gs_share, and you can build reports using that view.

    [ SMS_Report (TRUE), SMS_Group_Name ("Shares"), SMS_Class_ID ("MICROSOFT|SHARE|1.0") ]
    class Win32_Share : SMS_Class_Template
    {
        [SMS_Report (FALSE), SMS_Units("DecimalString")]        uint32     AccessMask;
        [SMS_Report (FALSE)     ]        boolean    AllowMaximum;
        [SMS_Report (FALSE)     ]        string     Caption;
        [SMS_Report (FALSE)     ]        string     Description;
        [SMS_Report (FALSE)     ]        datetime   InstallDate;
        [SMS_Report (FALSE)     ]        uint32     MaximumAllowed;
        [SMS_Report (TRUE), key]        string     Name;
        [SMS_Report (TRUE)     ]        string     Path;
        [SMS_Report (FALSE)     ]        string     Status;
        [SMS_Report (FALSE), SMS_Units("DecimalString")]        uint32     Type;
    };


    Standardize. Simplify. Automate.
    Tuesday, July 28, 2009 5:26 PM
    Moderator
  • Thanks Sherry!

    I've never edited the MOF before.  When I make the changes to the MOF file and I save them, do I need to save the new MOF file in another folder and then move the new MOF into hinv folder?

    I tried to edit it and got an error stating it could not create the MOF file and then it prompted me to save it elsewhere.  Can you give me some guidance?

    Thanks!
    Tuesday, July 28, 2009 6:18 PM
  • Best practise is said to be editing a "non live" version of the mof.
    Tuesday, July 28, 2009 7:19 PM
  • Ok, I can copy it and create it that way, but what about replacing it?

    Thx!
    Tuesday, July 28, 2009 9:23 PM
  • Changing the FALSE to TRUE in a couple places using your offline copy.  Then just drop the modified sms_def.mof into inboxes\clifiles.src\hinv, replacing the existing.

    Before you drop the modified sms_def.mof in there, check here : http://www.myitforum.com/myitwiki/sccminv.ashx and read thru the "Monitoring Changes" section.  Once you drop the .mof file in, follow the bouncing ball and monitor the policy making through your site to the client, and back again.  :-)
    Standardize. Simplify. Automate.
    • Proposed as answer by Jefe.Sioux Wednesday, May 19, 2010 6:59 PM
    Wednesday, July 29, 2009 1:55 AM
    Moderator
  • Hello.

    Sorry for posting in such old thread, but I have a question about this subject.

    I enabled win32_share in sms_def.mof like here, I restarted the server but when I run the report, the error is "Invalid object name 'v_GS_Share'".

    I see that in SQL database, v_GS_SHARE view was not created.

    This test was made on lab machines and the Hardware Inventory was set to 5 minutes.

    What do you think is wrong?

     

    Thanks.

     

    Thursday, January 27, 2011 1:34 PM
  • A reboot of the server isn't necessary for mof changes.  that said, the tables and shares are not created until at least 1 computer forwards the new information.

    Although you have Hinv set to every 5 minutes (which, by the way, is mildly insane of you, even in a lab); the client first needs to pick up policy, apply it, and THEN at it's next hinv it will report the data.

    Here's what I suggest:  back hinv off to something normal, like daily.

    Download and install Roger Zanders' SCCM Client Center.

    Using Client Center, connect to a test computer, and when you are testing, use the pull-down options to request machine policy refreshes, wait a minute or so, and then to request whatever action it is you are trying to test, like a Hinv Delta.  Then, presuming you are monitoring Hardware Inventory, on the client look at inventoryagent.log, and on the server look at dataldr.log.

    You might also want to peruse the inventory wiki, especially the part about monitoring changes: http://www.myitforum.com/myitwiki/SCCMINV.ashx


    Standardize. Simplify. Automate.
    Thursday, January 27, 2011 1:47 PM
    Moderator
  • Verify that the mof didn't change back. If it's rejected for some reason it reverts back. If it hasn't make sure the machine has pulled down the new mof and reported inventory.

     BTW... mof edit do not require rebooting the server.

     


    John Marcum | http://myitforum.com/cs2/blogs/jmarcum/|
    Thursday, January 27, 2011 1:48 PM
    Moderator
  • Hello again.

    I should be more patient to see the results. Now I have a report with shares on computers.

    Thanks John, thanks Sherry.

     

    P.S. There is the possibility to get the users who have permissions on shares?

    Thanks a lot.

    Friday, January 28, 2011 8:06 AM
  • Share permissions, sure:  http://www.myitforum.com/articles/8/view.asp?id=9597

    It requires a script run as a recurring advertisement to populate WMI, + the mof edit.  that article is from SMS2003 days, so ignore the instruction of mofcomping the mof on your clients, that's only for SMS2003.  Configmgr07, don't mofcomp on your clients--no need.


    Standardize. Simplify. Automate.
    Friday, January 28, 2011 5:33 PM
    Moderator
  • Its working, thank you very much, again.
    Wednesday, February 2, 2011 3:11 PM
  • hi,

    I have done the same changes in .mof file, could you please suggest the name of report to have the details of shares of machines

    Tuesday, October 11, 2011 6:22 PM
  • this would be a custom report.  PRESUMING you mean all you did was change the existing sms_def.mof from FALSE to TRUE for the share information, try a sql query of select * from v_gs_share0

    That will get you started.

    If you meant you are looking for the share permissions, just adding the mof snippets to the mof files isn't enough; you need the recurring script as well on your clients.


    Standardize. Simplify. Automate.
    Tuesday, October 11, 2011 8:51 PM
    Moderator
  • Sherry, how are you?

    Can you update the link please? I have invetory the Share(win32_share) but i cant find how i can report the Share Permissions.

    Thanks!

    Wednesday, September 19, 2018 7:36 PM