
setting description on a computer account in AD
Try using some of this. It works in NT Server 4.0
<%
' Phase one--Setup
Dim username ' login name
Dim fullname ' full name
Dim descript ' Description
Dim Password ' Password
Dim ComputerObj ' Computer Object
Dim NewUser ' user object
On Error Resume Next
Username = "username"
Fullname = "fullname"
Descript = "This is a test user's description"
Password = "password"
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE>Add User</TITLE>
</HEAD>
<BODY BGcolor=#FFFFFF>
<%
' Get object for computer
Set ComputerObj = GetObject("WinNT://your DOMAIN here")
If Err Then adsiErr()
%>
Create New User on <%= ComputerObj.Name %>
<%
'Phase 2--Create the new user
Set NewUser = ComputerObj.Create("User", UserName)
NewUser.SetInfo
if err then adsiErr()
Response.Write "Creating User:<B> " & NewUser.Name & "</B>...<BR>"
' Phase 3
' Set Password
NewUser.SetPassword(Password)
Response.Write "Setting Password ... <BR>"
NewUser.SetInfo
' Set Fullname
NewUser.Fullname = FullName
Response.Write "Setting Full Name ... <BR>"
NewUser.SetInfo
' Set Description
NewUser.Description = Descript
Response.Write "Setting Description ...<BR>"
NewUser.SetInfo
Response.Write "Done!!! <BR>"
%>
<P> </P>
</BODY>
</HTML>
John
Quote:
> Does anyone know how to set the description on a computer account in
active
> directory? I can bind to the AD alright but if I try to change the
> description I get some error that says that the command violates the
schema
> rules. If anyone has done this and has sample code that would be great.
> Thanks,
> Brent Grooms