Get-WMIObject on MicrosoftDFS namespace returns null
Hoping someone can help me out of my confusion.
I'm trying to implement a scheduled PowerShell script that checks the status of DFS replication and emails if errors are found.
I've found a great script which does exactly what I want when I run it as an administrator but when I try and run the script as a normal user the Get-WMIObject call within the script returns null.
The security on the MicrosoftDFS namespace in WMI is set to allow access for the group the user belongs to and the user also belongs to the Distributed Com Users group.
When I run the following command:
Get-WmiObject -ComputerName "*******" -Namespace "root\MicrosoftDFS" -Query "SELECT * FROM DfsrReplicationGroupConfig"
as admin it returns all the replication groups on the server but as the user it doesn't return anything at all,
and if I change the WMI security to disallow for the user I get "access denied" so I can't see how it can be a WMI permissions issue.
There's also no errors in the WMI event log and WMI tracing seems to show the calls working ok just nothing gets returned.
Anyone have any ideas what I can try next?