Tag: SQL Server Management Studio

McAfee ePO SQL credentials lost

McAfee ePO SQL credentials lost:

While I was searching for the solution what if I lost McAfee ePO admin password and there were no additional accounts configured, some of the blogs on the internet mentioned that go to https://ServerName:8443/core/config and reset the ‘Admin’ password. This is not the correct solution to reset the ‘Admin’ password.

https://ServerName:8443/core/config is useful to reset the SQL credentials for connecting McAfee ePO 4.x and 5.x to the database. 

Step- by-step procedure to reset the SQL credentials:

Open a web browser and go to https://localhost:8443/core/config-auth
(Where 8443 is the port for the console communication) (see
Image-1)

Image- 1
Image- 1

Log on with ePO credentials. ( See Image-2)

Image- 2
Image- 2

Type ‘sa’ in the User name field. Click on the change password.

For a minute minimize this window and go startà All Programs à MS SQL Server 2008R2 àclick on SQL Server Management Studio, below is shown window will appear ( see Image-3)

Authentication, select ‘Windows Authentication’, click Connect

Image-3
Image-3

Expand SecurityLogins and double-click the ‘sa’ account (or) right click on ‘sa’ click on ‘Properties (see Image-4)

Image-4
Image-4

Type and confirm a password in the General tab under Login name section. 

Click on ‘OK’

Open McAfee ePO web console window (see Image-2)

Type ‘sa’ in the User name field. Click on the change password.

Type the password for ‘sa’ account into the User password and Confirm password fields.

Click Test Connection.

Click Apply, if the test is successful.

Below is shown window will open (see Image-5), restart the McAfee ePO server.

Image- 5
Image- 5

That’s it.

 Happy computing!!

 IMPORTANT: Please follow the same sequence above mentioned. After changing the SQL password if you try to open the ePO web console https://ServerName:8443/core/config it won’t open at all. Even though if you lost the SQL password, still you can open the McAfee web console https://ServerName:8443/core/config, then follow the steps in same sequence.

Source: McAfee

McAfee ePO Admin password lost

McAfee ePO Admin password lost:  

Some time ago I started attending trainings and discussions with industry experts, on McAfee ePO and started learning many things from them. During these sessions I came across some issues with McAfee 4.x and 5.x installation. I have uploaded solutions to some of these issues on my blog, please refer the following link:

https://lakkireddymadhu.wordpress.com/2014/01/16/mcafee-epo-installation-errors/

          One fine morning all of sudden I got a doubt, what if I lost McAfee ePO admin password and there were no additional accounts configured. I opened my laptop and started Googling for the solution. There were more blogs describing this issue, but none had a satisfied solution. After a rigorous search on the Internet, I found two good and easy solutions.

Solution–1: 

We believe that only one account, i.e. Admin account, is configured in McAfee ePO. But by default one more account exists in the McAfee ePO User Management, named system. This account is disabled by default. User ‘system’ account has administrative rights (see the Image-1).

Image- 1
Image- 1

This user (system) is by default non-editable through the web console (see the Image2)

Image- 2
Image- 2

We have to enable the user ‘system’ through MS SQL.

Go to start –> All Programs –> MS SQL Server 2008R2 –> click on SQL Server Management Studio, expand Databases -> expand ePO Database –> expand Tables –>go to dbo.OrionUsers –> right click on dbo.OrionUsers –>click on Edit Top 200 Rows.One window will open on the right side (see the Image-3)

Image- 3
Image- 3

Under the OrionUsers Table –>following changes will need to be done for the user ‘System’

Under Disabled –> default setting will be True, change it to False  (click enter)

Under Interactive –>default setting will be False, change it to True  (click enter)

Minimize the SQL window and Open the McAfee ePO web console and type username: system, Password:system

It will allow you to login. Click on MenuàUnder User Management –>click on Users –>Admin –>Rightside down click on Actions –>click on Edit (see the Image-4& Image -5)

Image- 4
Image- 4
Image- 5
Image- 5

Click on Change Authentication or Credential

Type Password and confirm Password and save (see the Image-6)

Image- 6
Image- 6

Log off and Login with Admin credentials. That’s it.

Now Open SQL and make the same changes in OrionUsers Table (Exactly as shown in the Image-7)

Image- 7
Image- 7

Under Disabled –>change it to True  (click enter)

Under Interactive –> change it to False  (click enter)

Solution–2:

In solution 1, enabling of the user system’ account through MS SQL resets Admin the Password.

In Solution -2, we will create a new account with Administrative rights using MS SQL and through new account  will reset the Admin password.

Go to start –> All Programs –> MS SQL Server 2008R2 –>click on SQL Server Management Studio, expand Databases –> Click on ePO Database –> open a New Query, run the following query and execute

INSERT INTO [dbo].[OrionUsers]

(Name, AuthURI, Admin, Disabled, Visible, Interactive, Removable, Editable)
VALUES (‘epoadmin‘,’auth:pwd?pwd=7LTSeirrzM8EjqttaozV4cSiPGQWi8w3′,1,0,1,1,1,1)

It will create a new user epoadmin, with the password: epoadmin

Open the McAfee ePO web console with username and password epoadmin

It will allow you to login.Click on Menu –>Under User Management –>click on Users –> Admin –> Rightside down click on Actions –> click on Edit and reset the Admin Password

