Run Program As Administrator From GPO At Logon
Howdy,Really, this is kind of a crazy question about running programs as an administrator on Server 2008. An application I wrote will execute netstat -anb to collect information about open ports on a server. Because Server 2008 requires elevated priviledges to execute the -b argument this does not work unless the program is launched as an administrator.The program is launched at logon through group policy, so my question is: how can I execute my application as an administrator so I can use the -b argument with netstat in Server 2008 while still launching the program at logon through group policy? As I understand, I could package the executable inside of another which executes the runas command. However, I'm not comfortable leaving an administrator password in plain sight.Here's how I'm launching the netstat program currently (vb.net). Code Snippet Dim FileName As String = Environment.SystemDirectory.ToString & "\netstat.exe"Dim Arguments As String = "-anb"process.StartInfo.UseShellExecute = Falseprocess.StartInfo.RedirectStandardOutput = Trueprocess.StartInfo.RedirectStandardError = Trueprocess.StartInfo.CreateNoWindow = Trueprocess.StartInfo.FileName = FileNameprocess.StartInfo.Arguments = Argumentsprocess.StartInfo.WorkingDirectory = Environment.SystemDirectory.ToStringThanks in advance!
April 11th, 2008 12:22am

Hello, Yes, I believe that it will be impossible if you want to run a logon script in the security context of administrative credential without provide the password in RUNAS. For running a program with elevated privileges instead of using RUNAS, you can post the issue in our MSDN forums: http://forums.microsoft.com/msdn Thanks for your understanding.
Free Windows Admin Tool Kit Click here and download it now
April 11th, 2008 2:26pm

Howdie! three_sixteen wrote: Howdy,Really, this is kind of a crazy question about running programs as an administrator on Server 2008. An application I wrote will execute netstat -anb to collect information about open ports on a server. Because Server 2008 requires elevated priviledges to execute the -b argument this does not work unless the program is launched as an administrator.The program is launched at logon through group policy, so my question is: how can I execute my application as an administrator so I can use the -b argument with netstat in Server 2008 while still launching the program at logon through group policy? As I understand, I could package the executable inside of another which executes the runas command. However, I'm not comfortable leaving an administrator password in plain sight. Have you tried deploying the script as a computer startup script? That way it'll be launched in the SYSTEM context - that should have sufficient permissions to execute the command. I haven't tried that myself, but I guess it should work pretty well. cheers, Florian
April 11th, 2008 3:43pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics