I am trying to use Dell Bios Manger to push bios passwords to users. I have deployed the manager already to all machines. Now I deployed another script to modify the password of the bios so end users are unable to change boot order.
$DellModulePath = "C:Program FilesWindowsPowerShellModulesDellBIOSProvider"
cd $DellModulePath
# Import the DellBIOSProvider module
Import-Module DellBIOSProvider
try {
# Check if the admin password is set by retrieving the current value
$isPasswordSetItem = Get-Item -Path DellSmbios:SecurityIsAdminPasswordSet
$currentValue = $isPasswordSetItem.currentValue
if ($currentValue -eq "False") {
# If the password is not set, define the new admin password
$adminPassword = "PASSWORD"
# Set the admin password
Set-Item -Path DellSmbios:SecurityAdminPassword -Value $adminPassword
# Verify if the admin password is set
$isPasswordSetItem = Get-Item -Path DellSmbios:SecurityIsAdminPasswordSet
$currentValue = $isPasswordSetItem.currentValue
Write-Output "Is Admin Password Set: $currentValue"
} else {
Write-Output "Admin password is already set."
}
} catch {
Write-Error "An error occurred: $_"
}
I push this as a win32 app via Intune – and also via scripts in intune becuase I could get more info on its failure.
When ran as a script on a test machine target I get this error:
"ResultDetails"="{"Version":1,"SigningCode":649,"EncryptionCode":633,"SigningMsg":"(Success) AccountId:DELETED,PolicyId:DELETED,Type:1,Enforce: Enforcement1. OSVersion:10.0.22631,AgentVersion:N/A ","EncryptMsg":"run in legacy mode","ExecutionMsg":"Import-Module : The specified module 'DellBIOSProvider' was not loaded because no valid module file was found in any \r\nmodule directory.\r\nAt C:\\Program Files (x86)\\Microsoft Intune Management \r\nExtension\\Policies\\Scripts\\80c42a96-31c9-49df-83a8-5f1cb24b6d83_d8b4c279-babd-4f48-8de0-6e09d55e43f1.ps1:12 char:1\r\n+ Import-Module DellBIOSProvider\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ResourceUnavailable: (DellBIOSProvider:String) [Import-Module], FileNotFoundException\r\n + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand\r\n \r\nGet-Item : Cannot find drive. A drive with the name 'DellSmbios' does not exist.\r\nAt C:\\Program Files (x86)\\Microsoft Intune Management \r\nExtension\\Policies\\Scripts\\80c42a96-31c9-49df-83a8-5f1cb24b6d83_d8b4c279-babd-4f48-8de0-6e09d55e43f1.ps1:16 char:26\r\n+ ... swordSetItem = Get-Item -Path DellSmbios:\\Security\\IsAdminPasswordSet\r\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\r\n + CategoryInfo : ObjectNotFound: (DellSmbios:String) [Get-Item], DriveNotFoundException\r\n + FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetItemCommand\r\n \r\n\r\n"}"
It seems to be trying to find the module in this folder:
C:Program Files (x86)Microsoft Intune Management ExtensionPoliciesScripts
But that isnt where I specified the script to drill to:
${env:ProgramFiles}DellPowerShellModules
What is this behavior? How do I get it to access the right folder?