Re: adding windows user via sp_cmdshell

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/23/04


Date: Fri, 23 Jul 2004 20:59:09 +0530

Hi,

I agree with you peter. To do this you might need to start the MSSQL server
service using
a Domain Administrator account. I will not suggest you this.

I will not recommend you to create users / Groups from Query Analyzer.

Thanks
Hari
MCDBA

"Peter" <anonymous@discussions.microsoft.com> wrote in message
news:2dc001c470c1$74fea120$a301280a@phx.gbl...
> Hi Tom
>
> As Hari said it is possible, but difficult. The problem
> here is its taking the userid of SQL Server instance that
> the runs the xp_cmdshell and attempting to create users.
> If that userid doesn't have the Server (not SQL)
> permission to do its going to crash and burn.
>
>
> >-----Original Message-----
> >Hello Hari,
> >
> >I have tried it, but it did not work for me, I got:
> >The request will be processedat DC ....
> >System error 5 has occurred
> >Access denied.
> >
> >I got this regardless if I'm using SA account to open
> Query Analizer or windows auth... where am member of
> domain admin. any idea...
> >
> >"Hari Prasad" wrote:
> >
> >> Hi,
> >>
> >> Yes. See the OS commands NET USER and NET GROUP in OS
> Help. You can use this
> >> command from Query Anayzer using XP_CMDSHELL.
> >>
> >> Sample
> >>
> >>
> >> Master..XP_cmdshell 'net user Fin_user
> password /DOMAIN /ADD'
> >> go
> >> Master..XP_cmdshell 'net group Finance /DOMAIN /ADD'
> >> go
> >>
> >>
> >> For more details of command execute the below from
> command prompt
> >>
> >> net user ?
> >>
> >> net group ?
> >>
> >> Thanks
> >> Hari
> >> MCDBA
> >>
> >>
> >> "TOM P." <TOMP@discussions.microsoft.com> wrote in
> message
> >> news:E8D38151-CF4C-4EF9-A713-
> 617E25BA2AEE@microsoft.com...
> >> > assuming SQL server nt service is started under
> domain user with right to
> >> create windows user in domain, is there a way to
> execute sp_ in QA that
> >> allow mw to create domain user, set password and add
> user to group in
> >> domain? if so can anyone provide this statment.
> >> >
> >> > Tom,
> >>
> >>
> >>
> >.
> >



Relevant Pages

  • Re: adding windows user via sp_cmdshell
    ... >a Domain Administrator account. ... >> here is its taking the userid of SQL Server instance ... >> If that userid doesn't have the Server ...
    (microsoft.public.sqlserver.security)
  • Re: Connectcomputer works partly but does not complete
    ... Does your domain administrator account have a login script assigned to the account? ... Double checking both computers have had the client applications re-applied ... on the server, and I have logged off and back on but still nothing. ...
    (microsoft.public.windows.server.sbs)
  • RE: Red x on Event log
    ... Does the problem occur if you view event log on other member server? ... Did you try the domain administrator account? ... Digitally sign server communications - disabled ... Secure channel: Digitally encrypt or sign secure channel data - ...
    (microsoft.public.windows.server.migration)
  • Re: XP to win2003 problem
    ... "Chris Lawson" wrote: ... > itself using the domain administrator account or did you do them ... >> I have been asked to set up a network comprising one Win2003 server acting as ... >> when I try to join a client to the domain I get the Access is denied error. ...
    (microsoft.public.windows.server.general)
  • Access is denied
    ... client from a SBS2000 server onto a new SBS2003 server. ... When I viewed the dispatch log, ... The agent will not be ... instead of the 2000 domain administrator account. ...
    (microsoft.public.windows.server.migration)