0

In Windows 2003 Server, I have a service running called 'SQL Server Reporting Services'.

This service will Stop at times, and when I try to Start it, it would give an Error as:

'Error 1069: The Service did not start due to a logon failure.'

After which, I would go to Properties -> Logon -> this account -> Give Username and Password.

After Applying the Changes, I can start the Service.

How do I go about writing a Script which would Automate this setting username and password and starting the Service? Also, is there any way to check if the Service is in a Run State and if not, script the logon step and start it?

Thank you.

Laba Ningombam
  • 105
  • 1
  • 2
  • 7

2 Answers2

0

I would suggest installing powershell for server 2003.

Have a look at this Powershell script to change service account.

You can user get-service to find if the service is running.

Cjones108
  • 35
  • 3
0

Something like the following could help. (For a Windows machine)

----> Refresh_SSRS.ps1
Stop-Service “SQL Server Reporting Services (SQLSRV)”
Start-Service “SQL Server Reporting Services (SQLSRV)”
$wc = New-Object system.net.webClient$wc
$cred = [System.Net.CredentialCache]::DefaultNetworkCredentials
$wc.Credentials = $cred
$src = $wc.DownloadString(“http://ComputerNamexxx/Reports_xxxxxx/Pages/Folder.aspx“)



---->Run in Task Scheduler - on a regular occurance - where the user account can be assoicated:
Powershell.exe
-ExecutionPolicy Bypass -File C:\commands\Refresh_SSRS.ps1
level3looper
  • 1,015
  • 1
  • 7
  • 10