RabbieBurns Posted January 7, 2011 Posted January 7, 2011 Im looking to set the dial-in tab of all the objects in a specific OU to Enable.. Is there a way i can do this in bulk? Perhaps by powershell? Cheers
Arthur Posted January 7, 2011 Posted January 7, 2011 (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 January 7, 2011 by Arthur 1
RabbieBurns Posted January 11, 2011 Author Posted January 11, 2011 The latter vbs worked perfectly. However I had to click OK for every item it changed which was a bit tedious.. but it worked fine.. cheers
PiqueABoo Posted January 11, 2011 Posted January 11, 2011 re. the OKs, if you/whoever needs to run it in future, then delete the WScript.Echo line within the while loop. 2
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now