You can't. gpresult
needs a valid user context that actually exists to query. You can't tell it to query ~"whatever a default user would be," least of all because that doesn't actually make sense. There isn't a "null" or default user. Both using the computer and applying policy (in Windows) always have a user context, even if that user isn't an actual user, but is SYSTEM
, for example. So speaking of a "default" user, or a non-existent user is somewhat nonsensical. (Really, what is the "default" user? There are a number of users created by default on a Windows machine, and they're all very different.)
And, in fact, gpresult will default to the logged on user running the query if the user argument is not provided.
You can create a new user, accept the... "defaults" (to the extent that there are any) and query against that user, which seems like the easiest way to handle this.