0

I have to check if a driver is installed on a virtual machine.
I need to output a drivers list using Powershell (msinfo32.exe -> Software Components, System Drivers).
The (impersonated) user account I want to check is "test".
When I run my command locally with "test" using Remote Desktop, it works fine, I get all drivers :

PS C:\Users\test> Get-WmiObject win32_systemdriver

So I can check if the concerned driver is running :

PS C:\Users\test> Get-WmiObject win32_systemdriver | Where-Object{$_.name -eq "vsepflt"}

DisplayName : VFileFilter
Name        : vsepflt
State       : Running
Status      : OK
Started     : True

Now I need to do this from my computer, but It doesn't output the full list (just 3 instead) :

PS C:\Users\lh> Get-WmiObject win32_systemdriver -ComputerName $ip -Credential $credTest

DisplayName : Common Log (CLFS)
Name        : CLFS
State       : Running
Status      : OK
Started     : True

DisplayName : NetBT
Name        : NetBT
State       : Running
Status      : OK
Started     : True

DisplayName : Remote Access Auto Connection Driver
Name        : RasAcd
State       : Stopped
Status      : OK
Started     : False

So of course I can't check the concerned driver, because it is not in the list, and it should be.

Note: it works if I use an Admin account as credential on the same VM, I get the full list. So I can look for my driver :

PS C:\Users\lh> Get-WmiObject win32_systemdriver -ComputerName $ip -Credential $credAdmin | Where-Object{$_.name -eq "vsepflt"}

DisplayName : VFileFilter
Name        : vsepflt
State       : Running
Status      : OK
Started     : True

That's what I need it to output from the "test" account

Why don't I get the full list on the user account remotly, but I get it if I run my command locally ? And how to fix it ?
Thanks

Edit : same results using Invoke-command and Enter-PSSession.

Edit 2 : if it makes any difference, my machine runs PS 4.0, and the VM (with both Admin and "test" users) runs 3.0.

Svart
  • 1
  • 2
  • 1
    not totally clear: User "test" behaves differently whether being logged in via RDP or as PS? – Falco Alexander May 09 '16 at 08:45
  • It works normally logged via Remote Desktop, but the same command using remote PS does not provide the same output – Svart May 09 '16 at 09:12
  • I have seen a few questions here where someone has had problems with remote WMI, and the solution being related to specific permissions needed to execute those calls remotely, *whether using an Administrator account or not*. – Charlie Joynt May 09 '16 at 09:12
  • I think remembering that I had to change some permission to use `get-wmiobject win32_service` remotely, so I assume this is the same kind of problem. Maybe Remote permission, or more general WMI, as I can run the command successfully using RDP, but not on Remote PS – Svart May 09 '16 at 09:20

0 Answers0