--- title: "SetUnattendedExecutionAccount Method (WMI MSReportServer_ConfigurationSetting) | Microsoft Docs" ms.custom: "" ms.date: "06/13/2017" ms.prod: "sql-server-2014" ms.reviewer: "" ms.technology: "reporting-services-native" ms.topic: conceptual api_name: - "SetUnattendedExecutionAccount (WMI MSReportServer_ConfigurationSetting Class)" api_location: - "reportingservices.mof" topic_type: - "apiref" helpviewer_keywords: - "SetUnattendedExecutionAccount method" ms.assetid: 1ba6be6f-b05c-4ea0-af98-cd0780290b70 author: maggiesMSFT ms.author: maggies manager: kfile --- # SetUnattendedExecutionAccount Method (WMI MSReportServer_ConfigurationSetting) Specifies the account used to execute reports unattended. ## Syntax ```vb Public Sub SetUnattendedExecutionAccount(UserName as String, _ Password as String, ByRef HRESULT as Int32) ``` ```csharp public void SetUnattendedExecutionAccount (string UserName, string Password, out Int32 HRESULT); ``` ## Parameters *UserName* A Windows account to be used for unattended executions. *Password* The password for the specified account. *HRESULT* [out] Value indicating whether the call succeeded or failed. ## Return Value Returns an *HRESULT* indicating success or failure of the method call. A value of 0 indicates that the method call was successful. A non-zero value indicates that an error has occurred. ## Remarks The SetUnattendedExecutionAccount method does not verify whether the report server can log in as the specified user. It is not possible to use the SetUnattendedExecutionAccount method to run unattended executions in the context of the report server Windows service. ## Requirements **Namespace:** [!INCLUDE[ssRSWMInmspcA](../../includes/ssrswminmspca-md.md)] ## See Also [MSReportServer_ConfigurationSetting Members](msreportserver-configurationsetting-members.md)