Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Convert a script to Group Policy Preferences (server 2008)

Posted on 2008-10-03
4
Medium Priority
?
295 Views
Last Modified: 2013-12-04
I would like to convert the following script into a group policy preferences.

Please could the forum offer some assistance


ifmember "ABC Users"
if errorlevel 1 goto ABCUser
:ABCUser
if exist \\%computername%\XYZ (net use g: \\%computername%\XYZ /persistent:no
 ) else (net use g: \\MY-SVR-212\ /persistent:no)
goto end

:end
h:

if not exist "ABC Docs" MD "ABC Docs"

thank you
0
Comment
Question by:titn003
  • 2
4 Comments
 
LVL 12

Expert Comment

by:RobinHuman
ID: 22632750
Try copying the script into notepad and saving it as a .ADM file - not where you saved it;
Open group policy editor, select the policy you want to attach it to (not the default policy - if necessary, create a new blank policy), and in user administrative templates, right-click and import the file you saved as a .ADM
0
 
LVL 57

Expert Comment

by:McKnife
ID: 22640736
titn, the group targeting can be achieved by using the register "common" and checking item level targeting" and picking the security group "abcusers".
Mapping a drive is not really your problem, or is it? GPP calls it "drive maps" and it's below Preferences - windows settings. To achieve the if exist network drive thing, again use item level targeting ->registry item ->match value data->HKCU, keypath: network\g, value name:RemotePath, value type: reg_sz, value data \\server\share
0
 

Author Comment

by:titn003
ID: 22643779
MCknife

Mapping a drive is straight forward however the other stuff i have not done YET.


Do you know of any web links that that details examples of the above that I can follow
0
 
LVL 57

Accepted Solution

by:
McKnife earned 2000 total points
ID: 22644184
Hi. I hoped my answer would be detailed enough to reproduce it :{, feel free to ask.
Did you look at the help? GPP has quite a good help. I don't have other links than the MS documentation:
--
- Group Policy Preferences Overview White Paper
http://www.microsoft.com/downloads/details.aspx?FamilyID=42e30e3f-6f01-4610-9d6e-f6e0fb7a0790&DisplayLang=en 
- Group Policy Preferences: Getting Started
http://technet.microsoft.com/en-us/library/cc731892.aspx 
- An extensive section on Preferences in the Group Policy Management Console (GPMC) Help for Windows Server 2008 (which is also available on TechNet)
http://technet.microsoft.com/en-us/library/cc771685.aspx   
-  Group Policy Preferences Frequently Asked Questions
http://technet.microsoft.com/en-us/windowsserver/grouppolicy/cc817590.aspx 
--
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
A bad practice commonly found during an account life cycle is to set its password to an initial, insecure password. The Password Reset Tool was developed to make the password reset process easier and more secure.
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…

971 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