Sysinternals Homepage
Forum Home Forum Home > Sysinternals Utilities > BgInfo
  New Posts New Posts RSS Feed - BGINFO - Server 2003 - Remote Desktop
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

BGINFO - Server 2003 - Remote Desktop

 Post Reply Post Reply Page  12>
Author
Message
shocko View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2008
Location: Ireland
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote shocko Quote  Post ReplyReply Direct Link To This Post Topic: BGINFO - Server 2003 - Remote Desktop
    Posted: 17 December 2008 at 2:37pm
Hey Guys,
I'm new to the forum. I wanted to have this setup:
- A scheduled task to run on each server that would update every X mins and refresh all logged on users desktops. I copied the bginfo.exe and a filed called servers.bgi to all servers. I then added a scheduled task to run under the local system account using the follwing command:

schtasks.exe /create /tn BGInfo_Refresh /tr "%systemroot%\bginfo.exe %systemroot%\Servers.bgi /TIMER:0 /ALL /LOG:%SYSTEMROOT%\BGInfo.log /NOLICPROMPT" /SC MINUTE /MO 10 /ru "SYSTEM" /s <servename>

The actual command run therfore is:
C:\WINDOWS\bginfo.exe C:\WINDOWS\Servers.bgi /TIMER:0 /ALL /LOG:C:\WINDOWS\BGInfo.log /NOLICPROMPT

The problem is that this doesn't work! i keep getting this error in the ginfo.log

'Unable to relaunch as a service. This operation requires that bginfo be run under an administrative account'

and the registry key

HKEY_USERS\.DEFAULT\Control Panel\Desktop\Wallpaper

does not get updated

I run the command without the /all switch and evryhting works find except that this won't do anythign for me as the task is running under the context of the local system and that account doesn't have a desktop!

i subsequently found out that if there were multiple people logged on to the system when the /ALL switch was used the default profile never gets updates but if a single user is it does. However, i still get the error:

"Unable to relaunch as a service.

This operation requires that BGInfo be run under an Administrator account."

What is worse, this doesnt happen on all my servers and they are all have the same GPO's applied and the same OS/patches.

Its a strange one. I know i could just have each user run bginfo via a script each time they logon but this will not refresh when data changes. My custome servers.bgi file points at the registry and should update the desktop every 10 mins or so.

Anyone any ideas??

All works fine on the desktops.

Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2008 at 3:19am
Hi shocko,

Just tested the scheduled task on a Server 2003 system, and it worked with no problems.  You might consider running Process Monitor to monitor bginfo.exe, to see if you are able to gather any information about what specifically may be failing.  Are you able to specify an account other than SYSTEM with which to run the scheduled task?  Has the SYSTEM account been restricted in any way, or modified from the defaults?
Daily affirmation:
net helpmsg 4006
Back to Top
shocko View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2008
Location: Ireland
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote shocko Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2008 at 10:15am
Yes, i have tried creating the same task manually and setting an domain admin account to run it but the same problem. I'm going to invesitgate this as i would really like this to work. It would be very handy.

I'll run a process monitor and maybe some security auditing as well and get back to you.

What service pack is on your server, i have service pack 2.
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2008 at 11:28am
Quote i have service pack 2.
The system I tried it on is also running Service Pack 2.
Daily affirmation:
net helpmsg 4006
Back to Top
shocko View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2008
Location: Ireland
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote shocko Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2008 at 11:36am
Found the problem!! You must accept the EULA at least once! Since the task is run under the system account it cant interact and hence the key:

HKU\.DEFAULT\Software\Sysinternals\BGInfo\EulaAccepted is alwys set to 0 on a machine that has never had the bgifno eula accepted!

Simply modifed the script that created the task to set this reg value to 1 and all working perfectly!
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2008 at 11:41am
I had thought about suggesting that, but the reported error message threw me:
Quote 'Unable to relaunch as a service. This operation requires that bginfo be run under an administrative account'


Good to hear you have gotten it to work!
Daily affirmation:
net helpmsg 4006
Back to Top
shocko View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2008
Location: Ireland
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote shocko Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2008 at 1:25pm
Thanks for helping me out molotov

Itws working well now. Basically, my plan will be to roll this out using a server startup script but for now i'm doing it only for a couple of servers. Here is the script is use if anyone is interested:

psexec -c -s \\<servername | ipaddress> BGINFO.cmd

Contents of BGINFO.cmd:

@ECHO OFF

REM Author Darragh O'Shaughnessy
REm Desc Sets up BGInfo on a server

