Solved

How to set Windows XP group policy from a command line

Posted on 2004-09-30
3
337 Views
Last Modified: 2008-01-09
Hi, we recently rollout XP professional with new IBM desktop and laptop, but soon we find out users can not login to our NT domain (Yeah, NT domain). if they login too fast.

We know the problem is caused by the Windows XP fast login feature, we now find out we need to MANUALLY use the group policy to disable the XP to allowing user to login with cached login credentials before the network is fully ready, in individual PC.

To disable this we are using MMC and add the group policy snap-in, under computer configuration --> Administrative Templates --> System --> logon, change "Allow wait for the network at computer startup and logon" to enable.

Because we are not using Active Directory, we can not set this through domain policy.

IS there a way that we can set this from a command line, so it can be fit in to our NT login scipts?

Thanks in advanced.
0
Comment
Question by:tomzhang888
  • 2
3 Comments
 
LVL 11

Assisted Solution

by:gothicbloody
gothicbloody earned 125 total points
ID: 12188312
start----run
Example command:
gpedit.msc /gpcomputer:"ThisComputer"
You can edit the local Group Policy object on ThisComputer
Note

• The quotation marks are mandatory.
 
• There is no space after /gpcomputer:
 --------------------------------------------------
gpedit.msc /gpcomputer:"ThisComputer.WingTipToys.com"

 Note

• The quotation marks are mandatory.
 
• There is no space after /gpcomputer:
 
You can edit the local Group Policy object on ThisComputer, with the computer specified in the DNS style rather than in the older NetBIOS style.
-----------------------------------------------------
gpedit.msc /gpobject:"LDAP://CN={31B2F340-016D-11D2-945F-00C04FB984F9},CN=Policies,CN=System,DC=WingTipToys,DC=com"

 Note

• The GUID for the Group Policy object above is a fictitious example
You can edit an Active Directory-based Group Policy object
----------------------------------------------------------
Command-line tools for Group Policy:
Gpresult

Displays Group Policy settings and Resultant Set of Policy (RSOP) for a user or a computer.

Syntax
gpresult [/s Computer [/u Domain\User /p Password]] [/user TargetUserName] [/scope {user|computer}] [/v] [/z]

Parameters
/s Computer : Specifies the name or IP address of a remote computer. (Do not use backslashes.) The default is the local computer.

/u Domain\User : Runs the command with the account permissions of the user that is specified by User or Domain\User. The default is the permissions of the current logged-on user on the computer that issues the command.

/p Password : Specifies the password of the user account that is specified in the /u parameter.

/user TargetUserName : Specifies the user name of the user whose RSOP data is to be displayed.

/scope {user|computer} : Displays either user or computer results. Valid values for the /scope parameter are user or computer. If you omit the /scope parameter, gpresult displays both user and computer settings.

/v : Specifies that the output display verbose policy information.

/z : Specifies that the output display all available information about Group Policy. Because this parameter produces more information than the /v parameter, redirect output to a text file when you use this parameter (for example, gpresult /z >policy.txt).

/?: Displays help at the command prompt.

Top of page
Remarks
• Group Policy is the primary administrative tool for defining and controlling how programs, network resources, and the operating system operate for users and computers in an organization. In an Active Directory environment, Group Policy is applied to users or computers on the basis of their membership in sites, domains, or organizational units.
 
• Because you can apply overlapping levels of policies to any computer or user, the Group Policy feature generates a resulting set of policies at logon. Gpresult displays the resulting set of policies that were enforced on the computer for the specified user at logon.
 

Top of page
Examples
The following examples show how you can use the gpresult command:

gpresult /user targetusername /scope computer
gpresult /s srvmain /u maindom\hiropln /p p@ssW23 /user targetusername /scope USER
gpresult /s srvmain /u maindom\hiropln /p p@ssW23 /user targetusername /z >policy.txt
gpresult /s srvmain /u maindom\hiropln /p p@ssW23
----------------------------------------------------------
Gpupdate

Refreshes local and Active Directory-based Group Policy settings, including security settings. This command supersedes the now obsolete /refreshpolicy option for the secedit command.

Syntax
gpupdate [/target:{computer|user}] [/force] [/wait:value] [/logoff] [/boot]
Parameters
/target:{computer|user} : Processes only the Computer settings or the current User settings. By default, both the computer settings and the user settings are processed.

/force : Ignores all processing optimizations and reapplies all settings.

/wait:value : Number of seconds that policy processing waits to finish. The default is 600 seconds. 0 means "no wait"; -1 means "wait indefinitely."

/logoff : Logs off after the refresh has completed. This is required for those Group Policy client-side extensions that do not process on a background refresh cycle but that do process when the user logs on, such as user Software Installation and Folder Redirection. This option has no effect if there are no extensions called that require the user to log off.

/boot : Restarts the computer after the refresh has completed. This is required for those Group Policy client-side extensions that do not process on a background refresh cycle but that do process when the computer starts up, such as computer Software Installation. This option has no effect if there are no extensions called that require the computer to be restarted.

/?: Displays help at the command prompt.

Examples
The following examples show how you can use the gpupdate command:

gpupdate

gpupdate /target:computer

gpupdate /force /wait:100

gpupdate /boot
-----------------------
 
0
 

Author Comment

by:tomzhang888
ID: 12257211
Thanks for the tips, but I am looking for a way to apply a group policy to a XP pc via a command line.
So far I havnt seen a sample yet.  
0
 
LVL 11

Accepted Solution

by:
gothicbloody earned 125 total points
ID: 12260839
hi tomzhang888
check this out :
http://windows.stanford.edu/Public/Infrastructure/LocalGroup.html


hope that help you..
M.Ayad
MCSE+CCNA
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Migration of Exchange mailbox can be done with the ExProfre.exe tool. But at times, when the ExProfre.exe tool migrates the Exchange Server user profile, it results in numerous synchronization problems. Synchronization error messages appear in the e…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now