# Force Wallpapers using Samba

## InAt!QuE

Hi All,

I have a Samba PDC and I want all workstations (XP Pro & W2K Pro) to use the same wallpaper.

Is there a way in Samba to force the clients to use a specific wallpaper?

Or do I have to use the logon script for this?

----------

## nobspangle

I think Windows system policy will allow you to stop people from changing the wallpaper but I don't think you can force a particular wallpaper. Sounds like a logon script may be your best bet.

----------

## daschapa

I think SMB is more like something like NFS and CUPS together (note that it is not really an implementation of both, but a completely different protocol).

To force a wallpaper yo can make a script which runs every 1 minute (a half of the average windows bootup time, LOL) and detects a host when it connects to samba network, then rub a ssh script to fix its wallpaper.

----------

## tomushu

I'm using this configuration to force wallpaper on users profiles.

smb.conf.

```

        logon script = logon.bat

[netlogon]

        path = /home/netlogon/

        browseable = No

        read only    = yes

```

In /home/netlogon directory i'm having this scripts:

logon.bat

```

\\ip_address_of_pdc\netlogon\wall.vbs

```

In the wall.vbs i have this code:

```

' Create the variables needed

Dim WSHShell

Dim strRegKey

Dim strWallpaper

Dim strDesktop

Set shell = CreateObject("WScript.Shell")

Set env = shell.Environment("process")

userpath = env("USERPROFILE")

' msgbox userpath

' Create the Wscript Shell object

Set WSHShell = WScript.CreateObject("WScript.Shell")

' Define the wallpaper

strWallpaper = userpath & "\wall.bmp"

strDesktop    = WSHShell.SpecialFolders("Desktop")

' Create the wallpaper key

'strRegKey =  "HKEY_CURRENT_USER\"

'strRegKey = strRegKey & "Software\"

'strRegKey = strRegKey & "Microsoft\"

'strRegKey = strRegKey & "Internet Explorer\"

'strRegKey = strRegKey & "Desktop\"

'strRegKey = strRegKey & "General\"

'strRegKey = strRegKey & "Wallpaper"

strRegKey = "HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper"

' msgbox strRegKey

' msgbox strWallpaper

' Write the key, type, and value

WSHShell.RegWrite strRegKey, strWallpaper, "REG_EXPAND_SZ"

' Refresh the desktop now.

WSHShell.AppActivate strDesktop

WSHShell.SendKeys "{F5}"

'Quit

Wscript.quit(0)

```

This should be all that u need for u to set the wallpaper on your profile users.

Good luck

----------

## InAt!QuE

Where do I have to put the wallpaper?

I already tried it with a logon script;

```
:: Configure Wallpaper 

REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D "%SystemRoot%\wallpaper.bmp"

REG ADD "HKCU\Control Panel\Desktop" /V WallpaperStyle /T REG_SZ /F /D 0

REG ADD "HKCU\Control Panel\Desktop" /V TileWallpaper /T REG_SZ /F /D 2

:: Configure the screen saver.

REG ADD "HKCU\Control Panel\Desktop" /V SCRNSAVE.EXE /T REG_SZ /F /D "%SystemRoot%\System32\scrnsave.scr"

REG ADD "HKCU\Control Panel\Desktop" /V ScreenSaveActive /T REG_SZ /F /D 1

:: Set the time out to 900 seconds (15 minutes).

REG ADD "HKCU\Control Panel\Desktop" /V ScreenSaveTimeOut /T REG_SZ /F /D 900

:: Set the On resume, password protect box 

REG ADD "HKCU\Control Panel\Desktop" /V ScreenSaverIsSecure /T REG_SZ /F /D 1

:: Remove the user's ability to see the Screen Saver, background, and appearance tabs of Display Properties. 

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /V NoDispScrSavPage /T REG_DWORD /F /D 1

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /V NoDispBackgroundPage /T REG_DWORD /F /D 1

REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /V NoDispAppearancePage /T REG_DWORD /F /D 1

:: Make the changes effective immediately

%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
```

But as you see, like here I was not sure where to copy so I tried at the workstation in the windows folder. ("%SystemRoot%\wallpaper.bmp")

This worked but I don't want to copy the wallpaper to all workstations. This is a lot of work. I geuss it should be easier. 

So I tried to copy the wallpaper.bmp to the netlogon directory.

I changed the first line at the script to;

```
REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D [b]"wallpaper.bmp"[/b]
```

And it worked but there is one problem.

It works well if you wallpaper.bmp is at a size of +/- <1,3mb

After I made a new wallpaper.bmp it had a size of 3mb and after logged into the workstation I got a white screen.

I geuss this is again some weird M$ peeps!

But will the vbs script cover this??

----------

