You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: "How To Audit Visual C++ Runtime Version Usage"
2
+
title: "cpp-redist-version-auditing"
3
3
description: "This article provides a detailed guide for auditing usage of Visual C++ Runtime versions within your organization."
4
4
ms.date: 12/2/2024
5
5
helpviewer_keywords:
@@ -15,13 +15,13 @@ ms.author: msaleh
15
15
16
16
The Microsoft Visual C++ Redistributable and the Visual C++ Studio Runtime (collectively, "VC Runtime") is a critical component to thousands of applications. Across your enterprise network, machines may still be running applications that install and use an out-of-support version of the VC Runtime. NTFS File Auditing can be used to identify such usage as a step towards helping you replace these applications with ones that take a dependency on a supported version of the VC Runtime. This guide will walk you through setting up NTFS File Auditing, provide troubleshooting tips, and highlight the benefits of regular audits.
17
17
18
-
For details on the versions of VC Runtime no longer supported, see [Microsoft Visual C++ Redistributable latest supported downloads](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist).
18
+
For details on the versions of VC Runtime no longer supported, see [Microsoft Visual C++ Redistributable latest supported downloads](/cpp/windows/latest-supported-vc-redist).
19
19
20
20
## Enabling NTFS File Auditing to determine usage of VC Runtime
21
21
22
22
NTFS File Auditing can be used to determine which process is calling VC Runtime files. You can use this information on machines with legacy versions of the VC Runtime already installed to determine which applications are calling the unsupported versions of the VC Runtime.
23
23
24
-
This guide will first provide steps to manually enable NTFS File Auditing and review logs. Because there are several component files that can be used by an application, this guide also provides and recommends that you use PowerShell's [Get-Acl](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-acl?view=powershell-5.1) and [Set-Acl](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-acl?view=powershell-5.1) cmdlets to update Auditing permissions. For details on how to configure the audit policies on a file, see [Apply a basic audit policy on a file or folder.](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder)
24
+
This guide will first provide steps to manually enable NTFS File Auditing and review logs. Because there are several component files that can be used by an application, this guide also provides and recommends that you use PowerShell's [Get-Acl](/powershell/module/microsoft.powershell.security/get-acl) and [Set-Acl](/powershell/module/microsoft.powershell.security/set-acl) cmdlets to update Auditing permissions. For details on how to configure the audit policies on a file, see [Apply a basic audit policy on a file or folder.](/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/apply-a-basic-audit-policy-on-a-file-or-folder)
25
25
26
26
### Manually enable object access auditing on the system
27
27
@@ -34,8 +34,8 @@ Object access must be enabled before you enable file level auditing.
34
34
35
35
Alternatively, you may use auditpol.exe to enable object access.
36
36
37
-
1. List the current settings with AuditPol.exe /get /category:"Object Access".
38
-
2. Enable/Disable with AuditPol.exe /set /category:"Object Access" /subcategory:"File System" /success:enable.
37
+
1. List the current settings with `AuditPol.exe /get /category:"Object Access"`.
38
+
2. Enable/Disable with `AuditPol.exe /set /category:"Object Access" /subcategory:"File System" /success:enable`.
39
39
40
40
### Manually enable auditing on a file
41
41
@@ -63,78 +63,78 @@ The audit rule is enabled now.
63
63
64
64
### Manually review audit logs
65
65
66
-
NTFS File Auditing will generate [_Event 4663: An attempt was made to access an object_](https://learn.microsoft.com/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4663) for each file that includes + audit permission and the+ process accessing process namethe file.
66
+
NTFS File Auditing will generate ["Event 4663: An attempt was made to access an object"](/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4663) for each file that includes + audit permission and the+ process accessing process namethe file.
67
67
68
-
1. Open Event Viewer: Press Windows + R, type eventvwr.msc, and press Enter.
68
+
1. Open Event Viewer: Press Windows + R, type `eventvwr.msc`, and press Enter.
69
69
70
70
2. Navigate to Security Logs: In the Event Viewer, expand Windows Logs and select Security. The results pane lists individual security events.
71
71
72
72
3. Filter and Analyze the Logs: Use the Filter Current Log option to narrow down the events to Event ID 4663 (Audit Success for the File System Category).
73
73
74
-
For an example of a File Access Auditing Event 4663, see [4663(S): An attempt was made to access an object.](https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4663)
74
+
For an example of a File Access Auditing Event 4663, see ["4663(S): An attempt was made to access an object."](/previous-versions/windows/it-pro/windows-10/security/threat-protection/auditing/event-4663)
### Using PowerShell to enable auditing of VC Runtime usage
79
79
80
80
The general workflow for updating the File Auditing Permissions with PowerShell is as follows:
81
81
82
-
1. Define the [file system audit rule](https://learn.microsoft.com/en-us/dotnet/api/system.security.accesscontrol.filesystemauditrule.-ctor) to be applied to the file(s).
82
+
1. Define the [file system audit rule](/dotnet/api/system.security.accesscontrol.filesystemauditrule.-ctor) to be applied to the file(s).
83
83
84
-
2. Obtain a file's security descriptor with [Get-Acl](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/get-acl?view=powershell-5.1).
84
+
2. Obtain a file's security descriptor with [Get-Acl](/powershell/module/microsoft.powershell.security/get-acl).
85
85
86
-
3.[Apply the audit rule](https://learn.microsoft.com/en-us/dotnet/api/system.security.accesscontrol.filesystemsecurity.setaccessrule) to the security descriptor.
86
+
3.[Apply the audit rule](/dotnet/api/system.security.accesscontrol.filesystemsecurity.setaccessrule) to the security descriptor.
87
87
88
-
4. Apply the updated security descriptor on the original file with [Set-Acl](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.security/set-acl?view=powershell-5.1).
88
+
4. Apply the updated security descriptor on the original file with [Set-Acl](/powershell/module/microsoft.powershell.security/set-acl).
89
89
90
-
5. View File Access Auditing Event 4663 records with [Get-WinEvent](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.diagnostics/get-winevent?view=powershell-5.1).
90
+
5. View File Access Auditing Event 4663 records with [Get-WinEvent](/powershell/module/microsoft.powershell.diagnostics/get-winevent).
91
91
92
92
### PowerShell: Enable auditing on out-of-support VC Runtime files
93
93
94
94
The following PowerShell section of code will enable usage auditing of the currently installed out-of-support VC Runtime files.
Example output from the above block of code is as follows:
@@ -195,7 +195,7 @@ ResourceAttributes : S:AI
195
195
196
196
After you have determined which processes are using the VC Runtime files or installing the VC Redistributable, uninstall those applications or upgrade them to newer versions that do not depend on unsupported VC Runtimes.
197
197
198
-
Note that some Microsoft applications do require legacy versions of the VC Runtime. For details, see [Visual C++ Redistributable and runtime libraries FAQ | Microsoft Learn](https://learn.microsoft.com/lifecycle/faq/visual-c-faq).
198
+
Note that some Microsoft applications do require legacy versions of the VC Runtime. For details, see [Visual C++ Redistributable and runtime libraries FAQ | Microsoft Learn](/lifecycle/faq/visual-c-faq).
199
199
200
200
<a id="vcruntime_install_location"></a>
201
201
@@ -215,4 +215,4 @@ The following section lists where each version of the VC Runtime component files
215
215
216
216
* [Redistributing Visual C++ Files](redistributing-visual-cpp-files.md)
217
217
* [The latest supported Visual C++ downloads](latest-supported-vc-redist.md)
218
-
* [Lifecycle FAQ - Visual C++ Redistributable and runtime libraries](https://learn.microsoft.com/en-us/lifecycle/faq/visual-c-faq)
218
+
* [Lifecycle FAQ - Visual C++ Redistributable and runtime libraries](/lifecycle/faq/visual-c-faq)
0 commit comments