

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
VBS in OMi - How to get parameters?
Hello,
I got some problems running perl on Windows, so I decided to translate to VBS.
the problem is that I didn't found documentation how to use VBS in OMi.
In perl I use:
To set Session variable:
$Session->Value(errors, $errors);
To get Source value:
my $ResGroupName2 = $Policy->Source("ResGroupName")->Value();
To get parameters and set to Session:
my $PolicyRegex; $PolicyRegex = $OVOSystem->ParameterGetString("PolicyRegex","%%PolicyRegex%%"); $Session->Value("PolicyRegex", $PolicyRegex);
In VBS I know:
To set Session variable:
Session ("FSDrive") = drive
To get Source value:
Policy.Source("ResGroupName")
To get parameters
????
Someon could help me?
Regards,
Diego Pereira

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
In OMi policies, you should just be able to use %%parameter_name%%. Eg, in Perl:
my $minorThreshold = %%My_Minor_Threshold%%;
$Session->Value('minorThreshold', $minorThreshold);
Sorry I don't remember how to do VBScript.
CP.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello @Diego_Pereira
I believe you don't need $OVOSystem->ParameterGetString or equivalent VBScript syntax at all to read the parameters.
What you can do is export policy from OMW/U/L which uses $OVOSystem->ParameterGetString in it, import it to OMi and figure out the difference. i doubt that conversion will show $OVOSystem->ParameterGetString at all as parameter handing differ in OMi in compare to OMW/U/L.
I don't know if %% will cover both VBScript and perl parameter? if not then use "@@" instead %%. i have a tool created which uses vbscript and in this i faced similar problem and it was solved by using "@@" so may work in policy too.
HTH
-KAKA-


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hi KAKA_2,
Thanks for the help, but I didn't have OMW/U/L, I have only OMi.
The problem is in perl on Windows sometimes doesn't work properly, so I decided to translate the logic to VBS, but the problem is that I can get the parameters in OMi besides I don't know the sintax to use as I mentioned in the topic.
So I need to know how to get the parameters using VBS.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Hello Diego,
have you tried what Carol proposed? OMi just replaces the parameter if you embedd it via %%.
E.g. in vbs
ParameterValue = "%%PARA1%%"
Kind regards,
Harald


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
Session("PolicyRegex") = %%PolicyRegex%%
for your VB Script.
another option you have is to create the parameter using GUI available in policy editor and then you can drag and drop in your policy as per your need. GUI provide other advance option like setting up the data type and so.
Hope this helps.
-KAKA-


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
I tried using what you said, but I think I got other problem, I will try using a simple example to test and I will let you know and accept as solution if worked.