Solved

script problem with user profiles on sbs 2008

Posted on 2009-04-02
4
221 Views
Last Modified: 2012-05-06
Hi Guys, hope someone can help.
Ive created a small script to check if users have a shortcut on their desktops and if not copy it from a shared folder and place it there. The script is activated by group policy which works. The result of the script is wrong though.
The script is as follows.

If exist "%userprofile%\desktop\shortcutname.lnk" goto finish

copy "\\YourServer\SharedFolderName\shortcutname.lnk" "%userprofile%\desktop"

:finish

The result I am getting from this is a file called "desktop" is being created in the local machine profile folder beside the desktop folder (which isnt even being used).

I must add at this point folder redirection is being used and is working.

Also this script did work before. But we had to rebuild the server. We added the computers by removing from domain then reconnecting using http://connect.

Everything else seems to be working except for this strange problem.

Finally it also happens when I type the main 'copy' line into a command prompt on the server.

Any suggestions greatly appreciated.
0
Comment
Question by:easiman
[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
  • 2
4 Comments
 
LVL 15

Expert Comment

by:Dave_AND
ID: 24058124
If exist "%userprofile%\desktop\shortcutname.lnk" goto finish

copy "\\YourServer\SharedFolderName\shortcutname.lnk" "%userprofile%\desktop\"

:finish

That should fix it.
0
 
LVL 39

Accepted Solution

by:
Philip Elder earned 500 total points
ID: 24060305
You could also use the built-in Group Policy Preferences to place the shortcut on the user's desktop.

Philip
0
 

Author Comment

by:easiman
ID: 24062673
Thanks Dave but I tried that already, got a path not found error.

Decided to go with Phillips suggestion and all worked until I found another problem, again relating to profile.

On one computer GPO doesnt work fully, it does partially, ie (policy 1 sbs user login)'Phillips Fix' the shortcut I placed on the desktop and the mapped drive doesnt appear yet (policy 2 folder redirection) the folder redirections do work. Except with one user for which GPO doesnt work at all. Not even on other machines.

There is a common factor, the broken user profile was created on the machine which doesnt work.

Any ideas on how I could fix this?
0
 
LVL 39

Expert Comment

by:Philip Elder
ID: 24062943
Rename the affected user profile while logged in as admin.

Then log on as the user and the profile will recreate itself from scratch and any issues should be gone.

Philip
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

You might have come across a situation when you have Exchange 2013 server in two different sites (Production and DR). After adding the Database copy in ECP console it displays Database copy status unknown for the DR exchange server. Issue is strange…
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…

738 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