Re: "run as" possibility

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: William DePalo [MVP VC++] (willd.no.spam_at_mvps.org)
Date: 01/06/05


Date: Thu, 6 Jan 2005 08:14:35 -0500


"Timo" <Timo@discussions.microsoft.com> wrote in message
news:13E6AD12-2127-4B03-8A62-BFA5DC3E0633@microsoft.com...
> I wrote an application which use WMI and get infos from Active Directory.
> Now we wan't to implement a that the programm can run with "run as"
> possibility. When we tried it was not possible to run the programm
> correctly.
> With an administrative privileg there is no trouble.
> How can I do that?

If you are using WMI from within a program, check the docs for
CreateProcessAsUser()

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocessasuser.asp

or CreateProcessWithLogonW()

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocesswithlogonw.asp

which could launch the program that does the WMI stuff.

If you are using a scripting language, your script would have launch an
executable which would call one of the functions above to run the script.

Regards,
Will



Relevant Pages

  • RE: Does WMI have to be installed on Remote Computer?
    ... IMHO this looks like a well constructed and very vell commented script. ... WMI comes as standard on w2k w2k3 and xp, ... does WMI need to be installed on the remote computer in order for a ... ''' First try to ping the server. ...
    (microsoft.public.scripting.vbscript)
  • Re: Look over this script.....could anything be done better?
    ... will be unable to connect with WMI. ... With this version of the script I have kept that included because the script that enumerates all of the servers has some servers that no longer exist. ... Dim objWMIService, colFixedDrives, objFD ...
    (microsoft.public.scripting.vbscript)
  • Re: Create simple file share on the fly
    ... WMI share routine faithfully works. ... You can place the command line below as the final line in your WMI ... You might experiment with actual workstations to see if the script is ... the shares that I make from the Windows GUI, ...
    (microsoft.public.windowsxp.security_admin)
  • RE: Starting Excel and doing "stuff"...
    ... I have a WMI .vbs that monitors a folder for new files. ... This code first creates an event filter that polls the repository every 5 ... can use another script or utilities like wbemtest.exe or CIM Studio). ... Active script event consumer has limitations, you can't make Excel visible, ...
    (microsoft.public.excel.programming)
  • Re: Patch Management & Identifying Hosts
    ... Patch Management of the Security Operations ... WMI is also an option. ... "A WSH script using VBScript is explained. ... the result from the online computers. ...
    (microsoft.public.win2000.security)