poniedziałek, 24 września 2018

how to clean WinSxS on Windows 2008 - unknown errors

80420003 and 80420001 are (probably) errors meaning that this code from Windows Component Clean Tool was previously run, below log is from compcln.exe on Windows 2008 (yes, without R2). I tried to remove some files from WinSxS, but without success.

00000001@2018/9/24:11:25:11.265 Loaded Windows Component Clean Library v6.0.6002.18005. Client: Windows Component Clean Tool
00000002@2018/9/24:11:25:13.948 Running for Service Pack 1
00000003 (F) 80420003 [Warning,Facility=66 (0x0042),Code=3] #12# from ScavengeContext::Run(...)
00000004@2018/9/24:11:25:13.948 (F) -some-path-here-\scavenger.cpp(2828): Error 80420003 [Warning,Facility=66 (0x0042),Code=3] originated in function ScavengeContext::Run expression: (null)
00000005@2018/9/24:11:25:13.948 Running for Service Pack 2
00000006 (F) 80420001 [Warning,Facility=66 (0x0042),Code=1] #6117# from ScavengeContext::Run(...)
00000007@2018/9/24:11:25:13.964 (F) -some-path-here-\scavenger.cpp(2820): Error 80420001 [Warning,Facility=66 (0x0042),Code=1] originated in function ScavengeContext::Run expression: (null)

niedziela, 16 września 2018

oid for Active Directory classess and attributes

In Microsoft They have:
1.2.840.113556.1.5.9 which is described below:

Value Meaning Description
1 ISO Identifies the root authority.
2 ANSI Group designation assigned by ISO.
840 USA Country/region designation assigned by the group.
113556 Microsoft Organization designation assigned by the country/region.
1 Active Directory Assigned by the organization.
5 Classes Assigned by the organization.
9 user class Assigned by the organization.

OID can be registered for organization in IANA in node:
1 - ISO
3 - identified-organization
6 - dod
1 - internet
4 - private
1 - enterprise
x - my organization (of course I know it, but I'll not provide it here

Using the same schema as Microsoft I can use:
1.3.6.1.4.1.x.1. - Active Directory
1.3.6.1.4.1.x.1.1. - classess
1.3.6.1.4.1.x.1.2. - attributes

poniedziałek, 10 września 2018

powershell - truncate binary file

I was forced to truncate file with tools available on system so I choose powershell - without additional downloads but almost pure powershell. Why I had to truncate file? Because file was uploaded and - by unknown reason - the header was wrong. In zip file the first two letters are "PK", but in my file it was as below (some unvisible characters also).
PS C:\temp> $bytes = [System.IO.File]::ReadAllBytes("c:\temp\some-file.zip")
PS C:\temp> $text = [System.Text.Encoding]::ASCII.GetString($bytes, 0, 12)
9? PK♥♦¶
 
PS c:\temp> $bytes.count
13908241
PS C:\temp> $bytes1 = $bytes[4..($bytes.Length-4)]
PS C:\temp> $bytes1.Count
13908234
PS C:\temp> $bytes1.length
13908234
PS C:\temp> [io.file]::WriteAllBytes('c:\temp\try1.zip', $bytes1)