danjferguson
01-10-07, 23:14
A quick run down of what I'm trying to do:
I'm have batch files (named admin.bat and share.bat respectively)loaded that look like this:
runas /netonly /user:%1\admin "\\server\share\%1.msc"
and this:
runas /netonly /user:%1\admin "\\%1\share"
I used this to give inexperienced users access to certain remote computer drives and management consoles that I made up with mmc. I was typing out each computer name and creating new batch files for each computer on my network, but this is very time consuming, especially during equipment change outs with new computers/computer names. I already have a word document made up with a table of all the computers in my network, and I also have scripts made to export AD info to excell if I wanted to even automate that, but I am unable to insert the text of the computer name from the document to run right after the batch file so it runs in the command line like this on a computer with the computer name CPU1:
runas /netonly /user:cpu1\admin "\\server\share\cpu1.msc"
Is there anyway to get the CPU1 to follow the entry of admin.bat when the command line is opened? I have scoured the web for hours looking for something that would do it but it seems my situation is unique. No, I cannot give users access to the AD or give them local administrator accounts otherwise this would be easy. I also dont want to do this every time someone new needs access, when I can just give them a password that I have specified and they enter it when they click on the link to this batch file. Is there a VBS command I can use to accomplish this? I have some VBS experience, but not enough to tackle this one.
I'm have batch files (named admin.bat and share.bat respectively)loaded that look like this:
runas /netonly /user:%1\admin "\\server\share\%1.msc"
and this:
runas /netonly /user:%1\admin "\\%1\share"
I used this to give inexperienced users access to certain remote computer drives and management consoles that I made up with mmc. I was typing out each computer name and creating new batch files for each computer on my network, but this is very time consuming, especially during equipment change outs with new computers/computer names. I already have a word document made up with a table of all the computers in my network, and I also have scripts made to export AD info to excell if I wanted to even automate that, but I am unable to insert the text of the computer name from the document to run right after the batch file so it runs in the command line like this on a computer with the computer name CPU1:
runas /netonly /user:cpu1\admin "\\server\share\cpu1.msc"
Is there anyway to get the CPU1 to follow the entry of admin.bat when the command line is opened? I have scoured the web for hours looking for something that would do it but it seems my situation is unique. No, I cannot give users access to the AD or give them local administrator accounts otherwise this would be easy. I also dont want to do this every time someone new needs access, when I can just give them a password that I have specified and they enter it when they click on the link to this batch file. Is there a VBS command I can use to accomplish this? I have some VBS experience, but not enough to tackle this one.