Re: set AD password from a SQL proc?
From: Mike Epprecht \(SQL MVP\) (mike_at_epprecht.net)
Date: 03/29/05
- Previous message: Al Blake: "set AD password from a SQL proc?"
- In reply to: Al Blake: "set AD password from a SQL proc?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
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
>
>
- Previous message: Al Blake: "set AD password from a SQL proc?"
- In reply to: Al Blake: "set AD password from a SQL proc?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|