If i recall correctly, there’s no user in a domain called Administrator. Even when you do the first DCPromo to convert a server to a DC with active directory, the local administrator user isn’t available anymore.
Instead try creating a domain user, give it admin permission on the node and then use his credentials in the command.
Its not the account. The first account in the domain is Administrator. Its in the Users container and gives similar permissions to being in the domain admins group. Domain controllers don’t have local accounts but all other machines in the domain do.
I tried running you WMI calls and they both worked - using local administrator and domain administrator and my account (member of domain admins). This was on Windows 2012 R2 running latest RTM version of PowerShell 5.0 What are you running?
I’m trying to run this as a domain admin on a remote machine.
Running queries from the AD machine to the remote machines.
Have you tried to run these queries against remote machines?
The script is pretty much the one liner for now. I need to get the domain user working. Once I achieve that with the simply query, then I will expand on this.
Built a new machine that was added to the domain. This machine was not the server with AD on it. For some reason the script now works. I’m not sure where the issue was.