8 posts in this topic

Posted

Hello, basically I have a situation where a VBScript performs a few against queries a mapped drive. It works perfectly as an interactive sessions (such as my user account). However, I do not want it to require an interactive logon, I want it to run as a service account, or something similar, so that it does not require my user input.

 

Here is the layout:

 

1x FreeNAS server with a network share named 'Share1'

1x Windows Server 2008 R2 with a mapped Z:\ drive connecting to \\FreeNAS\Share1. I log onto this Windows Server and run a vbscript that performs queries against the Z:\ mapped drive.

 

Can this be performed without an interactive logon?

Share this post


Link to post
Share on other sites

Posted

Where you can run into an issue is if this location your running the script from has other sessions open to this freenas, lets say billy is logged into the box where the script runs and has a connection to this freenas\share1 -- you can not create another session to freenas from the same location with different credentials.

 

Its quite possible to create the session using whatever creds you want in your script to access the resource -- but if that source has other sessions open to that server your most likely going to have issues.  You normally can not have multiple sessions to the same server from the same location with different creds.

Share this post


Link to post
Share on other sites

Posted

Where you can run into an issue is if this location your running the script from has other sessions open to this freenas, lets say billy is logged into the box where the script runs and has a connection to this freenas\share1 -- you can not create another session to freenas from the same location with different credentials.

 

Its quite possible to create the session using whatever creds you want in your script to access the resource -- but if that source has other sessions open to that server your most likely going to have issues.  You normally can not have multiple sessions to the same server from the same location with different creds.

Thanks for your reply. The script would only be ran once a day to query the free space remaining on the drive, so there isn't an issue with different credentials. However, I do not wish a user to be logged in at all, just having it run as a service account. However I do not think that service accounts can map z:\freenas\share1, as it isn't interactive.

Share this post


Link to post
Share on other sites

Posted

run it as a scheduled task, you won't neet to be logged in with anyone, it will just run.  You can schedule it to run once a month, once a week, once a day, once every minute...alternate months, weeks, days, hours, minutes, etc.  I would think that would be better for you than run as a service. 

Share this post


Link to post
Share on other sites

Posted

run it as a scheduled task, you won't neet to be logged in with anyone, it will just run.  You can schedule it to run once a month, once a week, once a day, once every minute...alternate months, weeks, days, hours, minutes, etc.  I would think that would be better for you than run as a service. 

But can I map a Z:\ drive as a scheduled task without anybody logged on?

Share this post


Link to post
Share on other sites

Posted

Why would you not simply do what you need to do with the unc path vs mapped drives. Drive mapping is for user ease..vbscript should not care between user drive mapping and actual path.

Share this post


Link to post
Share on other sites

Posted

Why would you not simply do what you need to do with the unc path vs mapped drives. Drive mapping is for user ease..vbscript should not care between user drive mapping and actual path.

Unforutunately I don't know how to do that. All my attempts of using the UNC share have shown the CIFS share as having 0 bytes free. (The same as browsing to the UNC path and selecting properties). However, when it is mapped, Windows knows how large and how much is used of the drive as it acts as a volume, rather than a share. I do not know how to get round this. :(

Share this post


Link to post
Share on other sites

Posted

You can use powershell instead, and make a small script to query space after mounting it.

 

use a scheduled job like sc302 described.

 

Set the job to run as whoever has access to mount.

New-PSDrive

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.