Re: sms_def.mof - Need only selected environment variables



if you go to a command prompt and type in "set" these variables you want
show up as O-ODP, O-IHT, etc... right?

Use the code i sent before and change the SELECT statement to:

{"SELECT * FROM Win32_Environment WHERE SystemVariable=true AND Name='O-ODP'
OR NAME='O-IHT' OR NAME='ETC...'"},

Behold the power of the mof lol

MOF Master--with a sense of humor

"Chris" <Chris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:21C314FD-94FE-40B1-918A-14D05BCC7AEE@xxxxxxxxxxxxxxxx
> I'm very confused. I'm not sure how the instance_provider code is going
> to
> locate only the system variables I want(O-ODP, O-IHT, ect.) and display
> only
> those in Resource Explorer. I'm assuming that I still need to turn on
> win32_environement reporting. If that's the case won't I still pull all
> Environment data into Resource Explorer in addition to a new group name
> call
> "System Variables? This is what I enabled previsouly in the sms_def.mof.
> Does this still need to be enabled?
>
> [ SMS_Report (TRUE),
> SMS_Group_Name ("Environment"),
> SMS_Class_ID ("MICROSOFT|ENVIRONMENT|1.0") ]
>
> class Win32_Environment : SMS_Class_Template
> {
> [SMS_Report (FALSE) ]
> string Caption;
> [SMS_Report (FALSE) ]
> string Description;
> [SMS_Report (FALSE) ]
> datetime InstallDate;
> [SMS_Report (TRUE), key]
> string Name;
> [SMS_Report (FALSE) ]
> string Status;
> [SMS_Report (FALSE) ]
> boolean SystemVariable;
> [SMS_Report (FALSE), key]
> string UserName;
> [SMS_Report (TRUE) ]
> string VariableValue;
> };
>
>
>
> "Jeff Gilbert" wrote:
>
>> You can use a WQL query to pull only system variables from the
>> Win32_Environment Class in your mof, you could even get really sneaky and
>> say where SystemVariable=True and Name=whatever to pull individual
>> variables
>> instead of them all:
>>
>> #pragma namespace("\\\\.\\root\\cimv2")
>>
>> [Union,
>> ViewSources{"SELECT * FROM Win32_Environment where SystemVariable=true"},
>> ViewSpaces{"\\\\.\\root\\cimv2"},
>> dynamic, provider("MS_VIEW_INSTANCE_PROVIDER")]
>> class SysVarNames
>>
>> {
>> [PropertySources{"Name"},Key] string Name;
>> [PropertySources{"UserName"},Key] string UserName;
>> [PropertySources{"VariableValue"}] string VariableValue;
>> };
>>
>> //Define the Reporting Class
>>
>> //system variable names and values
>> #pragma namespace("\\\\.\\ROOT\\CIMV2\\SMS")
>> #pragma deleteclass("SysVarNames",NOFAIL)
>>
>> [SMS_Report(TRUE),SMS_Group_Name("System
>> Variables"),SMS_Class_ID("SMSExpert|SysVarNames|1.0")]
>> class SysVarNames : SMS_Class_Template
>> {
>> [SMS_Report(TRUE),KEY] string Name;
>> [SMS_Report(TRUE),KEY] string UserName;
>> [SMS_Report(TRUE)] string VariableValue;
>> };
>>
>> Compiling this on your Advanced Clients locally and adding it to your
>> sms_def.mof on the site server will give you the below info:
>>
>>
>>
>>
>> "Chris" <Chris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> news:78CDC40C-4588-4995-B4F9-3F55AEF400D6@xxxxxxxxxxxxxxxx
>> > Thanks, Kim. I'm interested in getting selected system environment
>> > variables
>> > into inventory. It seems the mof language does not like the dash we're
>> > using(O-IDP) for our values, as it treats it as a minus instead and
>> > won't
>> > compile. I've turned on the Win32_environment but now we're getting
>> > everything. Just wondering if there's a way to filter this to get only
>> > the
>> > variables we need, or to make the previous Property Provider code work.
>> > -Chris
>> >
>> >
>> > **************
>> > I assume you could do this using the wmi view instance provider.
>> > You could repost this in the .inventory group where Jeff Gilbert (Our
>> > new
>> > mofmaster (now with a sense of humour)) is most active.
>> >
>> > --
>> > Kim Oppalfens
>> > Telindus Belgium
>> > MVP Windows Server System - SMS
>> > "Chris" <Chris@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
>> > news:8E647DFD-C7E6-4757-BE78-EF6171292CFF@xxxxxxxxxxxxxxxx
>> >> Actually I was able to gather data from the Win32_environment class
>> >> but
>> >> I'm
>> >> getting everything. I'm wondering if there's a way to leverage this
>> >> to
>> >> just
>> >> get 3 or 4 known environment variables.
>> >>
>> >> "Chris" wrote:
>> >>
>> >>> Jamie, thanks for your reply. I changed all the instances from O-IDP
>> >>> to
>> >>> O_IDP, except where it's referenced in the registry path. I also
>> >>> changed
>> >>> the
>> >>> keyname from "session manager" to environment. It now compiles
>> >>> without
>> >>> errors. I copied it to our lab sms_def.mof and recompiled it on the
>> >>> W2K3
>> >>> site server. When I run WBEMTEST I see an entry under root\cimv2\sms
>> >>> called
>> >>> TruEnv and a property titled O_IDP within it, but I don't see any
>> >>> data
>> >>> collected for the value for the O-IDP key. I also changed the actual
>> >>> reg
>> >>> key
>> >>> to O_IDP and modified the path in the mof accordingly but still no
>> >>> data
>> >>> collected. After running a HW scan I also don't see a TruEnv entry
>> >>> in
>> >>> Resource Explorer.
>> >>>
>> >>> "JaimePA" wrote:
>> >>>
>> >>> > Hi Chris,
>> >>> >
>> >>> > Try to change the "O-IDP" by "O_IDP" (all the instances)
>> >>> >
>> >>> > The "-" sign is interpreted by the compiler as a minus sign
>> >>> >
>> >>> > Cheers,
>> >>> > JaimePA
>> >>> >
>> >>> > Change
>> >>> >
>> >>> > "Chris" wrote:
>> >>> >
>> >>> > > Our company pc's have different system variables that identify
>> >>> > > the
>> >>> > > dept. of
>> >>> > > the user. We want to import this info into SMS via sms_def.mof
>> >>> > > We're at SMS
>> >>> > > 2003. I have a test mof that I am unable to do a test compile
>> >>> > > on(mofcomp.exe
>> >>> > > -check test.mof). I keep getting the following error:
>> >>> > >
>> >>> > > a:\tru_env.mof (29): error SYNTAX 0X0067: Expected semicolon or
>> >>> > > '='
>> >>> > > Compiler returned error 0x67
>> >>> > >
>> >>> > > Here is the test mof that I'm trying to compile:
>> >>> > >
>> >>> > > //---------------------------------------------------------------------------
>> >>> > > //Start of TruEnv Information
>> >>> > > //---------------------------------------------------------------------------
>> >>> > >
>> >>> > > //Register the Registy Property Provider
>> >>> > > #pragma namespace("\\\\.\\root\\cimv2")
>> >>> > >
>> >>> > > instance of __Win32Provider as $PropProv3
>> >>> > > {
>> >>> > > Name ="RegPropProv" ;
>> >>> > > ClsID = "{72967901-68EC-11d0-B729-00AA0062CBB7}";
>> >>> > > ImpersonationLevel = 1;
>> >>> > > PerUserInitialization = "FALSE";
>> >>> > > };
>> >>> > > instance of __PropertyProviderRegistration
>> >>> > > {
>> >>> > > Provider =$PropProv2;
>> >>> > > SupportsPut =TRUE;
>> >>> > > SupportsGet =TRUE;
>> >>> > > };
>> >>> > >
>> >>> > >
>> >>> > > //Define the Data Class
>> >>> > > [DYNPROPS]
>> >>> > > class TruEnv
>> >>> > > {
>> >>> > > [KEY] string KeyName = "";
>> >>> > > string O-IDP;
>> >>> > > };
>> >>> > >
>> >>> > > //Define the Instance of the Data Class
>> >>> > > [DYNPROPS]
>> >>> > > instance of TruEnv
>> >>> > > {
>> >>> > > KeyName="Session Manager";
>> >>> > >
>> >>> > > [PropertyContext("local|HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session
>> >>> > > Manager\\Environment|O-IDP"),
>> >>> > > Dynamic,Provider("RegPropProv")] O-IDP;
>> >>> > > };
>> >>> > >
>> >>> > > //Define the Reporting Class
>> >>> > > #pragma namespace("\\\\.\\ROOT\\CIMV2\\SMS")
>> >>> > >
>> >>> > > [SMS_Report(TRUE),SMS_Group_Name("TruEnv"),SMS_Class_ID("Microsoft|TruEnv|1.0")]
>> >>> > > class TruEnv : SMS_Class_Template
>> >>> > > {
>> >>> > > [SMS_Report(TRUE),KEY] string KeyName;
>> >>> > > [SMS_Report(TRUE)] string O-IDP;
>> >>> > > };
>> >>> > > //------------------------------------------------------------------------------------------------------------------
>> >>> > > //End of TruEnv Information
>> >>> > > //------------------------------------------------------------------------------------------------------------------
>> >>> > >
>> >>> > > Any help would be appreciated. Thanks, Chris
>> >>> > >
>> >
>> >
>>
>>
>>


.



Relevant Pages

  • Re: SMS 2003 advanced client mof distribution / compilation practice
    ... everyday that you need to recompile your mof. ... "Kim Oppalfens" wrote in message ... > sms_def.mof that is automatically updated on the distribution points ... >> provider) must be manually compiled on the advanced client before the new ...
    (microsoft.public.sms.inventory)
  • Re: sms_def.mof - Need only selected environment variables
    ... If that's the case won't I still pull all ... "System Variables? ... or to make the previous Property Provider code work. ... >> Kim Oppalfens ...
    (microsoft.public.sms.inventory)
  • Re: Software Update Report - applicsu.mof [1/1]
    ... I was using the IE news reader. ... "Kim Oppalfens" wrote: ... >> canned reports or quesries for this as well but did not see the attached mof. ... >>> Computacenter Belgium ...
    (microsoft.public.sms.inventory)
  • Re: Internet Explorer version inventory
    ... I haven't seen anything more comprehensive than Michael Schultz Mof ... Kim Oppalfens ... >> class InternetExplorerInfo ... Check out the SMS Technical FAQ: ...
    (microsoft.public.sms.inventory)

Loading