سفارش تبلیغ
صبا ویژن

MapNetworkDrive with 5 Arguments

" MNDArguments.vbs
" VB to map a network drive with all 5 arguments.
" Author Guy Thomas http://computerperformance.co.uk/
" Version 1.3 - April 24th 2005
" ----------------------------------------------------------------------"
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUser, strPassword, strProfile

" Values of variables set
strDriveLetter = "H:"
strRemotePath = "\\alan\home"
strUser = "guytom"
strPassword = "£@ssw0rd1"
strProfile = "false"

" This section creates a network . (objNetwork)
" Then apply MapNetworkDrive method. Result H: drive
" Note, this features 5 arguments on lines 21/22.
Set objNetwork = W.Create("W.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, _
strProfile, strUser, strPassword

" Extra code just to add a message box
W.Echo " Launch Explorer, check: "& strDriveLetter
W.Quit

" End of Example .


MapNetworkDrive variations

This does exactly the same job as
Example 1.  What I want to demonstrate here is that there are a multitude
of ways of ing.  By approaching the problem for a different angle
you get perspective on what Microsoft"s VB is all about.

Notes

1.     This example uses lower case for
strDriveLetter.  X or x would work equally well.

2.     Instead of declaring the optional
arguments in advance, I just typed them in where needed.

 

 


" MNDArguments2.vbs
" VB to map a network drive with all 5 arguments.
" Author Guy Thomas http://computerperformance.co.uk/
" Version 2.2 - April 24th 2005
" -----------------------------------------------------------------"
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUser, strPassword, strProfile

" Values of variables set
strDriveLetter = "X:"
strRemotePath = "\\alan\home"

" This section creates a network . (objNetwork)
" Then to apply the MapNetworkDrive method. Result X: drive
Set objNetwork = Create("W.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, false, gt, pass

" Extra code just to add a message box
W.Echo " Launch Windows Explorer, check: "& strDriveLetter
W.Quit

" End of Example VB.


MapNetworkDrive variations

"
MNDArguments2.vbs
" VB to map a network drive with all 5 arguments.
" Author Guy Thomas http://computerperformance.co.uk/
" Version 2.2 - April 24th 2005
" -----------------------------------------------------------------"
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUser, strPassword, strProfile

" Values of variables set
strDriveLetter = "X:"
strRemotePath = "\\alan\home"

" This section creates a network . (objNetwork)
" Then to apply the MapNetworkDrive method. Result X: drive
Set objNetwork = Create("W.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, false, gt, pass

" Extra code just to add a message box
W.Echo " Launch Windows Explorer, check: "& strDriveLetter
W.Quit

" End of Example VB.


MapNetworkDrive with Message box

 

" MapNetworkDrive.vbs
" VB to map a network drive. And provide a message box
" Author Guy Thomas http://computerperformance.co.uk/
" Version 3.2 - September 2005
" -----------------------------------------------------------------"
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath

strDriveLetter = "K:"
strRemotePath = "\\alan\home"

" Purpose of the to create a network . (objNetwork)
" Then to apply the MapNetworkDrive method. Result K: drive
Set objNetwork = Create("W.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath

" Extra code just to add a message box
W.Echo " Launch Explorer, check: "& strDriveLetter

W.Quit

" End of MapNetworkDrive Example Logon .


Instructions to MapNetworkDrive

" MNDArguments.vbs
" VB to map a network drive with all 5 arguments.
" Author Guy Thomas http://computerperformance.co.uk/
" Version 1.3 - April 24th 2005
" ----------------------------------------------------------------------"
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath, strUser, strPassword, strProfile

" Values of variables set
strDriveLetter = "H:"
strRemotePath = "\\alan\home"
strUser = "guytom"
strPassword = "£@ssw0rd1"
strProfile = "false"

" This section creates a network . (objNetwork)
" Then apply MapNetworkDrive method. Result H: drive
" Note, this features 5 arguments on lines 21/22.
Set objNetwork = W.Create("W.Network")
objNetwork.MapNetworkDrive strDriveLetter, strRemotePath, _
strProfile, strUser, strPassword

" Extra code just to add a message box
W.Echo " Launch Explorer, check: "& strDriveLetter
W.Quit

" End of Example .

MapNetworkDrive with extra VB code

"
MapNetworkDrive.vbs
" VB to map a network drive to a UNC Path.
" Author Guy Thomas http://computerperformance.co.uk/
" Version 2.3 - September 2005
" -----------------------------------------------------------------"
Option Explicit
Dim objNetwork
Dim strDriveLetter, strRemotePath
strDriveLetter = "J:"
strRemotePath = "\\alan\home"

" Purpose of to create a network . (objNetwork)
" Then to apply the MapNetworkDrive method.  Result J: drive
Set objNetwork = Create("W.Network")

objNetwork.MapNetworkDrive strDriveLetter, strRemotePath
W.Quit

" End of Example VB.


How can I disable the password requirement for a user in a Windo

How can I disable the
password requirement for a user in a Windows Server 2003 Active Directory
domain?

Windows Server
2003 provides security policies that ensure that all users select strong
passwords. Creating a password policy involves setting the following options in
the Default Domain Group Policy . These policies, with the exception of
those settings related to password lifetime, are enforced on all users in a
domain.

The default
password filter (Passfilt.dll) included with Windows Server 2003 requires that
a password:

·         Is
not based on the user’s account name.

·         Contains
at least six characters.

·         Contains
characters from three of the following four categories:

·         Uppercase
alphabet characters (A–Z)

·         Lowercase
alphabet characters (a–z)

·         Arabic
numerals (0–9)

·         Nonalphanumeric
characters (for example, !$#,%)

As stated above,
this policy is enabled by default.

In some
occasions, such as testing, lab-building, classes and so on, you might want to
disable this built-in requirement.

Security
Warning:
Bare in mind that this
setting can only be enabled/disabled at the domain level, and NOT on an OU
level. Disabling the password requirement for an entire domain will lower your
security configuration, and should only be done when absolutely necessary.

In order to
disable this requirement you need to edit the Default Domain Policy for your
domain.

1.      Go to
Administrative tools folder.

2.      Double-click
on the Default Domain Security Policy icon.

Note: If for any reason you don"t see that icon you can
still edit the Default Domain Group Policy from the AD Users and Computers
snap-in, or from a GPMC window (if you have GPMC installed - Download GPMC).

3.      Navigate
to Security Settings > Account Policies > Password Policy.

4.      Right-click
on the Minimum Password Length option in the right pane and select Properties.


5.      Keep the V
on the Define Setting selected! Do not remove the V from that check-box.
Removing the V will cause the GPO to revert to the default setting, which is
what we are trying to remove in the first place.

6.      Enter 0
(zero) for the number of minimum characters required in a password.


7.      Now
double-click on the Passwords Must Meet Complexity Requirements option in the
right pane.


8.      Again, do
not remove the V from that check-box. Instead, select Disabled.


9.      Click OK
all the way out and close the GPO window.

In order to
refresh the policy type the following command in a CMD window and click ENTER:

Done.

Related articles

You may find
these related articles of interest to you:

·         Add Unlock User Option to Active Directory Users and
Computers

·         Add User Account Information to Active Directory Users
and Computers

·         Create Taskpads for Active Directory Operations

·         Create Users for Testing Purposes

·         Import Saved Queries in Windows Server 2003 AD Users
& Computers

·         LDAP Search Samples for Windows Server 2003 and
Exchange 2000/2003

·         List all Users and Groups in Domain

·         Saved Queries in Windows Server 2003 AD Users &
Computers

·         View Additional User Information in AD Users and
Computers

·         OrgBuilder