Run Script as an Admin
Right now I want to run the dxdiag and silently and export the results to a file on the server.
dxdiag /t \\services\SYSVOL\green.local\scripts\DXDIAG_Config\%computername%.txt
The line was added to my logon script and it does what it is supposed to but my problem is that it needs to run with admin privileges. I need to use the runas command but a batch file would show the password in plain text.
I have thought about creating a msi package that would execute the batch file. If I use this then I would probably be using this to install it via GPO.
My other idea was to use a vbscript to elevate the user privlidge and run the batch file, but I dont know anything about vbscrip.
dxdiag /t \\services\SYSVOL\green.local\scripts\DXDIAG_Config\%computername%.txt
The line was added to my logon script and it does what it is supposed to but my problem is that it needs to run with admin privileges. I need to use the runas command but a batch file would show the password in plain text.
I have thought about creating a msi package that would execute the batch file. If I use this then I would probably be using this to install it via GPO.
My other idea was to use a vbscript to elevate the user privlidge and run the batch file, but I dont know anything about vbscrip.
Comments
-
RobertKaucher Member Posts: 4,299 ■■■■■■■■■■Do you need this to run every single time a user logs in, or are you just looking for every now and again?
PSEXEC might be a good alternative... -
bwcarty Member Posts: 422 ■■■□□□□□□□Make it a computer startup script instead of a user logon script.Help eradicate blood cancers with a donation to the Leukemia & Lymphoma Society.
-
RTmarc Member Posts: 1,082 ■■■□□□□□□□Make it a computer startup script instead of a user logon script.
This would be the best move in this case.