?
Solved

script problem with user profiles on sbs 2008

Posted on 2009-04-02
4
Medium Priority
?
223 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 2000 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

Are your AD admin tools letting you down?

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

Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
A quick step-by-step overview of installing and configuring Carbonite Server Backup.
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Suggested Courses

743 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