June 18, 2009 at 8:20 am
I need to change the SQL 2005 Services logon account from LocalSystem to a windows service account which is part of local admin group. User will enter the userid and password in a HTML form. Please can someone provide a VBScript code to validate the credentials. I have written code something like this :
Set objWMISvc2 = GetObject( "winmgmts:\\" & strComputer & "\root\cimv2" )
Set colItems2 = objWMISvc2.ExecQuery( "SELECT * FROM Win32_Service WHERE DisplayName like 'SQL%' and StartName = 'LocalSystem' ")
For Each objItem2 In colItems2
errorlev = objItem2.Change(,,,, "Automatic",,txtuid.Value,txtpwd.Value)
' I need validation code for txtuid.Value and txtpwd.Value here.
strMsg = strMsg & "Logon account changed for " & objItem2.DisplayName & "
"
Next
June 18, 2009 at 8:49 am
Do you want to track the users or validate the service account for SQL?
if it is the user, use can use the Server Side Trace File if it is the Service account, What is there to validate.. Just enter the ID and see if it works.
Maninder
www.dbanation.com
June 18, 2009 at 9:06 am
Not server side.. Before even logging into SQLServer, user is presented with a HTML form to enter a service account and password. The form checks for validity of service account in AD (i guess) But the form is not validating password for the given service account. It is accepting whatever junk characters are given and is changing the Logon account to the given service account. I need VBscript code to verify password for the given service account.
June 18, 2009 at 9:18 am
June 18, 2009 at 9:29 am
change the SQL 2005 Services logon account from LocalSystem to a windows service account which is part of local admin group. User will enter the userid and password in a HTML form.
In order for a user to change the SQL Server service accounts, they will need to have both Windows Administrator Rights and SQL Server sysadmin rights.
Based on past expiriences with manually attempting to set all of the needed permissions to files,directories and the registry, I have never found the MS provided documentation to be complete and there are always missing privileges or objects.
It also gets even more complicated making the change on a cluster.
Is there some reason that you are not using the MS provided GUIs ?
SQL = Scarcely Qualifies as a Language
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply