Solved

powershell

Posted on 2011-09-21
8
858 Views
Last Modified: 2012-05-12
For now I cannot use GPO to map network drives on users' computers.
So, I need a vbscript or powershell that would go through a list of computers form a text file like computernames.txt and then maps a network drive on all computers in the text file. It cannot use GPO or group membership.

Thanks,
Paul
0
Comment
Question by:pauledwardian
  • 2
  • 2
  • 2
  • +1
8 Comments
 
LVL 12

Expert Comment

by:prashanthd
ID: 36578701
Do you want to map to any specific subfolder on each computer?
0
 
LVL 70

Expert Comment

by:Chris Dent
ID: 36578949
> maps a network drive on all computers in the text file.

You can do that, but...

The drive will only be mapped in the context of the user executing the script, and since that's you (not your users), how much benefit is that really?

Chris
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 36579075
Agree. One way to accomplish it is to put an file/shortcut into the Startup folder of each user (or All Users), or change the Run registry key of HKCU to run the script. That would mimic a GPO Login script then.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:pauledwardian
ID: 36812811
I need a vbscript or powershell according to my question. Thats the best solution for me now. So, please provide the code if you can help.
"So, I need a vbscript or powershell that would go through a list of computers form a text file like computernames.txt and then maps a network drive on all computers in the text file. It cannot use GPO or group membership."


Thanks,
Paul
0
 
LVL 70

Accepted Solution

by:
Chris Dent earned 400 total points
ID: 36813279
You could have asked for more detail on Qlemo's solution, that's going to be easiest if you need to map the drive for a bunch of users on the computer. It won't be immediately effective and will require a log-off / on (or your users will have to click on something), I don't think we can get around that one.

What you ask, in its pure form, while it sounds simple is exceptionally difficult to do. That is, we can't do this (psuedo-code, don't try it :)):
Get-TheListOfComputers | ForEach-Object { Map-ADrive "B:" "\\Somewhere\share" Computer }

Open in new window

If we did, you'd end up with you logged on to each and every machine, with a nice drive mapping under your user account. I imagine you're not using all the computers at once and kind of need that mapped for whoever is using it?

If the mapping is entirely generic, not at all user specific, you could cheat a bit and dump the batch file in the All Users version of Start-up rather than targeting specific users. Either way, I recommend avoiding HKCU because that introduces figuring out the intended user, and loading / accessing the right hive from HKEY_USERS.

Given that the answer to your question isn't so clear cut, you will have to tell us how you want to proceed. I'm sure we can help, both Qlemo and I are very well versed in scripting technologies.

Chris
0
 
LVL 68

Assisted Solution

by:Qlemo
Qlemo earned 100 total points
ID: 36813957
Nice summary, Chris.
The main issue is that the drive mapping needs to be performed on each machine for each user logging in, and even maybe for Scheduled Tasks, Services or the like. As Chris stated, it sounds easy to do, but isn't at all. Since you do not have (or want to use) a GPO, you need something executing each time a user logs in. It isn't sufficient to perform a one-time action for each machine.
0
 

Author Closing Comment

by:pauledwardian
ID: 36928227
Thanks guys.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Join & Write a Comment

Hi all.   The other day I had to change the passwords for a bunch of users on the fly. Because they were so many, I decided to do it in an automated way and I would like to share it with you all.   If you are not doing it directly in a Domain Co…
A procedure for exporting installed hotfix details of remote computers using powershell
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now