Solved

Using script to apply domain-wide settings

Posted on 2011-09-08
1
336 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
1 Comment
 
LVL 4

Accepted Solution

by:
David Linker earned 500 total points
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

772 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

11 Experts available now in Live!

Get 1:1 Help Now