-
Sep 11th, 2005, 09:24 PM
#1
Create User in Active Directory
You can create a new user in Active Directory with this code.
VB Code:
Dim adObj As Object
Dim adUser As Object
Set adObj = GetObject("WinNT://Domain")
Set adUser = adObj.Create("user", "RobDog888")
adUser.SetInfo
Set adUser = Nothing
Set adObj = Nothing
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Sep 30th, 2005, 09:43 AM
#2
Member
Re: Create User in Active Directory
RobDog,
you are like my savior! Hey, i did find a script to get 'User Name' from AD, but how to get User ID from AD? (Windows 2003 Server). This question is for Classic VB6.0.
Ankeet
-
Feb 20th, 2007, 06:19 PM
#3
Addicted Member
Re: Create User in Active Directory
Hi guys.
This code fails if Option Strict is switched on.
Any ideas on how to change this so it works with option strict
Cheers
-
Feb 20th, 2007, 06:39 PM
#4
Re: Create User in Active Directory
This code works for VB 6 but could be converted for .net use.
Give me a minute.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
-
Feb 21st, 2007, 03:02 PM
#5
Addicted Member
Re: Create User in Active Directory
Thanks mate look forward to seeing the code.
Thanks again
-
May 5th, 2007, 12:59 PM
#6
Addicted Member
Re: Create User in Active Directory
Hi mate did you ever get around to moving this over to vb.2005?
-
May 6th, 2007, 03:15 AM
#7
Re: Create User in Active Directory
No I havent as my server has been down for a while now (hardware parts need replacing) so I dont have a system running AD to test on.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it!
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|