MarshMan0331 Posted April 3, 2013 Report post Posted April 3, 2013 Need help building a Device collection for Machines that have AHCI enabled in the SATA operation in the BIOS Settings. Thanks Garrett Quote Share this post Link to post Share on other sites More sharing options...
0 Peter33 Posted April 4, 2013 Report post Posted April 4, 2013 You could do that with the help of some "Compliance Baselines". Here is how i would do it for Lenovo Machines. First create a new script based Compliance Setting Then create a new compliance baseline with this Settings and deploy it to some collection. Right click the new deployment and create a new "compliant collection". This collection will hold all Lenovo machines with AHCI enabled. $ahci = gwmi -Namespace root\wmi -Class Lenovo_BiosSetting -ErrorAction SilentlyContinueif( $ahci -is [Object]){ foreach($setting in $ahci){ if($setting.CurrentSetting -clike "*SATA*AHCI*"){ return($true) } }}return($false) Quote Share this post Link to post Share on other sites More sharing options...
0 Peter33 Posted April 4, 2013 Report post Posted April 4, 2013 OK, here is a simplified script, working for Lenovo and HP machines. $lenovo = gwmi -Namespace root\wmi -Class Lenovo_BiosSetting -ErrorAction SilentlyContinue | Where-Object {$_.CurrentSetting -clike "*SATA*AHCI*"} $hp = gwmi -Namespace root\hp\instrumentedBIOS -Class HP_BIOSSetting -ErrorAction SilentlyContinue | Where-Object {$_.CurrentValue -eq "AHCI"} if( ( $lenovo -is [Object] ) -or ( $hp -is [Object] ) ){ return($true) } return($false) Quote Share this post Link to post Share on other sites More sharing options...
0 MarshMan0331 Posted April 4, 2013 Report post Posted April 4, 2013 OK, here is a simplified script, working for Lenovo and HP machines. $lenovo = gwmi -Namespace root\wmi -Class Lenovo_BiosSetting -ErrorAction SilentlyContinue | Where-Object {$_.CurrentSetting -clike "*SATA*AHCI*"} $hp = gwmi -Namespace root\hp\instrumentedBIOS -Class HP_BIOSSetting -ErrorAction SilentlyContinue | Where-Object {$_.CurrentValue -eq "AHCI"} if( ( $lenovo -is [Object] ) -or ( $hp -is [Object] ) ){ return($true) } return($false) We have all Dells in the Enterprise. Would i just change the name to Dell? Thanks for the information above. Quote Share this post Link to post Share on other sites More sharing options...
0 Peter33 Posted April 4, 2013 Report post Posted April 4, 2013 I have no Dell to test it but the following script should work ...... now for Lenovo, HP and Dell $lenovo = gwmi -Namespace root\wmi -Class Lenovo_BiosSetting -ErrorAction SilentlyContinue | Where-Object {$_.CurrentSetting -clike "*SATA*AHCI*"} $hp = gwmi -Namespace root\hp\instrumentedBIOS -Class HP_BIOSSetting -ErrorAction SilentlyContinue | Where-Object {$_.CurrentValue -eq "AHCI"} $dell = gwmi -Namespace root\dellomci -Class Dell_SMBIOSSettings -ErrorAction SilentlyContinue | Where-Object {$_.IntegratedSATAController -eq "AHCI"} if( ( $lenovo -is [Object] ) -or ( $hp -is [Object] ) -or ( $dell -is [Object] ) ){ return($true) } return($false) Quote Share this post Link to post Share on other sites More sharing options...
Need help building a Device collection for Machines that have AHCI enabled in the SATA operation in the BIOS Settings.
Thanks
Garrett
Share this post
Link to post
Share on other sites