CS.ini automatically select task sequence based on model - sccm

What I want to accomplish is for MDT to automatically select the task sequence based on the model, and if there is no match to run a generic deployment. but it's not selecting the task sequence automatically. any idea, how can i achieve this goal. Thanks
[Settings]
Priority=Models,Default
Properties=MyCustomProperty, ShortModel
[Default]
_SMSTSOrgName=myCompany
SkipAppsOnUpgrade=NO
UserDatalocation=AUTO
OSDComputerName=#Left("%Model%",4)#
DoCapture=NO
OSInstall=YES
SkipAdminPassword=YES
SkipBDDWelcome=YES
SkipBitLocker=YES
SkipCapture=YES
SkipComputerName=YES
SkipFinalSummary=YES
SkipLocaleSelection=YES
SkipProductKey=YES
SkipSummary=YES
SkipTaskSequence=NO
SkipComputerBackup=YES
SkipTimeZone=YES
SkipUserData=YES
TimeZone=035
TimeZoneName=Eastern Standard Time
[Models]
ShortModel=#Left("%Model%",4)#
Subsection=TS-%ShortModel%
[TS-20L8]
TaskSequenceID=TS-20L8
SkipApplications=YES
SkipTaskSequence=Yes
[TS-20QG]
TaskSequenceID=TS-20QG
SkipApplications=NO

Finally, after hours of search, I found that this method works perfectly for Dell and HP series whereas for Lenovo you have to make some changes in the ZtiGather script to get the proper model of the system.
reference link: [%make% and %model%][1]
[Settings]
Priority=make,Default
[Default]
_SMSTSOrgName=myCompany
SkipAppsOnUpgrade=NO
UserDatalocation=AUTO
DoCapture=NO
OSInstall=YES
SkipAdminPassword=YES
SkipBDDWelcome=YES
SkipBitLocker=YES
SkipCapture=YES
SkipComputerName=YES
SkipFinalSummary=YES
SkipLocaleSelection=YES
SkipProductKey=YES
SkipSummary=YES
SkipTaskSequence=NO
SkipComputerBackup=YES
SkipTimeZone=YES
SkipUserData=YES
TimeZone=035
TimeZoneName=Eastern Standard Time
[TS-20L8]
TaskSequenceID=TS-20L8
SkipApplications=YES
[TS-20QG]
TaskSequenceID=TS-20QG
SkipApplications=NO
[1]: https://social.technet.microsoft.com/Forums/lync/en-US/20b88227-2bd6-4279-8752-58773274c6ce/make-and-model?forum=mdt

Related

Grab scenario information in Before and After hooks?

Right now I am trying to grab the information from the current scenario (description, file path, name, etc.). I try to get the scenario information in the before hook like this
Before do |scenario|
puts scenario.name
puts scenario.description
#etc.
end
however things like scenario.description are not available for use. This is because when running in both Before and After hook, scenario is being called as Cucumber::RunningTestCase::Scenario instead part of the core AST module, like feature. I want to be able to access the scenario from Cucumber::Core::Ast::Scenario and Cucumber::Core::Ast::OutlineTable::ExampleRow, where values like current scenario description is available. Is it possible to get access to Cucumber::Core::Ast::Scenario in before and after hooks instead of Cucumber::RunningTestCase::Scenario, or another way to grab information like scenario name, description, file path, etc.? This is using the latest version of the cucumber and cucumber core gems (2.4 and 1.5). In addition, I am also no longer to able to access information about the current step, and step count.
Before do |scenario|
all_sources = scenario.outline? ? scenario.scenario_outline.all_source : scenario.all_source
end
From the all_source variable you will have access to several objects from ::Ast
Scenario Outline:
Cucumber::Core::Ast::Feature
Cucumber::Core::Ast::ScenarioOutline
Cucumber::Core::Ast::Examples
Cucumber::Core::Ast::ExamplesTable::Row:
Cucumber::Core::Ast::ExpandedOutlineStep
Scenario:
Cucumber::Core::Ast::Feature
Cucumber::Core::Ast::Scenario
Cucumber::Core::Ast::Step
From these you should be able to get data about file path, descriptions, comments, tags, hooks, line numbers and so on.

Dynamically changing 'teamcity.build.branch'

I want to set the value of 'teamcity.build.branch' dynamically according to the result of another TC build configuration part of the build pipeline.
Is that even possible? It looks like the value is evaluated and used at the start of the build pipeline.
UseCase:
I am executing a TC build configuration that will generate a unique number
in the connected TC build configuration part of the same pipeline I want the number to be used in the 'teamcity.build.branch' - just for visualization purposes
I am already using message service to overwrite the parameter, but the change is not taken into account. It looks like the value is read in the very early stage of the build process.
Check below reference containing build number and git branch name
https://octopus.com/blog/teamcity-version-numbers-based-on-branches
You could overwrite the value of the parameter by using a simple script that emits a "set parameter" service message.
By using a dedicated service message in your build script, you can dynamically update build parameters of the build right from a build step (...)
With that approach, here are the steps that you need to perform:
In the first build config, define a custom build parameter and set its value to the unique number you're generating. Do this directly from the script that generates the unique number by writing something like this to STDOUT:
##teamcity[setParameter name='magicNumber' value='1234']
In the dependent build config, you now have access to that parameter. Using a second build script, you can overwrite the teamcity.build.branch with the same mechanism:
##teamcity[setParameter name='teamcity.build.branch' value='the new value']
Note 1: I recommend against overwriting the built-in parameters, because this might have strange side-effects. Rather, define a custom parameter in the second build config and use that for your visualization purposes.
Note 2: In case you decide to ignore Note 1, it may be necessary to overwrite the build parameters by setting the dependency property as outlined in the docs in section "Overriding Dependencies Properties":
##teamcity[setParameter name='reverse.dep.*.teamcity.build.branch' value='the new value']

