Collection of SCCM Console Right Click ToolsWriten by Rick Houchins at myITforum.com. To download 1.9 version click here
Get Local and AD Groups, installed products and system roles@echo off
:: #############################################################################
if exist c:\%COMPUTERNAME%_Groups.txt del c:\%COMPUTERNAME%_Groups.txtset parm=LocalgroupEcho Geting Server basic informatin ...Echo COMPUTERNAME = %COMPUTERNAME% >>c:\%COMPUTERNAME%_Groups.txtEcho ALVer = %ALVer% >>c:\%COMPUTERNAME%_Groups.txtEcho USERDNSDOMAIN = %USERDNSDOMAIN% >>c:\%COMPUTERNAME%_Groups.txtEcho. >>c:\%COMPUTERNAME%_Groups.txtEcho Where a computer is in AD: >>c:\%COMPUTERNAME%_Groups.txtdsquery computer -name %computername% >>c:\%COMPUTERNAME%_Groups.txtEcho. >>c:\%COMPUTERNAME%_Groups.txtEcho What groups computer is a member of: >>c:\%COMPUTERNAME%_Groups.txtdsquery computer -name %computername% | dsget computer -memberof >>c:\%COMPUTERNAME%_Groups.txtEcho ------------------------------------------------------- >>c:\%COMPUTERNAME%_Groups.txtEcho. >>c:\%COMPUTERNAME%_Groups.txtEcho Geting Server installed products ...WMIC /APPEND:c:\%COMPUTERNAME%_Groups.txt PRODUCTEcho ------------------------------------------------------- >>c:\%COMPUTERNAME%_Groups.txtEcho. >>c:\%COMPUTERNAME%_Groups.txtEcho Geting Server roles ...ServerManagerCmd.exe -query >>c:\%COMPUTERNAME%_Groups.txtEcho ----------------------------------------------------- >>c:\%COMPUTERNAME%_Groups.txtEcho. >>c:\%COMPUTERNAME%_Groups.txtEcho Geting Server Local Groups Members ... >>c:\%COMPUTERNAME%_Groups.txtEcho ------------------------------------------------------- >>c:\%COMPUTERNAME%_Groups.txtEcho. >>c:\%COMPUTERNAME%_Groups.txtfor /F "tokens=*" %%* in ('net localgroup ^| find "*"') do call :Sub %%*set parm=GroupREM Run only on DC:: for /F "tokens=*" %%* in ('net groups /domain ^| find "*"') do call :Sub %%*notepad c:\%COMPUTERNAME%_Groups.txtgoto :eof:Subset name=%*echo Group name: %name%echo %parm% name: %name:~1% >> c:\%COMPUTERNAME%_Groups.txtnet %parm% "%name:~1%" | find /i /v "completed successfully" | more +6 >>c:\%COMPUTERNAME%_Groups.txt List all installed updates in one line:wmic qfe list full /format:htableHow to create a collection excluding members from another collection.The answer to that question is based on the knowledge that every collection you make in SCCM creates its own wmi class. The class will be named sms_cm_ress_coll_collectionid.
To create exclusion 1) Create your collection 2) Add a query based membership rule to your collection 3) Edit the query statement of the collection 4) On the criteria tab add a criteria 5) For the attribute class select System Resource, and use Resource Id for the attribute 6) For the criteria type use subselect 7) For the operator select "Not In" 8) In the query box type select resourceid from sms_cm_res_coll_collectionid. Now we need to figure out the collection id,: 1) Go to queries
2) Right-click and select new query 3) Make sure you specify <unspecified> in the Object type dialog. 4) Press the Edit Query button 5) Paste the following query in the Query statement box that opens up: select collectionid, name from sms_collection where name like ##PRM:SMS_collection.Name## Note: You can use the _ and % wildcard signs when you input the collection name. |