2SR82 Posted March 6, 2014 Report post Posted March 6, 2014 Hi, is it possible to build a collection based on the content of a cfg/txt file? i have an program which can be used with different licences. the basic data of the program are the same. it only differs in one single config file where stands a path to a different file on a server. Is there a way to analyse the content of a specific line in that file and build collections based on that content? Quote Share this post Link to post Share on other sites More sharing options...
Peter van der Woude Posted March 6, 2014 Report post Posted March 6, 2014 Not out-of-the-box. The only thing I can think of is creating a script that will read the file, write something to WMI, or registry and pick that information up with an inventory. Quote Share this post Link to post Share on other sites More sharing options...
Peter33 Posted March 6, 2014 Report post Posted March 6, 2014 $ErrorActionPreference="Stop" $file = $env:LOCALAPPDATA + "Low\Sun\Java\Deployment\security\exception.sites" $servers = @( "http://yoururlhere.com", "https://anotherurl.net" ) if(Test-Path $file){ foreach($server in $servers){ if(!(Select-String $file -pattern $server)){return($false)} } } else{return($false)} return($true) You can do that by creating a compliance rule. Based on the deployment of the rule you can create compliant, non compliant and error collections. Here is a little sample script to check multiple strings against a local file. Quote Share this post Link to post Share on other sites More sharing options...