By David Wiseman (Administrator)Created 01 Mar 2008
Bookmark and Share
My Rating:
Vote
Rating:
Not Rated
Views:2582
Downloads:82

Write Remote Access Permission (msNPAllowDialIn) attribute

Language:  VBScript

Compatibility

Windows XP Yes Windows 2003 Yes
Windows 2000 Unknown Windows NT Unknown
Vista Unknown Windows 2008 Unknown
Description

Modify the msNPAllowDialIn attribute. The "Remote Access Permission (Dial In or VPN)" attribute in the "Dial-In" page of the user dialog in Active Directory Users and Computers.

Code

Line Numbers: On  Off      Plain Text
Const ADS_PROPERTY_CLEAR = 1

DIM objUser
'<<<< Bind to the user object using the distinguished name >>>>
set objUser = GetObject("LDAP://cn=user1,cn=users,dc=wisesoft,dc=org,dc=uk")

' Control access through remote access policy
objUser.PutEx ADS_PROPERTY_CLEAR, "msNPAllowDialIn", null
objUser.setinfo 'Save Changes
wscript.echo "Setting changed to 'Control access through remote access policy'"

' Allow Access
objUser.Put "msNPAllowDialIn", TRUE
objUser.setinfo 'Save Changes
wscript.echo "Setting changed to 'Allow Access'"

' Deny Access
objUser.Put "msNPAllowDialIn", FALSE
objUser.setinfo 'Save Changes
wscript.echo "Setting changed to 'Deny Access'"

 


Got a useful script? Click here to upload!


 

  Post Comment
Order By:  
User Comments
      
Be the first to post a comment!