Puppet: Making a custom function depend on a resource

I have a Puppet custom function that returns information about a user defined in OpenStack's Keystone identity service. Usage is something along the lines of:
$tenant_id = lookup_tenant_by_name($username, $password, "mytenant")
The problem is that the credentials used in this query ($username) are supposed to be created by another resource during the Puppet run (a Keystone_user resource from puppet-keystone). As far as I can tell, the call to the lookup_tenant_by_name function is being evaluated before any resource ordering happens, because no amount of dependencies in the calling code is able to force the credentials to be created prior to this function being executed.
In general, it is possible to write custom functions -- or place them appropriately in a manifest -- such that they will not be executed by Puppet until after some specified resource has been instantiated?
Short answer: You cannot make your manifest's behavior depend on resources declared inside of it.
Long answer: Parser functions are called during the compilation phase (on the master if you use one, or the agent if you use puppet apply). In neither case can it ever run before any resource is synced, because that will happen after the compiler has done all its work (including invocation of your functions).
To query information from the agent machine, you generally want to use custom facts. Still, those will be populated before even the compiler run.
Likely the best approach in this situation is to make the manifest tolerate the absence of the information, so that anything that depends on the value that your lookup_tenant_by_name function returns will only be evaluated if that value is available. This will usually be during the second Puppet run.
if $tenant_id == "" {
notify { "cannot yet find tenant $username": }
}
else {
# your code using the tenant ID
}

HP UFT API Test - Saving Response/Checkpoint values

Is there a way to capture and store (or write to a file) the values returned in the Response? (Checkpoint values)
Using HP UFT 11.52
Thanks,
Lynn
I figured it out. In UFT API under Standard Activities, there are File function modules including "Write to File". I added the module to the test, set the path and other properties, passed the variable to the file and it worked! Couldn't be easier.
I mentioned this on my other answer , you can also write it programatically if you have dynamic array response please refer below:
https://stackoverflow.com/a/28012383/3972994
After running a test, in the test folder, you can find a Snapshots/LastIteration directory.
In it you can find the return value for each step saved in a txt file.
Pay attention that if you data drive the step, only the last iteration will be saved to file.
However, in the Test's log (Test dir/Log/vtd_user.log) you can find all the iterations persisted
Thanks,
Yossi
You do not need to use the standard activities if you do this
var iResponse = this.Activity.responsebody;
System.IO.File.WriteLines(#"directorypath&FileName);
the above will write the response to the file and rewrite it for every run

Get Garbage Collector metrics using WMI

I need to collect metrics about the Percent Time in GarbageCollector using WMI Classes for Windows servers. I'm using the Class: "Win32_PerfRawData_NETFramework_NETCLRMemory".
Is this correct?
Then I take two samples for that class and i made the following calculation:
# PSEUDO CODE
PercentTime in GC =
(
(sample2->'PercentTimeinGC' - sample1->'PercentTimeinGC') /
(sample2->'TimeStamp_Sys100NS' - sample1->'TimeStamp_Sys100NS')
)
This calculation is definitively wrong, how to do it in the right way?
Tks in advance.
gulden
After some digging in the unknown world of windows I've found the solution:
I've started with this link that explains the calculation methods for each kind of metric:
http://msdn.microsoft.com/en-us/library/ms974615.aspx
However, we need to know the countertype, in this case the countertype for "PercentTimeinGC". To know that i need to run the WEBMTest.exe program:
http://technet.microsoft.com/en-us/library/cc180684.aspx
Connect to "root\CIMV2"
Open Class... "Win32_PerfRawData_NETFramework_NETCLRMemory"
Select the property "PercentTimeinGC"
Click in the button "Show MOF"
Find the line:
"[DisplayName("% Time in GC"): ToInstance, countertype(537003008): ToInstance, perfindex(2606): ToInstance, helpindex(2607): ToInstance, defaultscale(0): ToInstance, perfdetail(100): ToInstance] uint32 PercentTimeinGC;"
Now that we know the countertype (537003008), you need to map it to a human readable form. This link will help:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa389383(v=vs.85).aspx
The mapping for coutertype 537003008 is PERF_RAW_FRACTION.
We go back for the first link and find the calculation method for PERF_RAW_FRACTION that is:
(100 * CounterValue) / BaseValue
I love windows.
gulden

Resources