Bitlocker enable from Gpo

SismoL 5 Reputation points
2024-02-21T10:20:35.8166667+00:00

Hi, i try to enable bitlocker from gpo, i have create this script

Start-Transcript -Path "C:\temp\logscript.txt" -Append 
Set-ExecutionPolicy Unrestricted -Scope Process -Force
$bitlockerInstalled = Get-BitLockerVolume | Where-Object { $_.ProtectionStatus -eq 'On' }
if ($bitlockerInstalled) {
} else {
este
    Enable-BitLocker -MountPoint "C:" -EncryptionMethod XtsAes128 -UsedSpaceOnly -SkipHardwareTest -RecoveryPasswordProtector
}
Stop-Transcript

and deploy in more tipology (task scheduler, logon script). it work only if i log to user Admin.
when i create a task scheduler i have set to run with system account but problem not solved. i suppose the problem are that the user account not can't even give the command GET-BITLOCKERVOLUME:

C:\Users\test.bit> Get-BitLockerVolume
Get-CimInstance : Accesso negato
In C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\BitLocker\BitLocker.psm1:144 car:13
+             Get-CimInstance `
+             ~~~~~~~~~~~~~~~~~
    + CategoryInfo          : PermissionDenied: (root\cimv2\Secu...cryptableVolume:String) [Get-CimInstance], CimExcep
   tion
    + FullyQualifiedErrorId : HRESULT 0x80041003,Microsoft.Management.Infrastructure.CimCmdlets.GetCimInstanceCommand

Get-Win32EncryptableVolumeInternal : A  non è associato un volume BitLocker.
In C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\BitLocker\BitLocker.psm1:696 car:42
+ ...       $AllWin32EncryptableVolume = Get-Win32EncryptableVolumeInternal
+                                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], COMException
    + FullyQualifiedErrorId : System.Runtime.InteropServices.COMException,Get-Win32EncryptableVolumeInternal

anyone can help me?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,077 questions
0 comments No comments
{count} vote

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.