Solved

vbscript fails for non-admin user in sharepoint

Posted on 2014-01-07
5
422 Views
Last Modified: 2014-01-14
we have created a shortcut in sharepoint to allow the currently logged in user to get the local machine name of their computer.  here is the script:

Set objPC = CreateObject( "WScript.Network")
strComputerName = objPC.ComputerName
msgbox "Computer Name: " & strComputerName, vbokonly + vbinformation, "Computer Name"

the problem is, it fails on line 1 unless the user is an admin.  how can I run this script for domain users without admin rights?

BTW, this script works fine on XP but not on Windows 7.
0
Comment
Question by:dhenderson12
[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
  • 2
5 Comments
 
LVL 32

Expert Comment

by:Jamie McAllister MVP
ID: 39763146
Possibilities are the new machines are x64 and a refactor of the script to run in an x32 compatible mode is needed; (though doesn't explain why admins can do it)

http://stackoverflow.com/questions/2806584/how-do-i-run-a-vbscript-in-32-bit-mode-on-a-64-bit-machine

WSH needs updating; http://www.visualbasicscript.com/m48646-print.aspx

SCRRUN DLL;

http://www.visualbasicscript.com/m31697.aspx

Or Group Policy may need changing to allow this...
0
 

Author Comment

by:dhenderson12
ID: 39763463
I tend to think you're correct about the group policy ... however it works ok on XP.  Are the policy settings more "paranoid" in windows 7 that they need to explicitly set?
0
 
LVL 32

Accepted Solution

by:
Jamie McAllister MVP earned 250 total points
ID: 39764532
I don't have documentation stating that, but I've certainly heard of people having this issue when moving to Win7.
0
 
LVL 15

Assisted Solution

by:pcsmitpra
pcsmitpra earned 250 total points
ID: 39765122
Set objPC = CreateObject( "WScript.Network")
strComputerName = objPC.ComputerName
msgbox "Computer Name: " & strComputerName, vbokonly + vbinformation, "Computer Name"

Try This
Set objPC = Wscript.CreateObject( "WScript.Network")
strComputerName = objPC.ComputerName
msgbox "Computer Name: " & strComputerName, vbokonly + vbinformation, "Computer Name"
0
 

Author Comment

by:dhenderson12
ID: 39779329
None of the vbscript options have worked.  Our IT team replaced it with a powershell script that does work.  Thanks to all for you help.  I'm splitting the points to all who participated.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

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…
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

752 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