troubleshooting Question

ADSI script -- Setting dial-in privileges

Avatar of tkrajcar
tkrajcar asked on
Windows OS
15 Comments1 Solution2214 ViewsLast Modified:
I have an ADSI program written in VisualBasic that I am running once per hour. It queries an Access database to retrieve a list of users that need their accounts created, and then does all the account creation tasks.

Part of this process is enabling their RAS permissions. We used to do this with the dos command rasgrant, but now that we have an ADSI app to do it, I'd like to do it in the same app. This is setting the 'Remote Access Permission (Dial-in or VPN)' bit to 'Allow access'.

The script runs this portion, but the dial-in permission never actually gets set. The method I am using is one I found on Microsoft's site as well as several other sites.

We need to automate this process.

Here is the code snippet I am using for this process:
Our domain name is "NTDOM". We are running AD in mixed-mode with several DCs.
emailname is the user's logon name, such as 'jdoe'.

        Set objUser2 = GetObject("WinNT://NTDOM/" & emailname & ",user")
        objUser2.DialinPrivilege = True

Thanks for your help.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 15 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 15 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros