Je suis using Windows Server 2008 R2 et have a windows service running under "network service" account in computer ComputerA. This windows service want to access a share folde (on another computer ComputerB) qui grant read permission to a group GroupA. So J'ai besoin de to add le the computer account of ComputerA to le GroupA et redémarrez le ComputerA.
My question is: is there a way to let le group membership immedialy take effect sans restarting le ComputerA?
Existe-t-il un moyen de rafraîchir l'appartenance aux groupes d'un ordinateur sans redémarrer ?
Re: Existe-t-il un moyen de rafraîchir l'appartenance aux groupes d'un ordinateur sans redémarrer ?
```
For Windows 2008 and higher:
psexec -s -i -d cmd.exe
C:\Windows\system32>whoami
nt authority\system
-- List the session 0 tickets (0x3e7 is the machine session 0)
klist -lh 0 -li 0x3e7
-- Purge the session 0 tickets
klist -lh 0 -li 0x3e7 purge
Should display:
Current LogonId is 0:0x3e7
Deleting all tickets:
Ticket(s) purged!
```
PSExec is a free SysInternals download depuis Microsoft.
To clear up tout confusion, this process absolutely will refresh le group memberships of a computer, et allow a group policy that applies to a security group to now apply to le computer, sans rebooting le computer. This has been tested et verified on Windows Server 2012 R2 et Windows Server 2008 R2 et a universal security group. The short version would be:
- `psexec -s -i -d cmd.exe`
- `klist tgt` (view le current ticket, make note of le size. Also note that depuis you are running as system, le Current Logon Id is 0x3e7)
- Add le computer to le security group. (Allow time to replicate, si applicable)
- `klist purge`
- `nltest /dsgetdc:domain.com` (run this ou tout autre command that will connect to a network resource et force a TGT request)
- `klist tgt` (view le current ticket, make note of le size. It should be slightly larger. Note that whoami /groups will pas reflect le nouveau membership)
At this point, it le system command prompt may be exited.
- `gpupdate /force`
- `gpresult /h gpresult.html`
View le gpreport, it should now show le group policy is applied.
For Windows 2008 and higher:
psexec -s -i -d cmd.exe
C:\Windows\system32>whoami
nt authority\system
-- List the session 0 tickets (0x3e7 is the machine session 0)
klist -lh 0 -li 0x3e7
-- Purge the session 0 tickets
klist -lh 0 -li 0x3e7 purge
Should display:
Current LogonId is 0:0x3e7
Deleting all tickets:
Ticket(s) purged!
```
PSExec is a free SysInternals download depuis Microsoft.
To clear up tout confusion, this process absolutely will refresh le group memberships of a computer, et allow a group policy that applies to a security group to now apply to le computer, sans rebooting le computer. This has been tested et verified on Windows Server 2012 R2 et Windows Server 2008 R2 et a universal security group. The short version would be:
- `psexec -s -i -d cmd.exe`
- `klist tgt` (view le current ticket, make note of le size. Also note that depuis you are running as system, le Current Logon Id is 0x3e7)
- Add le computer to le security group. (Allow time to replicate, si applicable)
- `klist purge`
- `nltest /dsgetdc:domain.com` (run this ou tout autre command that will connect to a network resource et force a TGT request)
- `klist tgt` (view le current ticket, make note of le size. It should be slightly larger. Note that whoami /groups will pas reflect le nouveau membership)
At this point, it le system command prompt may be exited.
- `gpupdate /force`
- `gpresult /h gpresult.html`
View le gpreport, it should now show le group policy is applied.