Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resource do not work on Windows 10 #47

Open
FrelVick opened this issue Feb 14, 2019 · 2 comments · May be fixed by #52
Open

Resource do not work on Windows 10 #47

FrelVick opened this issue Feb 14, 2019 · 2 comments · May be fixed by #52
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.

Comments

@FrelVick
Copy link

FrelVick commented Feb 14, 2019

Due to this function Assert-HasPrereqsForBitlocker the resource doesn't start on the Windows 10. If you perform all the steps manually it works perfectly.

Since Get-WindowsFeature doesn't exists on client OS the function throw

'Required Bitlocker features need to be installed before xBitlocker can be used'

which is not true for Pro, Enterprise, and Education editions of Windows 10.

if( ((Get-CimInstance -ClassName Win32_OperatingSystem).ProductType -eq 1) -and (get-command enable-bitlocker -ErrorAction SilentlyContinue)) then {It is a workstation with BitLocker available, don't throw}

Little check like that one could help you to avoid false negative assert.

Regards,
Viktor Frelikh

@mhendric mhendric added bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community. labels Feb 14, 2019
@mhendric
Copy link
Contributor

Looks like a bug to me. Thanks for the report!

FrelVick added a commit to FrelVick/xBitlocker that referenced this issue Feb 15, 2019
@SteveL-MSFT SteveL-MSFT added this to Help Wanted in powershell/dscresources May 14, 2019
@goldfinger2
Copy link

Can someone add the missing if statement and updated code as from FrelVick proposed.

`
function Assert-HasPrereqsForBitlocker
{
[CmdletBinding()]
param()

    $hasAllPreReqs = $true

    # 1 - Client   
    # 2 - Domaincontroller   
    # 3 - Server
    $osProductType = (Get-CimInstance -ClassName Win32_OperatingSystem).ProductType
    if ($osProductType -eq 1)
    {
        if (!(get-command enable-bitlocker -ErrorAction SilentlyContinue))
        {
            $hasAllPreReqs = $false
        }
    }
    else
    {
        $blFeature = Get-WindowsFeature BitLocker
        $blAdminToolsFeature = Get-WindowsFeature RSAT-Feature-Tools-BitLocker
        $blAdminToolsRemoteFeature = Get-WindowsFeature RSAT-Feature-Tools-BitLocker-RemoteAdminTool

        if ($blFeature.InstallState -ne 'Installed')
        {
            $hasAllPreReqs = $false

            Write-Error 'The Bitlocker feature needs to be installed before the xBitlocker module can be used'
        }

        if ($blAdminToolsFeature.InstallState -ne 'Installed')
        {
            $hasAllPreReqs = $false

            Write-Error 'The RSAT-Feature-Tools-BitLocker feature needs to be installed before the xBitlocker module can be used'
        }

        if ($blAdminToolsRemoteFeature.InstallState -ne 'Installed' -and (Get-OSEdition) -notmatch 'Core')
        {
            $hasAllPreReqs = $false

            Write-Error 'The RSAT-Feature-Tools-BitLocker-RemoteAdminTool feature needs to be installed before the xBitlocker module can be used'
        }
        
    }

    if ($hasAllPreReqs -eq $false)
    {
        throw 'Required Bitlocker features need to be installed before xBitlocker can be used'
    }
}

`

@mnothh mnothh linked a pull request Oct 4, 2019 that will close this issue
9 tasks
@SteveL-MSFT SteveL-MSFT removed this from Help Wanted in powershell/dscresources Nov 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug. help wanted The issue is up for grabs for anyone in the community.
Projects
None yet
3 participants