Re: script RUNAS for mapping access to a drive



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)
.



Relevant Pages

  • script RUNAS for mapping access to a drive
    ... 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 ... users only to map to the specified drive. ...
    (microsoft.public.windows.server.scripting)
  • Re: script RUNAS for mapping access to a drive
    ... you disabled rightclicking? ... 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 ... authorized users only to map to the specified drive. ...
    (microsoft.public.windows.server.scripting)
  • Re: Access Permissions
    ... In order to map the drive...they had to supply credentials, user name and password, correct? ... for that period during which they are powered up...they've entered credentials which allow them to browse ... user is able to browse any shared folder in addition to the one that was ... network places, the shared folders are still visible. ...
    (microsoft.public.windows.server.sbs)
  • If a drive is already mapped, then open Windows Explorer
    ... have users that will be connecting to a Terminal Server in order to ... map a network drive to a share that exists in a different domain then ... open Windows Explorer to the drive they mapped. ... would then go ahead and prompt the user for username and password. ...
    (microsoft.public.scripting.vbscript)
  • Re: Access Denied Trying To Connect To Printer Share
    ... You can't map a drive. ... doesn't like the credentials initially passed to it. ... > accepting the credentials as it is seeing them as something like ... >> The printer permissions are set to allow access to everyone, ...
    (microsoft.public.windowsxp.security_admin)