Solved

script problem with user profiles on sbs 2008

Posted on 2009-04-02
4
218 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
  • 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 38

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 38

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

A quick step-by-step overview of installing and configuring Carbonite Server Backup.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

775 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