How Can I Add/remove An User In Active Directory, Under Windows 2000 Server?
I need a function which creates/removes an user in a organisation unit in the Active Directory.
The program should automaticaly set the username, password, description, etc.
Any suggestions?
thx, vbzero
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Remove Just User From A Active Directory Group
Hi all,
I'm trying to delete only the user from a group in our AD. The script I'm using works OK but it also delete's the other groups that are members. So I need help to remove only the user and not the user and other groups (if that makes sense). Below is the script I'm currently using.
Code:
Const ADS_PROPERTY_CLEAR = 1
Set objGroup = GetObject("LDAP://cn=Finance Users, ou=Finance, dc=test, dc=com")
objGroup.PutEx ADS_PROPERTY_CLEAR, "member", 0
objGroup.SetInfo
Many thanks,
Thomas
2000 Server Active Directory
Thanking everyone in advance,
I have been an AS400 RPG programmer for many years - moving into visual
studio. I have both visual studio 6 and .net, but far more experience with
6. I would like to create a program that could access our active directory
and display an up to date telephone list for the organization on client
computers. Does anyone know where I may find an example of a program that
will do this, or know the basics of how it would be done. Our domain server
runs Windows 2000 Server, and all clients run Windows 2000 Professional.
Exchange is also run on a separate Windows 2000 Server machine, but I'm not
sure how the active directory users list fits in.
Joe in Florida
Access To Active Directory Windows 2000
I want to Ask one question,
I wanto make previlage for my application, but i want to get user name from windows 2000.
Can you explaint to me?
Please help me
Thanks.
Create An New User In Windows 2000/Whistler, Or 2000 Server
I need some informations about how to create an new user account in Windows 2000/Whistler, or 2000 Server.
This is necessary because I have to create some accounts automaticaly.
E.g. I have to create accounts from 01 to 36.
On each account there stands a string before the number.
This should look like [string][number] (e.g. 2ben01).
Any suggestions?
thx, vbzero
Active Control +dll On Windows 2000 Server
We have certain activex controls and dll for our application use registered on each machine .
Now we have shifted from workgroup networking to domain network .
I want to set up these com components on our server ( win 2000 ) so that any application ( on client machines ) which requires the these components should run these components from the server .
How to go about it.
Thanks for any suggestions .
User In Active Directory
I want user give account information for varifying themself and these account informations were kept in Active Directory. How can I use LDAP or ADSI using VB to do like this?
Thank You,
How To Get OU Of An Active Directory User
Hi,
I have this cls code that gets the rights of a certain user. For example:
john doe - member of "General Administrators"
the output is "General Administrators".
Right now, the code is working if the OU of the user is hard-coded. What i want right now is to be able to add a code to determine on which OU the user belongs.
Here is my current code:
Public Function GetRights() As String
Dim aADSObject
Dim iADSObjCount As Integer
Dim iElement As Integer
Dim sDelimiter As String
Dim sADsPath As String
Dim sApplication As String
Dim sMemberOf As String
sDelimiter = "|:|"
sADsPath = "LDAP://CN=DPI.Juan P. Dela Cruz,OU=MSSite.Clint,OU=DPI,OU=MS.Net,DC=clidvserver,DC=vtrsserver,DC=com"
sApplication = "OU=Rights,OU=MSGRPS.Group,OU=DPI,OU=MS.Net,DC=clidvserver,DC=vtrsserver,DC=com"
GetRights = ""
aADSObject = Split(sADsPath, sDelimiter)
iADSObjCount = UBound(aADSObject)
For iElement = 0 To iADSObjCount
sMemberOf = ChkAndGetADSObjAttr(GetObject(aADSObject(iElement)), "memberOf")
sMemberOf = Mid(Replace(sMemberOf, "," & sApplication, ""), 4)
Next iElement
GetRights = sMemberOf
End Function
Any suggestions?
Get User From Active Directory
hi everyone
I have a question,
my pc is in a domain and active directory.
when I log in on my OS I use an user which is registered in active directory server,I want to able get that user.
I tried getusername api, but is not return user of the active directory
which I am using in my session on windows client.
any help, thanks in advance
Exchange 2000 Disclaimer With Active Directory Integration
I am creating an Exchange event sync. for outbound SMTP messages.
I want to integrate it with Active Directory so that I can include user information (phone number, im address, etc.) in the disclaimer.
I also want to include, if possible, a company logo in the disclaimer.
I am okay with creating a basic text disclaimer and the event sync., but I am looking for suggestions on how to best incorporate the AD and Logo. Any thoughts?
User Info From Active Directory
I have some code that gets user info from Active Directory, but it's incredibly slow as i can't code it properly. Basically, it searches through all the users until it finds the user i want, then it displays the info. Is there a better way of doing it?!
Here's the code
Code:
Private Sub ListUsers(Domain)
Dim objcomputer As IADs
Dim objuser As IADs
Set objcomputer = GetObject("WinNT://" & Domain)
objcomputer.Filter = Array("User")
For Each objuser In objcomputer
If objuser.Name = Text1.Text Then
'if the user matches the text in my text box then display all the info
Text2.Text = Text2.Text & "Name: " & objuser.Name & vbCrLf
Text2.Text = Text2.Text & "Fullname: " & objuser.FullName & vbCrLf
Text2.Text = Text2.Text & "Description: " & objuser.Description & vbCrLf
Text2.Text = Text2.Text & "AccountDisabled: " & objuser.AccountDisabled & vbCrLf
Text2.Text = Text2.Text & "IsAccountLocked: " & objuser.IsAccountLocked & vbCrLf
Text2.Text = Text2.Text & "Profile: " & objuser.Profile & vbCrLf
Else
End If
Next
End Sub
Private Sub Command4_Click()
ListUsers ("campus")
End Sub
Adding An Active Directory User ???
I am having a problem with automating Active Directory management. When adding a user to Active Directory using the following code, it seems to only add the user name as a "SAM Account Name". In other words, while looking in Windows 2000 Server "Active Directory Users and Computers", I only see the user name under "User Logon Name (Pre-Windows 2000)" rather than just plain "User Logon Name". Does anyone have any idea how to add a normal user name (not pre-Windows 2000) ???
My code is as follows:
Dim oContainer As IADsContainer
Dim oUser As IADsUser
Dim oDomain As IADsDomain
Set oContainer = GetObject("WinNT://Some Domain")
Set oUser = oContainer.Create("User", "jsmith")
oUser.SetPassword "somepassword"
oUser.FullName = "Jack Smith"
oUser.SetInfo
Set oContainer = Nothing
Set oUser = Nothing
Any help would be greatly appreciated.
How To Authenticate Active Directory USER
What is the code to authenticate an active directory username and password...
I want VB to connect to Windows 2000 Server and give it username and password to validate a user.
Any Help?
How To Validate User By Active Directory
i have a vb application
user has to enter user id and password
the appication will check the user id and password with active directory in win 2k
how can i do that
Active Directory Search For User
Hi, does anyone know how to search the active directory for a user, using wildcards in a vb app. I would like to be able to type a few letters of a username and have it return all users that have those in their name. Any help would be greatly appreciated.
Disable User In Active Directory
Dear All,
Currently i'm developing a program in VB6 that will check My Active Directory records and automatically disable the user account if the user is already terminated/resigned in our Employee Master Table (MS SQL) in our ERP system. But the problem is I dont know how to start.
Please help. Thanks in advance
rave 7
Get User Details From Within Active Directory
Hi..
Does anyone out there know anything about getting data out of Active Directory, what I am trying to do is to create an application that will populate a listbox with the usernames from active directory and then when one of them is selected a form is opened that will give the users address and contact details that is stored within Active Directory, anyone out there got any idea where I would start with this ?
All help much appreciated, as my knowledge is limited and think I might have bitten off more than I can chew with this one..
Thanks
Retrograde
Active Directory && SQL Server
Does anyone have experience of setting up stored procedures to query ADAM using SSL authentication?
I've been bashing my head against this one for a week; all the examples I find online don't seem to tie in with the OU structure I've been given. Plus I've not found anything with directions on throwing a windows certificate in with it all.
Things haven't been helped by the fact that the ADAM is still in UAT, so I can't be sure how much of the problems I'm having are related to teething problems, rather than my implementation...
Any tips greatly appreciated!
Active Directory - Rename Of An User Account
Hi, how can I change attributes of a user in visual basic or vbscript?
I know how to change the display name or description but I can´t change the user.cn or user.name.
Is there any way?
Active Directory - Send A Message To A User
On a different topic - short of going to the actual active directory program on a server and choosing a user and sending a message to them, is it possible to write a program which will access the active directory, list users and send a message to one of them which can be used on any machine on your network?
Newbie Needs Help With Adding User To Active Directory
i (thought) i'd figured this out, but i'm getting an error of "Microsoft VBScript compilation error '800a03ee" on the following code. can anyone help? i'm not seeing the syntax errors...
<% @language="VBSCRIPT" %>
<%
Const ADS_UF_SCRIPT = &H1
Const ADS_UF_ACCOUNTDISABLE = &H2
Const ADS_UF_HOMEDIR_REQUIRED = &H8
Const ADS_UF_LOCKOUT = &H10
Const ADS_UF_PASSWD_NOTREQD = &H20
Const ADS_UF_PASSWD_CANT_CHANGE = &H40
Const ADS_UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED = &H80
Const ADS_UF_TEMP_DUPLICATE_ACCOUNT = &H100
Const ADS_UF_NORMAL_ACCOUNT = &H200
Const ADS_UF_INTERDOMAIN_TRUST_ACCOUNT = &H800
Const ADS_UF_WORKSTATION_TRUST_ACCOUNT = &H1000
Const ADS_UF_SERVER_TRUST_ACCOUNT = &H2000
Const ADS_UF_DONT_EXPIRE_PASSWD = &H10000
Const ADS_UF_MNS_LOGON_ACCOUNT = &H20000
Const ADS_UF_SMARTCARD_REQUIRED = &H40000
Const ADS_UF_TRUSTED_FOR_DELEGATION = &H80000
Const ADS_UF_NOT_DELEGATED = &H100000
Const ADS_UF_USE_DES_KEY_ONLY = &H200000
Const ADS_UF_DONT_REQUIRE_PREAUTH = &H400000
Const ADS_UF_PASSWORD_EXPIRED = &H800000
Const ADS_UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION = &H1000000
Public Sub CreateUser(strUserName As String, strSAMAccountName As String, strPassword As String)
Dim objMACwifi As IADs
Dim objUsers As IADsContainer
Dim objNewUser As IADsUser
On Error Resume Next
' Bind to the rootDSE object.
Set objMACwifi = GetObject("LDAP://DC=iig1,DC=com")
If (Err.Number <> 0) Then
Exit Sub
End If
' Bind to the Users folder in the domain.
Set objUsers = GetObject("LDAP://CN=DevSite,CN=SiteRoot" & objMACwifi.Get("defaultNamingContext"))
If (Err.Number <> 0) Then
Exit Sub
End If
' Create the user object.
Set objNewUser = objUsers.Create("user", "CN=" + strUserName)
If (Err.Number <> 0) Then
Exit Sub
End If
' Set the sAMAccountName property.
objNewUser.Put "sAMAccountName", strSAMAccountName
If (Err.Number <> 0) Then
Exit Sub
End If
' Commit the new user.
objNewUser.SetInfo
If (Err.Number <> 0) Then
Exit Sub
End If
' Set the initial password. This must be performed after
' SetInfo is called because the user object must
' already exist on the server.
objNewUser.SetPassword strPassword
If (Err.Number <> 0) Then
Exit Sub
End If
' To enable the user account, remove the
' ADS_UF_ACCOUNTDISABLE flag from the userAccountControl
' property. Also, remove the ADS_UF_PASSWD_NOTREQD and
' ADS_UF_DONT_EXPIRE_PASSWD flags from the
' userAccountControl property.
userActCtrl = objNewUser.Get("userAccountControl")
objNewUser.Put "userAccountControl", userActCtrl
If (Err.Number <> 0) Then
Exit Sub
End If
' Commit the updated properties.
objNewUser.SetInfo
End Sub
Response.Redirect("http://www.thedionysian.com")
%>
Using ADO / Active Directory To Validate A User ID In A Group
I have a customer that has an Active Directory domain containing over 2000 groups and many thousand users. This caused multiple problems with the legacy Lan Man module code, so I want to change my system to use Active Directory.
The system needs to validate the existence of a handful of groups, of known names, and validate the membership in those groups of the current user. I have traced down methods to validate the group, return the group object as an IADsGroup, and use the Members collection on the group.
(If there's a better way to validate the group, I'd appreciate it.)
For the user, though, the IADs approach uses the object name, which is not the same as the login name provided by the legacy code. That is, I have available the user ID valjean24601, but the methods I have found expect the user name Jean Valjean.
How do I search Active Directory given a user ID?
Of course, once Active Directory returns the IADsUser object, I can go through the group's collection and look for that user object. And I'm sure there's readily available methods to query Active Directory given both the user and group names.
Active Windows Directory (urgent)
Hello.
I want to set (not retrieve) the active windows directory through VB.
Something like the "cd" dos command (but including the drive).
My problem is that I want to use external programs that use other files.
If for example you want to run a .bat file that has commands but oesn't have the full path for them inside, it won't run correctly.
Thanks.
Getting Account Expiration Date From Active Directory For A Given User
I'm need to create a function that gets the account expiration date from Active Directory for a given user. I've been a VB developer for years, but I'm not that familiar with accssing AD information and I'm not seeing a lot of documentation out there. Any help or code samples would be greatly appreciated.
Ntfs Permission For Active Directory Domain User
hi buddies,
i have a ittle problem.
i wanted to set ntfs permission on a folder for doamin user.
domain is test.com in which organization unit is created as test1
in side their, a user test2 is created. I want to set read ntfs permission for my folder. how can i do this thru vb code.
thanx
Windows Active Directory Computer Enumeration
Hi,
I have been on to a task for Enumerating Computers in a domain.
and this is the Code which am Using for Enumeration.
The Problem is that if the Code is executed once. every thing Seems fine. there are no errors.
if i try to execute this code again
i get an Error "Automation Error ". "Network Path Not Found"
Dim objPDC As IADsContainer
Dim objObject
VB Code:
Set objPDC = GetObject("LDAP://OU=OU4,OU=OU3,OU=OU2,OU=OU1,DC=DC,DC=COM") objPDC.Filter = Array("Computer") For Each objObject In objPDC DoEvents msgbox objObject.Name Next Exit Function
is there any other way to get things done ( i Tried using ADO the Results are the Same . however in this case i get an error "Table does not exists")
Thanks in advance!
Active Directory - Remote Server Management?
I'm developing an application that will run over a LAN, it's connecting to our SQL Server machine 'SQL01'.
A number of groups have been setup on SQL01, prefixed with the name of the application....eg;
XXXA1 System Administrators
XXXA1 Buyer Managers
XXXA1 Buyers
XXXA1 Financial Queries
User accounts have also been created on the server, and mapped into the groups above. When my application starts, it's using ADSI to check the client running the application against the accounts on the server, seeing what groups they belong to and assigning application authority accordingly.
I'd like to develop a form for my application that will allow members of the 'XXXA1 System Administrators' to create groups or users on the server. Does anyone have any example code for managing AD objects remotely? What are the security considerations here, would the user creating the objects need to be connected under a certain profile (or perms assigned to the 'Sys admin group?')
Thanks
Windows Socket Problem Between Windows 2000 Server And XP Professional
It used to work between Windows 2000 server and 2000 professional. When windows 2000 was upgraded to XP prof., it didn’t work. It can’t connect to the remote machine.
Is it possible related to XP's config. such as firewall? i turned the firewall off and it didn't work either.
Is it might related to the new WinSock APIs from XP (Mswsock.dll)? BTW, some codes were copied online posted by Mr. Oleg Gdalevich.
Did anyone have this problem or similar problem? Does anyone has an idea what’s the problem and how to fix it? Thank you so much.
Create A Directory In Windows 2000 - Properties Screwed Up
Ok, i have a problem in windows 95 or 98 i can create a directory with no problems but with windows 2000 when i create a directory the properties of it is all screwd up, is there any way to create a directory and give access to everyone by default.
Kind Regards
Receiving Records From SQL Server 2000 Via Virtual Directory On IIS
Hi all, I've been having some problems and I hope some of you will be able to help me clear things up. Here it is:
I have an application using Jet databases as application documents. On my web server, I have set up a SQL Server 2000 virtual directory pointing to a database with the same structure as the Jet files. Every now and then, a user might want to upload his/her data on to the SQL Server. I do this using XML UpdateGrams and it works great.
However, I haven't found a way to receive data from the SQL Server 2000 and save it to a local database. Is there any way to do this without actually making an ADO Connection to the server, but using the virtual directory?
I mean, there has to be, but I can't seem to figure it out.
Thanks in advance.
Component Not Working In Windows 2003 Server But Working In Windows 2000 Server
hi,
I have a VB upload component which woeks weel with the Windows 2000 server but when i have the same component installed in the Windows 2003 server it is not working. It is displaying the following error. error '800706be' . Searching the microsoft support site i cannot get any relevant information. If anyone has solution for this.
Bye
Sridharan
Moving IIS Server From Windows NT 4 To Windows 2000
Hi all,
Has anyone done migration of IIS server from Windows NT 4.0 to Windows 2000 Advanced server? I like to know the steps involved and complication that may occur during the process. Are there more than one way to do this?
Any help will be highly appreciated.
Thanks.
Windows 2000 User App
I need to create a VB program that can run on a Windows 2000 machine. I want the program to first determine what system user is logged into the WIN2000 workstation. If the user is NOT the Administrator then I need it to hide the My Computer, Start Bar, Network Neighboorood, and Recycle Bin. Does anyone have any Idea how to do this. If you CAN;T hide those icons, how can you lock them so that on a double click there is not response? Your help would be greatly appreciated!!!
Get User Name On Windows 2000 Or XP
Hi!
I have a software running on Win 98 that use GetUserName API function to get the user name of uset that is logged on machine.
Im migration to Win 2000 and this function dont exists. There´s another function to get user name??
Im using also the WNetVerifyPassword function to verify password. I need a function to do the same functionality.
Help!!
Daniel
Creating A User ID On Windows 2000
I am trying to hunt down a routine that will allow me to create a Local User ID on a Windows 2000 box.
I can use a shell call to run net user, but doing this will not allow me to check to see if the user already exists.
Anyone know of an API that will let me create user id's? As a bonus, if I could add them to groups as well, that would be even better, but I'll settle for just adding the ID's.
User Authentication On Windows 2000
hi i want to authenticat a user through my code when he enters his Windows User Name and password. are there any APIs to do this on windows 2000
thanks in advance,
Nishant
In Windows 2000 Server
Does anyone know why I might be getting an error reading something about the "System Registry" when I try to open the References in a project on Windows 2000 Server using VB 6.0 Enterprise Edition?
VB6 Vs. Windows 2000 Server....
well i've made the application in vb6 but when i try to run the setup of my application on the Windows 2000 Server it gives me the following Error:
Setup cannot contiue because some system files are out of date on your system. Click OK if you would like setup to update these files for you now. You will need to restart Windows before you can run set up again. Click cancel to exit setup without updating system files.
some one plz help me, i don't know what to do with this.
ROAMER
Server In Windows 2000
I'd like to start a web server in Windows 2000 and I'd like to have some feedback from the users using DHTML to build a maliling list, for example, or a forum. Can it be done using VB6? I've seen a "DHTML project" option. Where could I find any tutorials covering such aspects?
Thank you.
SQL Server 2000, User Trusted Connection...???
I am having one of those days
Have exported the data from one DB on a server to another DB on another server.
When my app logs in I get the error -2147467259, User not associated with trusted connection.
I do know this as I've done it in the past. How do I set up a user to be a trusted connection???????
I am kicking myself for posting this thread.
Someone slap me...after answering my question of course
Woooofa
Interface Of Active Exe Project Not Visible On Windows 2003 Server
Hi,
I've got the following issue. I've got a VB active exe project, which I instantiate from SQL Server. The project contains some code and a simple interface (form). Normally in nt4, w2k and such, the executable only shows up in the taskmanager, but has no user interface. I solved this, by using DCOMCNFG and setting the identity to the 'interactive user' instead of 'launching user'.
This worked like a charm. I also must note, that it can work as the launching user, only when SQL Server is started from command line, instead of as a service.
But now I'm using windows 2003 server, and I have something similar, working when SQL Server is started command line, but not as a service. So I change the identity to 'interactive user' and it still doesnt work?!?
Does anyone have similar experiences and found a solution?
Thanks in advance.
Best regards,
Eric
|