Re: set AD password from a SQL proc?

From: Mike Epprecht \(SQL MVP\) (mike_at_epprecht.net)
Date: 03/29/05

  • Next message: Maria Garcia: "Re: Privilege in scheduling packages through sql agent jobs"
    Date: Tue, 29 Mar 2005 06:38:51 +0200
    
    

    Hi

    You can call the Extended SP, xp_cmdshell to call your VBS script.

    Something like:
    DECLARE @cmd nvarchar(200)
    SET @cmd = n'createaccount.vbs "fred", "simple" '
    EXEC master..xp_cmdshell @cmd

    Regards
    --------------------------------
    Mike Epprecht, Microsoft SQL Server MVP
    Zurich, Switzerland

    IM: mike@epprecht.net

    MVP Program: http://www.microsoft.com/mvp

    Blog: http://www.msmvps.com/epprecht/

    "Al Blake" <al@_delete_this_.blakes.net> wrote in message
    news:ucDI8eBNFHA.3296@TK2MSFTNGP15.phx.gbl...
    > Can anyone come up with a way to set an AD password from within a SQL
    stored
    > proc?
    > Why?
    >
    > a) we create AD accounts for young kids (age 5 up)
    > b) We use a SQL stored proc to give them easy to remember passwords
    > c) We store these passwords in our SQL database - cos they are young kids
    > and they will forget them ;) - and we need to print them out for teachers
    > d) We would like to be able to actually set the AD password for the user
    > account from *within* the SQL stored proc that generates the password.
    >
    > I know that I can do this from using the ADSI interface in vbscript - but
    > how can I call the vbscript from within a SQL proc?
    >
    > I would like to do something like:
    >
    > SetUserPassword(username='fred',password='simple')
    >
    > Any ideas?
    > Al Blake, Canberra, Australia
    >
    >


  • Next message: Maria Garcia: "Re: Privilege in scheduling packages through sql agent jobs"

    Relevant Pages

    • Re: Run Time Error 7965 when displaying recordset
      ... you should always use a Command object and its ... Dim cmd As ADODB.Command ... However using the generated parameter string from SQL Management ...
      (microsoft.public.access.adp.sqlserver)
    • >> ADOX.Catelog
      ... query/view (has SQL back end). ... Dim cmd As New ADODB.Command ... Dim strSQL As String ...
      (microsoft.public.access.modulesdaovba)
    • RE: C# .NET 2.0 NullReferenceException
      ... Before you make use of Cmd, create a new instace and try. ... Cmd= new Command(); ... > public DataTable ExecuteDataTable(string sql) ...
      (microsoft.public.dotnet.general)
    • using sql to lock, select, then update
      ... what is the standard way of using sql in C# to increment a counter ... column in a shared control table? ... I would like to sql select a row in a table and lock it. ... cmd = new SqlCommand; ...
      (microsoft.public.dotnet.languages.csharp)
    • Re: user defined Role - HELP
      ... They should not need any permissions on the table - unless you are using ... dynamic SQL within the proc. ... are you using SQL 2000 or SQL 2005? ... SQL Server MVP ...
      (microsoft.public.sqlserver.security)