I am trying to grant access to my account on docker_engine service. Here is a reference link - https://github.com/tfenster/dockeraccesshelper
$account="<DOMAIN>\<USERNAME>"
$npipe = "\\.\pipe\docker_engine"
$dInfo = New-Object "System.IO.DirectoryInfo" -ArgumentList $npipe
**$dSec = $dInfo.GetAccessControl()**
$fullControl =[System.Security.AccessControl.FileSystemRights]::FullControl
$allow =[System.Security.AccessControl.AccessControlType]::Allow
$rule = New-Object "System.Security.AccessControl.FileSystemAccessRule" -ArgumentList $account,$fullControl,$allow
$dSec.AddAccessRule($rule)
$dInfo.SetAccessControl($dSec)
But this fails when on bolded code. Here is error that I see,
Exception calling "GetAccessControl" with "1" argument(s): "\\.\pipe\docker_engine"
At line:1 char:1
+ [System.IO.Directory]::GetAccessControl(“\\.\pipe\docker_engine”)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DirectoryNotFoundException
I confirmed that Docker service is running. Also when I run docker verison , it shows result with an error at the end -
Client:
Version: 24.0.4
API version: 1.43
Go version: go1.20.5
Git commit: 3713ee1
Built: Fri Jul 7 14:52:09 2023
OS/Arch: windows/amd64
Context: default
error during connect: in the default daemon configuration on Windows, the docker client must be run with elevated privileges to connect: Get "http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version": open //./pipe/docker_engine: The system cannot find the file specified.
I find this suspicious.