Log off and Login with Admin credentials. That’s it.

NOTE: Use the above solutions when you don’t have any other option. Be sure you have got the required skills to modify SQL serverYou can break your ePO server if you don’t know what you are doing. Don’t   hold me responsible for your actions; think before you act and always make sure you have a backup 🙂

IMPORTANT: McAfee recommends that you implement account and password management policies such as:

  • Maintaining a backup administrator account
  • Creating individual accounts for each administrator
  • Adhering to corporate requirements for accounts and passwords

Happy computing!!

Source: thegid, cupfighter, McAfee

Scheduling Backups for SQL Server 2005 Express Edition

One drawback with SQL Server 2005 Express Edition is that it does not offer a way to schedule jobs. A database backup in SQL2005 Express Edition is scheduled in both the operating system and SQL Server using the tools.

To schedule a backup of a database:

Steps :

1.    Create a folder ‘BackUp’ in D drive, “D:\Backup“.  ( This can be changed to any folder you like.)

2.    Go to Start>>Programs >>Microsoft Server 2005>>SQL Server Management Studio, Click SQL Server Management Studio. Microsoft Server Management Studio window with Connect to Server dialog box appears (see Figure 1).

Figure1

3.    Enter a password of the server in Password field.

4.    Click Connect. It connects to the database server and Microsoft Server Management Studio window refreshes (see Figure 2).

Figure2

5.    Expand Databases sub folder (see Figure 3).

Figure3

6.    Expand ‘master’ sub folder.

7.    Click   New Query. A new query file opens ( Figure 4 )

Figure4
USE [master]
GO
/****** Object:  StoredProcedure [dbo].[sp_BackupDatabase] Script Date: 26/11/2010 11:40:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[sp_BackupDatabase]
@databaseName sysname, @backupType CHAR(1)
AS
BEGIN
SET NOCOUNT ON;

DECLARE @sqlCommand NVARCHAR(1000)
DECLARE @dateTime NVARCHAR(20)

SELECT @dateTime = REPLACE(CONVERT(VARCHAR, GETDATE(),111),'/','') +
REPLACE(CONVERT(VARCHAR, GETDATE(),108),':','')

IF @backupType = 'F'
SET @sqlCommand = 'BACKUP DATABASE ' + @databaseName +
' TO DISK = ''D:\Backup\' + @databaseName + '_Full_' + @dateTime + '.BAK'''



EXECUTE sp_executesql @sqlCommand
END

8.    Click   to execute the query. It saves the query in the name highlighted in red (see Figure 5) in Stored Procedures sub folder.

Figure5

9.    Click   New Query. A new query file opens.

10.    Type the following query in the new query file.

sp_BackupDatabase ‘readydesk’, ‘F’
GO
sp_BackupDatabase ‘abacus’, ‘F’
GO
QUIT

11.    Place the cursor at the top of the query.

12.    Right-click the mouse. A shortcut menu appears (see Figure 6).

Figure6

13.   Save the file as backup.sql and for our purposes this is created in the “D:\Backup” folder, but again this could be put anywhere.

14.    Goto Start>>Programs >>Accessories>>System Tools>>Scheduled Tasks, click Scheduled Tasks. Scheduled Tasks window appears (see Figure 7).

Figure7

15.    Click ‘Add Scheduled Task’. Scheduled Task Wizard screen appears (see Figure 8).

Figure8

16.    Click Next. Scheduled Task Wizard screen refreshes (see Figure 9).

Figure9

17.    Click ‘Browse’ to SQLCMD.EXE. Select Program to Schedule screen appears (see Figure 10).

Figure10

18.    Browse to select ‘SQLCMD.EXE’ in the programs.

“C:\Program Files\Microsoft SQL Server\90\Tools\Binn”

19.    Click Open. It adds the selected program to the Programs list.

20.    Click Next. Scheduled Task Wizard screen refreshes (see Figure 11).

Figure11

21.    Type the name of the task in Task field.

22.    Click ‘Daily’.

23.    Click Next. Scheduled Task Wizard screen refreshes (see Figure 12).

Figure12

24.    Specify the time to run the task.

25.    Click Next. Scheduled Task Wizard screen refreshes (see Figure 13).

Figure13

26.    Type the credentials of the account such as user name, password and confirm password in respective fields.

27.    Click Next. Scheduled Task Wizard screen refreshes (see Figure 14).

Figure14

28.    Check ‘Open advanced properties for this task when U click Finish

29.    Click. Finish. Database Backups window appears (see Figure 15).

Figure15

30.    Type the command ‘sqlcmd -S serverName -E -i D:\Backup\Backup.sql’ in Run field.

Note: SQL query is denoted as follows:
o    Sqlcmd
o    –S: It defines the server\instance name for SQL Server.
o    serverName: It specifies the server\instance name for SQL Server. For instance,  WS076\SQLEXPRESS\
o    –E: It allows you to make a trusted connection.
o    –i: It states this specifies the input command file.
o    D:\Backup\Backup.sql: It specifies the path of the backup.sql file.

31.    Enter the user name in Run as field.

32.     Click Apply.
33.    Click OK. The database backup is scheduled.
34.    Select ‘Database Backups’ scheduled task in Scheduled Tasks window.
35.    Right-click the mouse. A short-cut menu appears (see Figure 16).

Figure16

36.    Click Run. It runs the task at the scheduled time.