Home
»
Discussion Forums
»
Scripts & Agent Procedures
»
Problem using Database View vMachine.OsType variable in script IF condition
Subscribe via RSS
Share this
Similar Posts
#vloginName# Database View Variable
by
Randal
on
Jun 25, 2011
Not Answered
Database Views Problem
by
LegacyPoster
on
Mar 19, 2009
Database view variables in Service desk procedures
by
Divvet
on
Oct 17, 2013
Problem with updating Variable in script.
by
andy-genMSP
on
Sep 28, 2010
Verified Answer
custom database views for use within scripts?
by
LegacyPoster
on
Oct 22, 2008
View More
Details
1
Reply
0
Subscribers
Posted
over 11 years ago
Scripts & Agent Procedures
Problem using Database View vMachine.OsType variable in script IF condition
Posted by
LegacyPoster
on
Sep 7, 2008 7:54 PM
Okay, call me stupid, but I can't seem to figure this one out...
I am trying to develop a script to Disable UAC. I have the registry keys to change (from another thread regarding JKDEFRAG). But I am trying to make a more generic/general master script that I can call from many places. I am stuck on the very first test in the very first script.
BACKGROUND: I am trying to write the script so that I can call it from many different scripts. My first check is to see if the system is running Vista. I know that I could put a script condition when calling the script (ie. instead of Perform step X on All Operatign Systems, just choose Windows Vista from the DropDown Box, but I am trying to plan ahead for the future. For example, I may need to call the scan Disable UAC script with running on a Windows 2008 box, or when running Windows 2012 or whatever they release in the future. So I gigure make a generic script that gets called, then have that script check conditions. In the future, I just change by Disable UAC script to also run for 2008, 2012, etc - and no need to edit all of my other scripts.
Sounded simple to me. But I am stuck on the very first IF condition. I am using the vMachine.OsType Database View variable on my IF confition. But my script runs ELSE no matter what - if the system is running XP, Vista, etc.
In the script, I write the contents of vMachine.OsType Database View variable to the Script Log, which if you run it on a Vista machine, it records that vMachine.OsType=Vista.
I must be doing something wrong, but I can not figure it out.
Thanks in advance for the help.
==================
Script Name: Disable UAC 1
Script Description: Checks to see if the Operating System is Vista.
IF Check Variable
Parameter 1 : #vMachine.OsType#
Contains : Vista
THEN
Write Script Log Entry
Parameter 1 : vMachine.OsType = #vMachine.OsType#. Need to confirm/set UAC to Disabled.
OS Type : 0
ELSE
Write Script Log Entry
Parameter 1 : vMachine.OsType = #vMachine.OsType#. No need to worry about UAC.
OS Type : 0
==================
Legacy Forum Name: Problem using Database View vMachine.OsType variable in script IF condition,
Legacy Posted By Username: lwolf
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
Posted by
LegacyPoster
on
Sep 7, 2008 8:38 PM
Take the single space out before the word Vista in the Contains statement, i.e. instead of:
Contains : Vista
set it to
Contains :Vista
Legacy Forum Name: Scripts Forum,
Legacy Posted By Username: pcmnetmanage
You have posted to a forum that requires a moderator to approve posts before they are publicly available.