Re: script RUNAS for mapping access to a drive
- From: "/\\/\\o\\/\\/ [MVP]" <no@xxxxxxxx>
- Date: Mon, 06 Feb 2006 20:47:40 +0100
Jimmy D wrote:
you disabled rightclicking? why on earth would you do this?
"altria" <urbantec92@xxxxxxx> wrote in message news:%231KP1FDKGHA.2828@xxxxxxxxxxxxxxxxxxxxxxx
Hello All,
I would like to know how I can create a VBS script to prompt for credentials in order to map a drive, such as using RUNAS command with .MapNetworkDrive method?
I have disabled right-click on machines, thus that option is not available. I would rather let the small app sit on the desktop and allow authorized users only to map to the specified drive.
TIA,
Altria
BTW Win2k3 AD and xpsp2 clients
You can use
Set objNetwork = WScript.CreateObject("WScript.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath,strProfile, strUser, strPassword
Look here how to mask the password :
http://www.microsoft.com/technet/scriptcenter/resources/qanda/feb05/hey0204.mspx
gr /\/\o\/\/
PS in MSH :
MSH>$cred = get-credential ; (new -com WScript.Network).MapNetworkDrive("x:","\\localhost\d$",$null,$cred.user,$cred.GetNetworkCredential().password)
.
- References:
- script RUNAS for mapping access to a drive
- From: altria
- Re: script RUNAS for mapping access to a drive
- From: Jimmy D
- script RUNAS for mapping access to a drive
- Prev by Date: VBS set AD password problems
- Next by Date: Re: [MSH] MSH Not So Great For Interactive Users
- Previous by thread: Re: script RUNAS for mapping access to a drive
- Next by thread: Re: Distribute files from the server to client machines
- Index(es):
Relevant Pages
|