Jump to content

Recommended Posts

Posted (edited)

If you install Quest's PowerShell AD cmdlets you could do the following using a combination of Get-QADUser and Set-QADUser...

 

# Load the Quest Snap-in
Add-PSSnapin Quest.ActiveRoles.ADManagement

# Modify remote access permissions for all users in "example" OU
Get-QADUser -SearchRoot 'domain.internal/example' -SizeLimit 0 | Set-QADUser -ObjectAttributes @{msNPAllowDialin=$true}

# [b]Source[/b]
# http://www.powergui.org/thread.jspa?messageID=46028

 

I also came across the following VBScript...

 

Dim aConnection, aCommand, aResult, strLDAPPath, user, objUser
strLDAPPath = InputBox("Please enter the LDAP path of the OU:")
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)
       objUser.Put "msNPAllowDialin", TRUE
       objUser.SetInfo
       aResult.MoveNext
Loop

Edited by Arthur
  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



  • 43 When would you like EduGeek EDIT 2025 to be held?

    1. 1. Select a time period you can attend


      • I can make it in June\July
      • I can make it in August\Sept
      • Other time period. Comment below
      • Either time

×
×
  • Create New...