Active Directory doesn’t let you edit the Dial-up of VPN access policies for multiple users at once through the GUI. You have to edit this setting one at a time for each user. This can be painstaking if you a lot of users. Luckily there is a VB script available like for almost everything else in AD.

Dim aConnection, aCommand, aResult, strLDAPPath, user, objUser
Const ADS_PROPERTY_CLEAR = 1
strLDAPPath = InputBox("Please enter the LDAP path of the OU:")
WScript.Echo strLDAPPath
Set aConnection = CreateObject("ADODB.Connection")
Set aCommand = CreateObject("ADODB.Command")
aConnection.Provider = "ADsDSOObject"
aConnection.Open
aCommand.ActiveConnection = aConnection
aCommand.CommandText=";(&(objectCategory=Person)(objectClass=User));distinguishedName;subTree"
Set aResult = aCommand.Execute()
Do While Not aResult.EOF
strDN = aResult.Fields("distinguishedName")
WScript.Echo strDN
Set objUser = GetObject("LDAP://" & strDN)
' Comment the following line to manage connection through Remote Access Policy
objUser.Put "msNPAllowDialin", FALSE
' Uncomment the following line to manage connection through Remote Access Policy
' objUser.PutEx ADS_PROPERTY_CLEAR, "msNPAllowDialin", 0
objUser.SetInfo
aResult.MoveNext
Loop


This script will update the access settings for a group of users in a particular OU. Once you run the script, a dialog box will ask you for this OU. Once this is set all users in that OU will be updated.

The AD property this script modifies is ‘msNPAllowDialin’. This property is accepts boolean values. So the three options are

  • TRUE (to allow access)
  • FALSE (to deny access)
  • To manage access via the Remote Access Policy, comment out the

    objUser.Put "msNPAllowDialin", FALSE

    and uncomment the

    ' objUser.PutEx ADS_PROPERTY_CLEAR, "msNPAllowDialin", 0

    line.

     

    ExchMbx is a command-line utility that lets you create user mailboxes, mail enable an AD object, move mailboxes and delete mailboxes among other tasks that can be done using the GUI.

    Ex1:
    ExchMbx -b cn=joe,dc=joe,dc=net -cr srv1:sg1:db2
    Create mailbox for joe in Server srv1, storage group sg1, database db2.

    Ex2:
    ExchMbx -b cn=joe,dc=joe,dc=net -move srv1:sg1:db2
    Ditto ex1 but move.

    Ex3:
    ExchMbx -b cn=joe,cn=users,dc=joe,dc=net -clear
    Clear Exchange attrs for joe, will delete mailbox or
    clean email addresses of mailenabled objects.

    Ex4:
    ExchMbx -b cn=gr1,cn=users,dc=joe,dc=net -me
    Mail Enable group gr1

    Ex5:
    ExchMbx -b cn=con1,cn=users,dc=joe,dc=net -me joe@joeware.net
    Mail Enable contact con1 with email address joe@joeware.net

    ExchMbx can be obtained from joeware.net along with many other useful tools.

    [examples sourced from the ExchMbx Usage page]

     

    The company I work for has been a Windows only shop for a long time and has recently starting moving towards Linux. We’re growing at fast pace and sustaining our operations remaining a Windows shop will be too expensive. That’s not to say we’re completely ditching MS.

    I recently put into service a new server running Ubuntu Server 8.04.1 to host our SVN and continuous build server (Hudson). I was looking for a way to authenticate the server against Active Directory and came across Likewise Open. I was surprised at the simplicity of the whole setup.

    1. sudo apt-get install likewise-open
    2. sudo domainjoin-cli join yourdomain.com yourADusername
    3. sudo update-rc.d likewise-open defaults
    4. sudo /etc/init.d/likewise-open start

    Just make sure to replace yourdomain.com and yourADusername with your own domain name and active directory username. If you’re using a firewall, which you should be, make sure the required TCP/UDP ports are open.

    I still need to figure out how to mount network shares automatically. I’ll keep this post updated with my findings.

    © 2012 !NSFW Suffusion theme by Sayontan Sinha