Restricted user accounts can't import Carbon

Create issue
Issue #180 resolved
Terry Cai created an issue

Hi there,

We used to use Carbon 1.9 and recently decided to upgrade to 2.0

Due to the production environment, we have to run as a restricted service account to import carbon. This worked fine in 1.9.

After upgrading to 2.0, we got a access error at the line in Carbon.psm1:

$useWmi = (Get-WmiObject -Class 'Win32_OptionalFeature' -ErrorAction Ignore) -ne $null

We got a workaround at the moment by replacing it with the line in Carbon 1.9 and works fine.

$useWmi = (Get-WmiObject -List -Namespace 'ROOT\cimv2' | Where-Object { $_.Name -eq 'Win32_OptionalFeature' }) -ne $null

The OS Version is Windows 2012, let me know if you need more information. Thanks.

Comments (7)

  1. Aaron Jensen repo owner

    I made the change for performance reasons: getting all WMI classes is slow. Does this work?

    $useWmi = (Get-WmiObject -List -Class 'Win32_OptionalFeature') -ne $null
  2. Terry Cai reporter

    Thanks for the quick response.

    The account can be a local windows account, the key is that it's not a local administrator, just a regular user but it has been granted "Log on as a batch job" rights.

  3. Log in to comment