• Home
  • Linux
  • Docker
  • Windows
    • PS
    • C#
    • Exchange Server
  • Other
    • Perl
    • IPV6
    • MacOS
  • DB
    • MSSQL
    • MariaDB
    • PG

Home

How to enable GPO logging on windows 7 /2008 r2

Details
Written by: po3dno
Category: Other
Created: 29 December 2017
Hits: 1260

 

To enable logging in the Gpsvc.log file, follow these steps.

1. Click Start , click Run , type regedit , and then click OK .

2. Locate and then click the following registry subkey:

HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersion

3. On the Edit menu, point to New , and then click Key .

4. Type Diagnostics , and then press ENTER.

5. Right-click the Diagnostics subkey, point to New , and then click DWORD Value .

6. Type GPSvcDebugLevel , and then press ENTER.

7. Right-click GPSvcDebugLevel , and then click Modify .

8. In the Value data box, type 0x30002 , and then click OK .

9. Exit Registry Editor.

10. At a command prompt, type the following command, and then press ENTER:

gpupdate /force

11. View the Gpsvc.log file in the following folder:

%windir%debugusermode

Re-index the WSUS 3.0 Database

Details
Written by: po3dno
Category: MSSQL
Created: 25 October 2017
Hits: 1346
USE SUSDB
GO
DELETE FROM tbEventInstance WHERE EventNamespaceID = '2' AND EVENTID IN ('381', '382', '384', '386', '387', '389')

 

EXEC SUSDB.dbo.spDeclineExpiredUpdates;1

EXEC SUSDB.dbo.spDeclineSupersededUpdates;1

Для команды spCompressUpdate используется «обёртка»:

USE SUSDB
DECLARE @var1 INT, @curitem INT, @totaltodelete INT
DECLARE @msg nvarchar(200)
CREATE TABLE #results (Col1 INT) INSERT INTO #results(Col1)
EXEC spGetUpdatesToCompress
SET @totaltodelete = (SELECT COUNT(*) FROM #results)
SELECT @curitem=1
DECLARE WC Cursor FOR SELECT Col1 FROM #results
OPEN WC
FETCH NEXT FROM WC INTO @var1 WHILE (@@FETCH_STATUS > -1)
BEGIN SET @msg = cast(@curitem as varchar(5)) + '/' + cast(@totaltodelete as varchar(5)) + ': Compressing ' + CONVERT(varchar(10), @var1) + ' ' + cast(getdate() as varchar(30))
RAISERROR(@msg,0,1) WITH NOWAIT
EXEC spCompressUpdate @localUpdateID=@var1
SET @curitem = @curitem +1
FETCH NEXT FROM WC INTO @var1
END
CLOSE WC
DEALLOCATE WC
DROP TABLE #results

Такая же обертка для spDeleteUpdate:

USE SUSDB
DECLARE @var1 INT, @curitem INT, @totaltodelete INT
DECLARE @msg nvarchar(200)
CREATE TABLE #results (Col1 INT) INSERT INTO #results(Col1)
EXEC spGetObsoleteUpdatesToCleanup
SET @totaltodelete = (SELECT COUNT(*) FROM #results)
SELECT @curitem=1
DECLARE WC Cursor FOR SELECT Col1 FROM #results
OPEN WC
FETCH NEXT FROM WC INTO @var1 WHILE (@@FETCH_STATUS > -1)
BEGIN SET @msg = cast(@curitem as varchar(5)) + '/' + cast(@totaltodelete as varchar(5)) + ': Deleting ' + CONVERT(varchar(10), @var1) + ' ' + cast(getdate() as varchar(30))
RAISERROR(@msg,0,1) WITH NOWAIT
EXEC spDeleteUpdate @localUpdateID=@var1
SET @curitem = @curitem +1
FETCH NEXT FROM WC INTO @var1
END
CLOSE WC
DEALLOCATE WC
DROP TABLE #results


/******************************************************************************  This sample T-SQL script performs basic maintenance tasks on SUSDB  1. Identifies indexes that are fragmented and defragments them. For certain     tables, a fill-factor is set in order to improve insert performance.     Based on MSDN sample at http://msdn2.microsoft.com/en-us/library/ms188917.aspx     and tailored for SUSDB requirements  2. Updates potentially out-of-date table statistics.  ******************************************************************************/   

Read more …

Windows 10 Allows File Paths Longer Than 260 Characters (With a Registry Hack)

Details
Written by: po3dno
Category: Power Shell
Created: 13 February 2017
Hits: 1142
  1. Open the Start menu and type “regedit.” Launch the application.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  3. Right-click the value “LongPathsEnabled” and select Modify.
  4. Change “Value data” from 0 to 1.
  5. Click OK.

Удалить все таблицы из БД

Details
Written by: po3dno
Category: MSSQL
Created: 30 November 2016
Hits: 1062

EXEC sp_MSforeachtable @command1 = "DROP TABLE ?"

reindex

Details
Written by: po3dno
Category: MSSQL
Created: 22 November 2016
Hits: 1257

GO

EXEC sp_MSforeachtable @command1="print '?' DBCC DBREINDEX ('?', ' ', 80)"

GO

EXEC sp_updatestats

GO

  1. Настройка DCOM компоненты "Excel.Application" на 64-битном сервере приложений 1С
  2. Delete WSUS 'Drivers'
  3. MSSQL table usage space
  4. How to Remotely Enable and Disable (RDP) Remote

Subcategories

Power Shell Article Count:  53

C# Article Count:  10

Perl Article Count:  1

Exchange Server Article Count:  15

Other Article Count:  24

MSSQL Article Count:  17

Windows Article Count:  25

MariaDB Article Count:  3

Linux Article Count:  9

Docker Article Count:  3

pg Article Count:  2

Page 18 of 32

  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22

Login Form

  • Forgot your password?
  • Forgot your username?

Statistics

  • Users 2
  • Articles 177
  • Articles View Hits 173554