![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Creating or copying a file with alternate credentials We're using a management tool to run a VBS against our machines off hours, so most of them will not have a user logged on at the time the script runs. Under certain circumstances we want the script to write a file to a network share. The problem is because the management tool is running the script it runs as SYSTEM on the PC. I need to provide domain credentials to write to the share. Right now my script is attempting oFSO.CreateTextFile to the share and it fails. Is there a way to pass credentials to that? If not (and I think that will be the case) how else might I accomplish this file write? Thanks, Tom |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Creating or copying a file with alternate credentials "T Ker" <thomasDOTkerA@xxxxxx> wrote in message news:uHx%23V5IMKHA.1268@xxxxxx Quote: > We're using a management tool to run a VBS against our machines off hours, > so most of them will not have a user logged on at the time the script > runs. Under certain circumstances we want the script to write a file to a > network share. The problem is because the management tool is running the > script it runs as SYSTEM on the PC. I need to provide domain credentials > to write to the share. Right now my script is attempting > oFSO.CreateTextFile to the share and it fails. > > Is there a way to pass credentials to that? If not (and I think that will > be the case) how else might I accomplish this file write? > > Thanks, > > Tom account in order to give it sufficient access to the share. The alternative is to use one of the many "runas" look-alikes (e.g. sanur). This creates a big security hole because you will have to embed a domain password in the script. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Creating or copying a file with alternate credentials Thanks, Pegasus. I'm working with the built-in RunAs now and I've got this command line working interactively... runas /noprofile /env /user:MyDomain\DomainUser "%SystemRoot%\System32\wscript.exe \"C:\{path}\Audit.vbs"\" Now, how can I get the password into it? Thanks, Tom "Pegasus [MVP]" <news@xxxxxx> wrote in message news:ONwudwJMKHA.3704@xxxxxx Quote: > > "T Ker" <thomasDOTkerA@xxxxxx> wrote in message > news:uHx%23V5IMKHA.1268@xxxxxx Quote: >> We're using a management tool to run a VBS against our machines off >> hours, so most of them will not have a user logged on at the time the >> script runs. Under certain circumstances we want the script to write a >> file to a network share. The problem is because the management tool is >> running the script it runs as SYSTEM on the PC. I need to provide domain >> credentials to write to the share. Right now my script is attempting >> oFSO.CreateTextFile to the share and it fails. >> >> Is there a way to pass credentials to that? If not (and I think that >> will be the case) how else might I accomplish this file write? >> >> Thanks, >> >> Tom > The ideal solution would be to run the management tool under a domain > account in order to give it sufficient access to the share. The > alternative is to use one of the many "runas" look-alikes (e.g. sanur). > This creates a big security hole because you will have to embed a domain > password in the script. > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Creating or copying a file with alternate credentials "T Ker" <thomasDOTkerA@xxxxxx> wrote in message news:OBsPn$UMKHA.5192@xxxxxx Quote: > Thanks, Pegasus. > > I'm working with the built-in RunAs now and I've got this command line > working interactively... > > runas /noprofile /env /user:MyDomain\DomainUser > "%SystemRoot%\System32\wscript.exe \"C:\{path}\Audit.vbs"\" > > Now, how can I get the password into it? > > Thanks, > > Tom (http://www.joeware.net/win/free/tools/cpau.htm). |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Creating or copying a file with alternate credentials Hi Tom, If your machines are joined to a domain you can add "domain computers" to share and ntfs rights - this would allow the system accounts of domain joined machines to write to the share. Jens "T Ker" <thomasDOTkerA@xxxxxx> skrev i en meddelelse news:uHx%23V5IMKHA.1268@xxxxxx Quote: > We're using a management tool to run a VBS against our machines off hours, > so most of them will not have a user logged on at the time the script > runs. Under certain circumstances we want the script to write a file to a > network share. The problem is because the management tool is running the > script it runs as SYSTEM on the PC. I need to provide domain credentials > to write to the share. Right now my script is attempting > oFSO.CreateTextFile to the share and it fails. > > Is there a way to pass credentials to that? If not (and I think that will > be the case) how else might I accomplish this file write? > > Thanks, > > Tom > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Create an AD Group with Alternate Credentials | VB Script | |||
| Executing LNK files with alternate credentials | PowerShell | |||
| executing ps1 from a web browser, alternate credentials | PowerShell | |||
| Access denied when copying/creating file | Vista General | |||
| Access denied when copying/creating file | Vista General | |||