Solved

Using script to apply domain-wide settings

Posted on 2011-09-08
1
340 Views
Last Modified: 2012-05-12
I have a small network of Windows-based computers, PCs running Windows XP or Windows 7 and servers running Windows 2008 or Windows 2008 R2. I need to roll out some changes to all my PCs, some 60+ PCs and I am wondering whether vb script could help me. The two tasks I need to complete are as follows:-

1. I need to set a default wallpaper on every PC. I would ideally like the wallpaper to be a series of photos that would be copied to a specific folder on the PC.

2. We have a single login script for every user so we map the same network drives for evrybody, regardless of whether they need them or not. I'd like to create a script that would map a drive based on whether they belong to a particular security group or not.

I found an article on EE where someone had a similar issue and vb script was suggested as a solution http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_22686588.html and I'm sure vb script can help with my secod issue but I know nothing about vb script and how to use it.

Can anybody suggest where I start with vb script? Are there any good websites or books that you can recommend?
0
Comment
Question by:infologicit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
David Linker earned 500 total points
ID: 36508305
You can resolve both of these problems by modifying your existing Login script.

The below will map your drives based on group membership.

The background files solution to come shortly - need to test on both Windows XP and Windows 7

Option Explicit
Dim objNetwork, objUser, objCurrentUser
Dim strGroup

' Create objects and retrieve strGroup values
Set objNetwork = CreateObject("WScript.Network")
Set objUser = CreateObject("ADSystemInfo")
Set objCurrentUser = GetObject("LDAP://" & objUser.UserName)
strGroup = LCase(Join(objCurrentUser.MemberOf))

' If logic testing strGroup for the values in Const groups
If InStr(strGroup, lcase("cn=group-to-match-in-all-lower-case")) Then
	objNetwork.MapNetworkDrive "h:", "\\MainServer\Users\" & objNetwork.UserName
ElseIf InStr(strGroup, lcase("cn=some-other-group")) Then
	objNetwork.MapNetworkDrive "h:", "\\DifferentServer\Users\" & objNetwork.UserName
End If

If InStr(strGroup, lcase("cn=some-special-group")) Then
	objNetwork.MapNetworkDrive "g:", "\\Server\SpecialShare"
End If
Wscript.Echo "Completed mapping drives "
WScript.Quit

Open in new window

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Recently I finished a vbscript that I thought I'd share.  It uses a text file with a list of server names to loop through and get various status reports, then writes them all into an Excel file.  Originally it was put together for our Altiris server…
With User Account Control (UAC) enabled in Windows 7, one needs to open an elevated Command Prompt in order to run scripts under administrative privileges. Although the elevated Command Prompt accomplishes the task, the question How to run as script…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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