REM NOTE: This script should be run on the target server!!!!
REM this is a must as we need to evaluate variables at runtime!!!
setlocal ENABLEDELAYEDEXPANSION

TITLE Create schedule task on a remote machine to refresh the background information desktop wallpaper

REM Param 1 - Server NetBOIS name

ECHO This script will create schedule task on a remote machine to refresh the background information desktop wallpaper

SET REFRESH_INTERVAL=10

REM location of the .exe
SET LOCATION=%SYSTEMROOT%\BGINFO

ECHO.
ECHO Refresh interval:%REFRESH_INTERVAL%
ECHO File location:%LOCATION%
ECHO.

IF NOT EXIST %LOCATION% (
ECHO Creating Directory %LOCATION%
MKDIR "%LOCATION%"
)
ECHO.

REM Copy down the neccessary files from the netlogon folder in their site
IF NOT EXIST %LOCATION%\BGInfo.exe (
ECHO File Missing! - Copying down BGInfo.exe
@ECHO ON
xcopy "\\mydomainFQDN\NETLOGON\BGINFO\BGInfo.exe" "%LOCATION%\" /H /R /F /Y /I
@ECHO OFF
)

IF NOT EXIST %LOCATION%\Servers.bgi (
ECHO File Missing! - Copying down Servers.bgi
xcopy "\\mydomainFQDN\NETLOGON\BGINFO\Servers.bgi" "%LOCATION%\" /H /R /F /Y /I
)

IF NOT EXIST %LOCATION%\EULA.txt (
ECHO File Missing! - Copying down EULA.txt
xcopy "\\mydomainFQDN\NETLOGON\BGINFO\EULA.txt" "%LOCATION%\" /H /R /F /Y /I
)

REM This is very important!!! We need to accept the EULA for all users or the task will fail!!!
ECHO.
ECHO Adding reg key to supress/accept the BGinfo EULA...
CMD /C reg add HKU\.DEFAULT\Software\Sysinternals\BGInfo /v EulaAccepted /t REG_DWORD /d 1 /f

REM Create a task to refresh the backgrounds for all users at a regular interval
ECHO.
ECHO Creating a task to refresh the desktop backgound for all users every %REFRESH_INTERVAL% minutes...
schtasks.exe /create /tn BGInfo_Refresh /tr "%LOCATION%\bginfo.exe %LOCATION%\Servers.bgi /ALL /LOG:%LOCATION%\BGInfo.log /NOLICPROMPT /TIMER:0" /SC MINUTE /MO %REFRESH_INTERVAL% /ru "SYSTEM"

REM now add in a run key entry to force an instant refresh for a user when they logon
ECHO.
ECHO Modifying the registry to refresh the desktop backgound for a user on logon...
CMD /C reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v BGInfo /t REG_SZ /d "%LOCATION%\BGInfo.exe %LOCATION%\Servers.bgi /NOLICPROMPT /TIMER:0" /f

ECHO.
ECHO Done.


END Contents:

The only problem is that the at the logon screen the desktop is tiled but i'm sure i can set a registry entry for that!

Thanks again. I hope some one else can make use of this!
Back to Top
molotov View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 04 October 2006
Status: Offline
Points: 17516
Post Options Post Options   Thanks (0) Thanks(0)   Quote molotov Quote  Post ReplyReply Direct Link To This Post Posted: 18 December 2008 at 1:31pm
Thanks for sharing your script, shocko! Smile
Daily affirmation:
net helpmsg 4006
Back to Top
shocko View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2008
Location: Ireland
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote shocko Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2008 at 11:50am
Hey guys,
Just noticed a little problem with all this. Scheduled task runnning fine but the problem is is that the defaut porfile in the registry has it wallpaper pointed to on eof the profiles of currently logged on users!!?? This happens it appears because i have set the location of the .bmp file in the Servers.bgi file to be %USERPROFILE%\Local Settings|application data. As the scheduled task is running under the system account, perhaps this is the issue??
Back to Top
shocko View Drop Down
Groupie
Groupie
Avatar

Joined: 17 December 2008
Location: Ireland
Status: Offline
Points: 40
Post Options Post Options   Thanks (0) Thanks(0)   Quote shocko Quote  Post ReplyReply Direct Link To This Post Posted: 22 December 2008 at 12:03pm
PS: meant to say that i'd prefer if the default profile pointed to c:\documents and settings \default user\Local Settings\Application Data\WINTERNALS\BGInfo\BGInfo.bmp
Back to Top
 Post Reply Post Reply Page  12>
  Share Topic   

Forum Jump Forum Permissions View Drop Down