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.