OK im trying to update the user profile of people that are logged on to the
machine. I was hoping to use something like the logon_user =
Request.ServerVariables("LOGON_USER") that we can use in .NET but if not
thats not a problem I know i can get it from registry. But if anyone knows
how can you please give me an example. Now Im using the following code to
query a perticular user in active directory. But I need to modify the user
profile
'---------------------------------------------------------------------------------------
Option Explicit
Const ADS_SCOPE_SUBTREE = 2
Dim strName
Dim strTSProfile
Dim strTSHomeDrive
Dim strProfile
Dim rs
Dim cnn
Dim cmd
Dim objuser
Set cnn = CreateObject("ADODB.Connection")
Set cmd = CreateObject("ADODB.Command")
' Open the connection.
cnn.Provider = "ADsDSOObject" ' This is the ADSI OLE-DB provider name
cnn.Open "Active Directory Provider"
' Create a command object for this connection.
Set cmd.ActiveConnection = cnn
' Compose a search string and replace DC=YourDomain, DC=COM
cmd.CommandText = "select name, distinguishedname, profilepath, homedrive,
homedirectory, userPrincipalName" _
& " from 'LDAP:// OU= NY, DC=FFHSJ, DC=COM' WHERE objectCategory='user' And
objectCategory='person' and userPrincipalName='wahidta@ffhsj.com'"
cmd.Properties("Page Size") = 1000
cmd.Properties("Timeout") = 30
cmd.Properties("Searchscope") = ADS_SCOPE_SUBTREE 'search all containers
cmd.Properties("Cache Results") = False
Set rs = cmd.Execute
MsgBox "done"
'-------------------------------------------------------------------------------------
How can I use the recordset to make a change on that field and comit it back
to active directory??
Thanks.