Solved

script problem with user profiles on sbs 2008

Posted on 2009-04-02
4
216 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

I had a question today where the user wanted to know how to delete an SSL Certificate, so I thought that I would quickly add this How to! Article for your reference. WHY WOULD YOU WANT TO DELETE A CERTIFICATE? 1. If an incorrect certificate was …
I was supporting a handful of Windows 2008 (non-R2) 2 node clusters with shared quorum disks. Some had SQL 2008 installed and some were just a vendor application that we supported. For the purposes of this article it doesn’t really matter which so w…
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 process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

744 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now