Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login script and install

Status
Not open for further replies.

welshwizard1981

Technical User
Sep 5, 2005
15
0
0
GB
I have to install a program with a login script in a network. But the users who log in, possibly dont have rights to install new software. How would it be possible to give admin rights or use any other account to install the program at loginscript runtime?
 
The program will automatically install. The problem is when the script starts to run, because the users do not have admin rights it stops and asks whether to run as local or as admin, but if i have to go around adding the admin password to every computer it defeats the scripts purpose. I need a way to allow the users to have one off installation rights. If anyone has any ideas let me know. Thanks in advance.
 
or you can run it with elevated priv...i think (if its an msi that is)

logonscripts run under the user context, the idea that a user can grant themselves admin rights on the fly (or at least a logonscript doing this) is pretty circular

go for GPO as markdmac suggests (but you will need an msi)

other methods admins employ are
+ having a service on the local machine, this service runs with elevated priv and one uses that service to install apps etc

+ have an admin workstation which someone is logged onto with an account his admin rights over all the target computers, run a script from the admin work station to execute threads on the target machines (this is pretty yukky) (you get into problems when the app you need to install has user specific settings)
 
Thanks both. Just to give you a better idea of what im trying to do: I have Kaspersky Anti-Virus installed on about 250 client pc's, I am using the GUI uninstall feature to remove the program (which is why MSI may not be an option, there is no user interaction). This is the code i have, v small and simple:

Set ObjShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.FileExists("Checks prog exists") Then
Objshell.Run("program path")
Else
Wscript.Echo "File Does Not Exist"

Works fine when logged in as domain admin, not when trying to run as user.
Wscript.Quit
End If
 
if you have none of what i suggested then try and run a WMI DCOM call from an admin workstation logged on with a user which has admin priv over all client machines
 
Having looked at your code and what you want to accomplish the solution is really very simple. Set this as a startup or shutdown script. It will use the local admin privileges. THen have your users reboot or force a remote reboot with WMI. I have posted code to do the remote reboot many times.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
 
You could also use the utility cpau.exe to create a job file that will enable any app to run under admin privs while the credentials are encrypted and stored in your job file. So, you can allow users/scripts to run as admin without giving out any passwords or having any issues. This process does not allow access to any other process with the credentials.

Again, this is just a workaround if you need something quick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top