Monday, October 3, 2011

How to refresh Windows 2008 R2 computer group membership without reboot using klist

There are many cases where it is useful to force a server to refresh its group membership without restarting the server.  This is a simple task using the klist.exe utility on Windows 2008 R2.  In an elevated command prompt:
Retrieve the current list of tickets for the computer account
klist -lh 0 -li 0x3e7
Clear the current list of tickets for the computer account
klist -lh 0 -li 0x3e7 purge
Note that the syntax of this command is different than reported in many posts on the internet that were created prior to the release of Windows 2008 R2.  In Windows 2008 R2 the lh parameter is now required.  If the lh parameter is not specified, klist will return the usage.

1 comment:

  1. Hi All,
    here is our situation we have Windows Server 2008 Standard OS (64 bit) and logged in as an administrator and we have installed a windows service service with another account which belongs to Administrator group.
    So OS is running under and administrator group and the windows service running on a different user which is in administrator group.
    Shortly what this windows service does is using Crystal Reports template and sening to a network printer. During this process we get the error message "Invalid Printer Spcecified". When we remove the template
    just try to send it to the printer, this time we get error message "invalid handle". When we reboot/restart the server, it work both ways however we want to be successfully without rebooting/restarting the server.
    Note: the printer driver is OK.
    Shortly is there any way to accomplish without rebooting the server. We used some tools like PSEXEC but did not help.
    Remember if we reboot everything ok .
    Thanks and regards,
    Selami Ozlu