hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Software and Control Panels : ASP Help Please!
Reply

Forum Jump

ASP Help Please!

Reply Post New Thread In Hosting Software and Control Panels Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old
Junior Guru Wannabe
 
Join Date: Dec 2000
Posts: 41
I'm using the below script to create a new NT user account, only it gives this error with line 13 (the line where i login) I'm logging on as administrator, why does this script work? Can somebody shed some light on this?

UserManager.Server (0x80040522)
A required privilege is not held by the client.
/eat4.asp, line 13

<CENTER><H1>Add a New user account.</H1></CENTER>
<FORM>
UserName : <INPUT NAME=UserName> UserPassword : <INPUT Name=UserPassword><INPUT TYPE=SUBMIT>
</FORM>
<%
UN = Request("UserName")
If UN <> "" Then
'Create Server object For Logon
Set xServer = Server.CreateObject("UserManager.Server")

'www service is usually running under account without Account operator rights.
'Server object is used to logon to the account with the right.
xServer.LogonUser "Administrator", "*******"

'The Next statements are executed under Administrator account.
'Add a new user
Set User = xServer.Users.Add( UN, Request("UserPassword"))

'Some comment For the user
User.Comment = "User from ASP page, " & Now()

Response.Write "User <B>" & UN & "</B> Added.<BR>"

Response.Write "List of users :<BR>"

'List all of server users.
For Each User In xServer.Users
Response.Write "<B>" & User.Name & "</B>, " & User.Comment & "<BR>"
Next

'LogOff the Administrator
xServer.RevertToSelf
End If
%>

__________________
http://beta.sharpwebinnovations.com
my voice is my passport, verify me.



Sponsored Links
  #2  
Old
Junior Guru
 
Join Date: Sep 2000
Posts: 242
What kind of object are you trying to create??

...is the 'usermanager' a separate/third party component.

why not just use ADSI to create your NT account??

  #3  
Old
Junior Guru Wannabe
 
Join Date: Dec 2000
Posts: 41
dah.

Can you show me a ASP code snippet that will use ADI to create it?

Could you please give me an ASP code snippet that creates a new web?

Regards,

__________________
http://beta.sharpwebinnovations.com
my voice is my passport, verify me.

Sponsored Links
  #4  
Old
Junior Guru
 
Join Date: Sep 2000
Posts: 242
Create NT account code snippet..

at its most basic form..

replace machine name with local server name and make sure you have the necessary rights to run the script

good luck!

- -- -

Set oDomain = GetObject("WinNT://WinntMachine")
Set oUser = oDomain.Create ("user", "NewUSerName")
oUser.SetPassword "password"
oUser.SetInfo

----

  #5  
Old
Junior Guru Wannabe
 
Join Date: Dec 2000
Posts: 41
mattan, help

Since you know how to do this, can u post an asp code snippet that would create a new www with iis? I tried using the aspexec and calling the mkw3site.vbs but it doesn't work right.

Regards,


__________________
http://beta.sharpwebinnovations.com
my voice is my passport, verify me.

  #6  
Old
Junior Guru
 
Join Date: Sep 2000
Posts: 242
at its most simplest form...

the basic code..u still need to work on this (i.e error checking, etc). Try looking up the ADSI section at http://www.15seconds.com for more help and code snippets.

Also the originial *.vbs files can be easily modifed to work with ASP.

*ps: if you're interested in taking this further i.e. developing a custom NT panel professionally kindly contact me offline

- - - -

NextInst = server next instance number (you can also script a procedure to automatically get the next server instance number)
Ipadd = ip address
portnum = 80
hostheader = if any host header it goes in here
sTruepath = foldpaer path .. ie. c:\inetpub\xxx

Response.Write "Creating the New Site.."
Set IIsNewObj = WebServerObj.Create ("IIsWebServer", NextInst)
IIsNewObj.ServerComment = "ServerComment"

IIsNewObj.ServerBindings = IpAdd&":"&PortNum&":"&HostHeader
IIsNewObj.SetInfo

Response.Write "Creating Site Root..."
set IIsNewRootObj = IIsNewObj.Create("IIsWebVirtualDir", "Root")
IIsNewRootObj.Path = sTruePath
IIsNewRootObj.SetInfo

  #7  
Old
Junior Guru Wannabe
 
Join Date: Dec 2000
Posts: 41
hmm.

Since you seem to know so much about NT, it would be great to develop a control panel and market it. I'm a GUI designer, and ASP program and damn good at GUI so not only would it work well but we could package it in a very marketable solution.

Anyway maybe you know the anwser to this. Is there a file that stores all the ip address bound to the NIC card? I hate the little networking window where you add the ips, i have a text file and would like to bind all the ips in the text file to the card, without going back and manually typing them all.

Regards,


__________________
http://beta.sharpwebinnovations.com
my voice is my passport, verify me.

  #8  
Old
Junior Guru
 
Join Date: Sep 2000
Posts: 242
..only learning as I go along..

..I havent tried binding the IP to the NIc yet..ASDI probably wouldnt be a good candidate for stuff like that.

you could off course use a *.vbs sript which called the wscript command to do something similiar.

also..try looking up WMI

  #9  
Old
WHT Addict
 
Join Date: Jun 2000
Posts: 141
I have also started building a Control panel but I am having many problems...
NO people are coming up to help me and I can't affort programmers...
I can also market.. I know dedicated hosting companies looking to buy it...
Any people looking up to team up with me and build one - I will surely like to work with you all...
Thanks,

Rajiv mehta

  #10  
Old
Junior Guru Wannabe
 
Join Date: Dec 2000
Posts: 41
hmm.

Count me in.

Fire of an email to:
kizer@sharpwebinnovations.com

__________________
http://beta.sharpwebinnovations.com
my voice is my passport, verify me.

  #11  
Old
Junior Guru
 
Join Date: Sep 2000
Posts: 242
There is definitely market for such products..

..at this point of time.

I also know of local dedicated companies who are very interested in such products... and will be demoing it to them soon.

The only reason I can't put mine up for public demo yet is because mine is built on a 90% ASP based solution (with 1-2 odd dlls), therefore protecting the source will be an issue. I know of one method which is to use the VBscript Encoder which works to some extent, but the better alternative would be to encapsulate the those into COM objects (dlls)

..... like someone mentioned before..it will be awhile till we see any GPL products :-)

but feel free to post any odds questions which you might have regarding the coding... If I know the answer I'll help out

happy coding !

Reply

Related posts from TheWhir.com
Title Type Date Posted


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
WHT Host Brief Email:

We respect your privacy. We will never sell, rent, or give away your address to any outside party, ever.

Advertisement:
Web Hosting News:
WHT Membership
WHT Membership



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?