Solved

Convert a script to Group Policy Preferences (server 2008)

Posted on 2008-10-03
4
285 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 53

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 53

Accepted Solution

by:
McKnife earned 500 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

Join & Write a Comment

A procedure for exporting installed hotfix details of remote computers using powershell
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
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…

747 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

12 Experts available now in Live!

Get 1:1 Help Now