Re: GPRESULT not working from remote computer



What you've found is a quirk in the way gpresult works. Even if you are only interested in collecting RSOP data for the remote computer, the tool looks for RSOP data for your current user account that you're using to run the command on that remote machine, and bails out if it doesn't find it (meaning you've never logged on interactively with that account on that remote machine). So, in order to get this to work, you need to specify a user account on the /USER option that you know has always logged into the remote system. Or, I suppose you could also just ignore using the /USER option but rather always run your script in the context of a user who has always logged into those remote systems. The other alternative is to use GPMC scripting to accomplish this, instead of gpresult.
--
Darren Mar-Elia
MS-MVP-Windows Server--Group Policy

Script Group Policy Settings with the GPExpert Scripting Toolkit for PowerShell!
Find out more at http://www.sdmsoftware.com/products2.php

Visit the GPOGUY: http://www.gpoguy.com -- The Windows Group Policy Information Hub:
FAQs, Training Videos, Whitepapers and Utilities for all things Group
Policy-related

"Jos Rossiau" <JosRossiau@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:E63EBE7E-07F5-4F72-BEAA-5487BB207C57@xxxxxxxxxxxxxxxx
Hello,

I have written a little script that checks and reports what group policies
have been applied to a number of servers.

In short the scripts runs the following command foreach of the servers:

gpresult /S <servername> /U <domain\userid /> /P <password> /SCOPE COMPUTER
/USER <domain\userid>

When I run the script (or gpresult manually) I get the error message:

INFO: The user "domain\userid" does not have RSOP data.

When I log on locally or via RDP to this server I can run gpresult.
When I log off and rerun the script, the server I have logged on to is
succesful, but the other servers I have not yet logged on to are not.

I figured this would be caused by a lack of a userprofile on the local
computer, so I embeded a psexec -e (the one that creates a profile, not the
newest that avoids creating a profile on the remote computer) command in the
script to create a userprofile on the remote computer before running gpresult
on it.

This did however not work, a userprofile directory was created, but that was
not adequate for gpresult to work correctly. The only difference with loging
on locally or via RDP was that the user did not get its own registrykey under
HKEY_USERS.

It looks like gpresult wants to check the HKEY_USERS\<SID of user> to check
for user gpo's applied.

Although I only want to check computer policies, the lack of possiblity to
check user policies for the user is stopping me.

Does anyone know how I can have the userprofile load correctly, including
creating the HKEY_USERS\usersid key from a commandline (preferably remote)?

Is there any other way of getting the same info as gpresult /S <servername>
/SCOPE COMPUTER ?

Any help would be appreciated, instead of having to log on interactively at
all my servers.

Greetings,

Jos Rossiau




.



Relevant Pages

  • Re: GPRESULT not working from remote computer
    ... interactively on the servers. ... those names to try to get gpresult to work with the /USER option. ... the script on domain users only. ... command on that remote machine, and bails out if it doesn't find it (meaning ...
    (microsoft.public.windows.group_policy)
  • Re: GPRESULT not working from remote computer
    ... interactively on the servers. ... I am trying to rewrite the script to check hkey_users for users s1-5-21 ... those names to try to get gpresult to work with the /USER option. ... interested in collecting RSOP data for the remote computer, ...
    (microsoft.public.windows.group_policy)
  • Re: GPRESULT not working from remote computer
    ... You could pass that as an argument to the script of course. ... interactively on the servers. ... those names to try to get gpresult to work with the /USER option. ... command on that remote machine, and bails out if it doesn't find it (meaning ...
    (microsoft.public.windows.group_policy)
  • Re: MapNetworkDrive on remote computers
    ... >> You can run a script against a remote computer, ... > logged on user enviroment". ... > If you run the "net use" command against the remote computer, ...
    (microsoft.public.windows.server.scripting)
  • VB.script error Cant creat Object
    ... I'm working on a very simple script to run on remote ... Set objWshController = WScript.CreateObjec ... DCOM got error "class not registered" from remote computer ...
    (microsoft.public.scripting.vbscript)