Solved

script problem with user profiles on sbs 2008

Posted on 2009-04-02
4
220 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

I’m often asked about newer and larger USB drives connected to SBS2008 and 2011 failing Windows Server Backup vs the older USB drives not failing. As disk space continues to grow and drive technology change SBS2008 and some SBS2011 end up with the f…
Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
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…

830 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