For Windows 2000 Computers:
Psexec.exe -@ComputerList.txt secedit.exe
/refreshpolicy user_policy
Psexec.exe -@ComputerList.txt secedit.exe
/refreshpolicy machine_policy
The above Psexec.exe command will run on
all the computers specified in the ComputerList.txt.
You can also use the following script to
check the version of Operating System and then issue the command:
@echo off
XPGPORef1=gpupdate.exe /Target:User /force
XPGPORef2=gpupdate.exe /Target:Computer
/force
Win2kGPORef1=secedit.exe /refreshpolicy
user_policy
Win2kGPORef2=secedit.exe /refreshpolicy
machine_policy
For /f “Tokens=*” %%a in (ComputerList.txt)
Do (
SET Comp_name=%%a
Ver.exe \\%comp_name% > Hostver.txt
Find /I “XP” < Hostver.txt >
CheckCC.txt
IF %errorlevel% == 0 (
Psexec.exe \\%comp_name% Gpupdate.exe
/Target:User /force
Psexec.exe \\%comp_name% Gpupdate.exe
/Target:Computer /force
) ELSE (
Psexec.exe \\%comp_name% secedit.exe
/refreshpolicy user_policy
Psexec.exe \\%comp_name% secedit.exe
/refreshpolicy machine_policy
)
)
|