?
Solved

Simple Question.

Posted on 2005-04-10
19
Medium Priority
?
569 Views
Last Modified: 2010-04-18
We have total of 900 computers in our network. We need to implement different-differnet wallpaper using Group Policy or a script. Example:  -

Wallpaper1 - Computer1
Wallpaper2 - Computer2
Wallpaper3 - Computer3
Wallpaper4 - Computer4
Wallpaper5 - Computer5
Wallpaper6 - Computer6
Wallpaper7 - Computer7
and so on...

Without using Roaming Profile.

Is there any script by which we can implement the above setting?

Thanks
SystmProg
0
Comment
Question by:Nirmal Sharma
  • 10
  • 8
19 Comments
 
LVL 16

Expert Comment

by:JamesDS
ID: 13750774
SystmProg
Wallpaper is user specific, so this has to be done in the User context - that means no startup script.

GPOs can't accept variables and each wallpaper has a different name - unless you choose to store it on the local machine and NOT a central server location.

I think I would choose to do it with a logon script and store the wallpapers centrally.

You know the registry keys to change and you will already have a copy of RegWrite or the ability to do it with VBScript. You will need to allow users to alter that key, so you'll also need a system policy to assign them the necessary rights - unless of course you can push the settings out with a custom MSI.

A few ideas for you, which way are you thinking of going??

Cheers

JamesDS
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 13750821
James,

You are correct. Wallpaper is user specific but its not so easy as you think. It requires a sort of programming or script which will run through the Login Script. I really want different wallpapers on each machine. If i create MSI that will deploy the same wallpaper on all machines.

>>>You know the registry keys to change and you will already have a copy of RegWrite or the ability to do it with VBScript. You will need to allow users to alter that key, so you'll also need a system policy to assign them the necessary rights - unless

I really don't have that much expertise. I don't have RegWrite or ability to do with VBScript. Please provide a link for RegWrite. One more thing i want to tell you...when users logs on the HKEY_CURRENT_USER from NTuser.dat is loaded first and then group policy settings are applied so i think we don't need to assign them necessary rights as they are writing to their own registry key. By default they are owner of this key, and it runs under the security context of User account only. If i run it as a login script then that should do the job but again it requires a sort of programming.

Programming in the sense: -

User logs on,

A loop should start here:  -

ncount=1

CopyWallpaper=\\Server\Wallpaper\Wal+ncount.jpg  >>>>>>>>>>>A System variable created.

copy wal1+ncount.jpg C:\winnt\system32\wal1+ncound.jpg

the script will check the wallpaper in \winnt\system32\Wallpaper\Wal1.jpb
if the Wal1.jpg already exists in the destination computer then ncount will be incremented by 1 and will loop and will copy
the next wallpaper and then again will check whether it is exists or not.

ncount=ncount+1
loop

Endloop

As far i know a script must be created using the above sample or if you know better than this. I am basically a Foxpro and C++ programmer. So i don't know DOS, Batch or VBScript programming.

Thanks
SystmProg
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 13750841
James,

One more thing i want to know......Is it possible to point a Wallpaper to a central location or the wallaper must be present in the user computer?
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
LVL 16

Expert Comment

by:JamesDS
ID: 13750894
SystmProg

The MSI could deploy a regkey that was set to look for wallpaper called "\\server\share\%machinename%.bmp"

RegWrite is actually REG_X86.EXE and came with the NT4 resource kit: ftp://ftp.microsoft.com/bussys/winnt/winnt-public/reskit/nt40/i386/reg_x86.exe

I would go with naming the wallpaper for the machinename if I were you, much easier than generating your own index.

This code will set the wallpaper:

HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objReg = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Control Panel\Desktop"
objReg.CreateKey HKEY_CURRENT_USER, strKeyPath
ValueName = "Wallpaper"
strValue = "c:\windows\wallpaper.jpg"
objReg.SetStringValue HKEY_CURRENT_USER, strKeyPath, ValueName, strValue


This code gets the computer host name:

Dim objWSHNetwork
Dim strComputerAccountName

Set objWSHNetwork = CreateObject("WScript.Network")
strComputerAccountName = objWSHNetwork.ComputerName
wscript.echo strComputerAccountName

How are we doing so far?

Cheers

JamesDS
0
 
LVL 85

Expert Comment

by:oBdA
ID: 13750939
Am I correct in assuming that you want to have information such as machine name, IP address and whatever on your machines?
Then I'd recommend using Sysinternal's BgInfo; you can start it from the logon script, and it will generate a background image with the system information you pick: http://www.sysinternals.com/ntw2k/freeware/bginfo.shtml
0
 
LVL 16

Expert Comment

by:JamesDS
ID: 13750948
oBdA

Actually I use it here, I assumed SystmProg wanted to do something else!

I put the executable on each machine and put a link in the startup folder of the all users start menu. Job done!

Top tool!

Cheers

JamesDS
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 13751072
I wanted to do something else. I have already mentioned in my question that i want differenet-differenet wallpapers on all machines (900). This is only possible by using a script.

James,

>>>The MSI could deploy a regkey that was set to look for wallpaper called "\\server\share\%machinename%.bmp"

How will you implement this setting as MSI package itself is not aware of all wallpapers. How MSI will put different-different wallpapers using the Variable defined?

>>>I would go with naming the wallpaper for the machinename if I were you, much easier than generating your own index.

For 900 machines, its not so easy to do so.

So you want me to put the script you designed in Login Script or Startup Script?

Let me know.

Cheers
SystmProg
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 13751091
So the first script should rename all wallpapers located in a central folder in server: -

