[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Using script to apply domain-wide settings

Posted on 2011-09-08
1
Medium Priority
?
345 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 2000 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

Independent Software Vendors: 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

In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

656 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