1. Rename all wallpapers using a script.
2. Secondly create a script which will set wallpaper to all machines one-by-one. That means wallpaper already set should not be repeated in next.

Using Script: -

1. First i need to find the wallpaper on destination machine

2. If wallpaper already exists on the destination script then programm will loop  and will search for the next wallpaper and then again find the wallpaper.....so on...

3. At last script will copy the wallpaper to destination machine with registry keys and its location.

So i really can't find a better way to do so.

What do you say James!
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 13751094
oBdA,

Read the question carefully and then post.

0
 
LVL 16

Expert Comment

by:JamesDS
ID: 13751118
SystmProg

The question is: Do you already have all 900 wallpapers created and named 1 through 900, or similar?
If so, then I would create a CSV text file containing 2 columns - the name of the machine and that of the wallpaper.

Then you need 1 login script that opens the CSV file, finds the correct wallpaper, copies it locally, sets the reg entries and completes.

Only one script needed!

Do you need some code to open a text file and parse it??

BTW steady on with your comment to oBdA - he's only trying to help!

Cheers

JamesDS
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 13751135
Now one more thing.....pointing script to HKEY_CURRENT_USER\Control Panel\Desktop will not do the job i think so far because i have already applied to Group Policies to user and computers and can't remove it.

1. First script will run for HKEY_CURRENT_USER\Control Panel\Desktop. (User Profile).
2. And then Administrative Templates will be applied from User Configuration after login script runs. So ultimate result is no wallpaper because User Profile settings will be overwritten by User Configuration policy. The Group Policy stores its information for wallpaper in any one of the following: -

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\System\
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System\

Am i wrong or right ? Please let me know.

A wallpaper should be present in a machine or we can point to a server location.

Thanks
SystmProg
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 13751151
>>>The question is: Do you already have all 900 wallpapers created and named 1 through 900, or similar?

I already have more than 900 wallpapers and not similar. You can't keep the same name file in a directory :-)

>>>If so, then I would create a CSV text file containing 2 columns - the name of the machine and that of the wallpaper.

Please be clear here....are you talking about creating a Comma de-limited file such as:  -

Wallpaper1               Machinename1
Wallpaper2               Machinename2
Wallpaper3               Machinename3

>>>Then you need 1 login script that opens the CSV file, finds the correct wallpaper, copies it locally, sets the reg entries and completes.

>>>Do you need some code to open a text file and parse it??

That's exactly i want.

>>>BTW steady on with your comment to oBdA - he's only trying to help!

James,

I just wanted to tell him that he is not posting in right direction.

Thanks
0
 
LVL 16

Expert Comment

by:JamesDS
ID: 13751234
SystmProg
Excellent

The file should actually be the other way around and it should contain the full path for ease later. The code uses TAB as the delimiter:

MachineName1    \\servername\sharename\Wallpaper1
MachineName2    \\servername\sharename\Wallpaper2
MachineName3    \\servername\sharename\Wallpaper3
MachineName4    \\servername\sharename\Wallpaper4

'Code!:

'File Handling Stuff
const ForReading                    = 1
const ForWriting                    = 2
const ForAppending                    = 8

strSourceFile = "\\servername\sharename\Input.txt"

Set objSourceFile                    = CreateObject("Scripting.FileSystemObject")
Set objSourceFileContent            = objSourceFile.OpenTextFile (strSourceFile, ForReading)

While Not objSourceFileContent.AtEndOfStream

    strInputAll = objSourceFileContent.ReadLine()

    if left(strInputAll, 1) <> ";" Then                                                ' Do not process lines beginning with ";" as these are comments
       
        strInputAll                    = trim(strInputAll)                                ' Trim spaces off the String
       
        arrInputAll                    = split(strInputAll, vbTab)                        ' Parse out each Field into an array element
       
        strMachineName        = arrInputAll(0)
        strMachineWallpaper            = arrInputAll(1)

'stick your code to copy the wallpaper locally and set the registry entries here!

        End if
    Wend

'code ends------------

Cheers

JamesDS
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 13751298
That's great, James.

Will let you know shortly.

Your help is really appreciated.

Thanks
SystmProg
0
 
LVL 16

Accepted Solution

by:
JamesDS earned 2000 total points
ID: 13751394
SystmProg
Welcome, glad to help

www.15seconds.com is a good scripting resource and they have a mailing list where you can post code questions and get good answers.

Cheers

JamesDS
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 13751426
That's great!!! did it but only one thing left. When i apply this policy or run this script Group Policy part overwrites the registry settings. What to do ?

Thanks
0
 
LVL 16

Expert Comment

by:JamesDS
ID: 13751504
SystmProg
Why would you want to set wallpaper in the GPO AND via a script?

The GPO WILL overwrite your script based settings, so the only propoer fix is to remove the offending GPO setting from the GPO. You could use GPO filtering to exclude your 900 machines from running the GPO, but I suspect that your GPO sets other things you want to keep.

Perhaps a second GPO for machines not getting the script might be in order - you could use the GPMC to copy the settings from one GPO to another.


Cheers

JamesDS
0
 
LVL 35

Author Comment

by:Nirmal Sharma
ID: 13751514
The same i did using a second GPO.

Thanks for the help, James.

Cheers

SystmProg
0
 
LVL 16

Expert Comment

by:JamesDS
ID: 13751534
SystmProg
Welcome

Cheers

JamesDS
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Recently, I had the need to build a standalone system to run a point-of-sale system. I’m running this on a low-voltage Atom processor, so I wanted a light-weight operating system, but still needed Windows. I chose to use Microsoft Windows Server 200…
I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

839 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