Verify that the device is hybrid Azure AD joined, run dsregcmd /status from the command line.
You can confirm that the device is properly hybrid-joined if both AzureAdJoined and DomainJoined are set to YES.
Verify that the device is hybrid Azure AD joined, run dsregcmd /status from the command line.
You can confirm that the device is properly hybrid-joined if both AzureAdJoined and DomainJoined are set to YES.
Enroll a Windows 10 device automatically using Group Policy
Enroll a Windows 10 device automatically using Group Policy
Article
01/05/2023
12 minutes to read
4 contributors
Applies to:
Windows 10
Starting in Windows 10, version 1709, you can use a Group Policy to trigger auto-enrollment to Mobile Device Management (MDM) for Active Directory (AD) domain-joined devices.
The enrollment into Intune is triggered by a group policy created on your local AD and happens without any user interaction. This cause-and-effect mechanism means you can automatically mass-enroll a large number of domain-joined corporate devices into Microsoft Intune. The enrollment process starts in the background once you sign in to the device with your Azure AD account.
Requirements:
Active Directory-joined PC running Windows 10, version 1709 or later
The enterprise has configured a mobile device management (MDM) service
The on-premises Active Directory must be integrated with Azure AD (via Azure AD Connect)
The device shouldn't already be enrolled in Intune using the classic agents (devices managed using agents will fail enrollment with error 0x80180026)
The minimum Windows Server version requirement is based on the Hybrid Azure AD join requirement. For more information, see How to plan your hybrid Azure Active Directory join implementation.
Tip
For more information, see the following topics:
How to configure automatic registration of Windows domain-joined devices with Azure Active Directory
How to plan your hybrid Azure Active Directory join implementation
Azure Active Directory integration with MDM
The auto-enrollment relies on the presence of an MDM service and the Azure Active Directory registration for the PC. Starting in Windows 10, version 1607, once the enterprise has registered its AD with Azure AD, a Windows PC that is domain joined is automatically Azure AD–registered.
Note
In Windows 10, version 1709, the enrollment protocol was updated to check whether the device is domain-joined. For details, see [MS-MDE2]: Mobile Device Enrollment Protocol Version 2. For examples, see section 4.3.1 RequestSecurityToken of the MS-MDE2 protocol documentation.
When the auto-enrollment Group Policy is enabled, a task is created in the background that initiates the MDM enrollment. The task will use the existing MDM service configuration from the Azure Active Directory information of the user. If multi-factor authentication is required, the user will get a prompt to complete the authentication. Once the enrollment is configured, the user can check the status in the Settings page.
In Windows 10, version 1709 or later, when the same policy is configured in Group Policy and MDM, Group Policy policy takes precedence over MDM. Since Windows 10, version 1803, a new setting allows you to change precedence to MDM. For more information, see Windows 10 Group Policy vs. Intune MDM Policy who wins?.
For this policy to work, you must verify that the MDM service provider allows Group Policy initiated MDM enrollment for domain-joined devices.
Verify auto-enrollment requirements and settings
To ensure that the auto-enrollment feature is working as expected, you must verify that various requirements and settings are configured correctly. The following steps demonstrate required settings using the Intune service:
Verify that the user who is going to enroll the device has a valid Intune license.
Intune license verification.
Verify that auto-enrollment is activated for those users who are going to enroll the devices into Mobile Device Management (MDM) with Intune. For more information, see Azure AD and Microsoft Intune: Automatic MDM enrollment in the new Portal.
Auto-enrollment activation verification.
Important
For bring-your-own devices (BYOD devices), the Mobile Application Management (MAM) user scope takes precedence if both MAM user scope and MDM user scope (automatic MDM enrollment) are enabled for all users (or the same groups of users). The device will use Windows Information Protection (WIP) Policies (if you configured them) rather than being MDM enrolled.
For corporate-owned devices, the MDM user scope takes precedence if both scopes are enabled. The devices get MDM enrolled.
Verify that the device OS version is Windows 10, version 1709 or later.
Auto-enrollment into Intune via Group Policy is valid only for devices that are hybrid Azure AD joined. This condition means that the device must be joined into both local Active Directory and Azure Active Directory. To verify that the device is hybrid Azure AD joined, run dsregcmd /status from the command line.
You can confirm that the device is properly hybrid-joined if both AzureAdJoined and DomainJoined are set to YES.
Auto-enrollment device status result.
Additionally, verify that the SSO State section displays AzureAdPrt as YES.
Auto-enrollment Azure AD prt verification.
This information can also be found on the Azure AD device list.
Azure AD device list.
Verify that the MDM discovery URL during auto-enrollment is https://enrollment.manage.microsoft.com/enrollmentserver/discovery.svc
MDM discovery URL.
Some tenants might have both Microsoft Intune and Microsoft Intune Enrollment under Mobility. Make sure that your auto-enrollment settings are configured under Microsoft Intune instead of Microsoft Intune Enrollment.
Mobility setting MDM intune.
Verify that the Enable Automatic MDM enrollment using default Azure AD credentials group policy (Local Group Policy Editor > Computer Configuration > Policies > Administrative Templates > Windows Components > MDM) is properly deployed to all devices that should be enrolled into Intune.
You may contact your domain administrators to verify if the group policy has been deployed successfully.
Verify that the device isn't enrolled with the old Intune client used on the Intune Silverlight Portal (the Intune portal used before the Azure portal).
Verify that Microsoft Intune should allow enrollment of Windows devices.
Enrollment of Windows devices.
Configure the auto-enrollment Group Policy for a single PC
This procedure is only for illustration purposes to show how the new auto-enrollment policy works. It's not recommended for the production environment in the enterprise. For bulk deployment, you should use the Group Policy Management Console process.
Requirements:
AD-joined PC running Windows 10, version 1709 or later
Enterprise has MDM service already configured
Enterprise AD must be registered with Azure AD
Run GPEdit.msc. Choose Start, then in the text box type gpedit.
GPEdit desktop app search result.
Under Best match, select Edit group policy to launch it.
In Local Computer Policy, select Administrative Templates > Windows Components > MDM.
MDM policies.
Double-click Enable automatic MDM enrollment using default Azure AD credentials (previously called Auto MDM Enrollment with AAD Token in Windows 10, version 1709). For ADMX files in Windows 10, version 1903 and later, select User Credential as the Selected Credential Type to use.
MDM autoenrollment policy.
Select Enable, select User Credential from the dropdown Select Credential Type to Use, then select OK.
Note
In Windows 10, version 1903, the MDM.admx file was updated to include an option to select which credential is used to enroll the device. Device Credential is a new option that will only have an effect on clients that have installed Windows 10, version 1903 or later. The default behavior for older releases is to revert to User Credential. Device Credential is only supported for Microsoft Intune enrollment in scenarios with Co-management or Azure Virtual Desktop multi-session host pools because the Intune subscription is user centric. User credentials are supported for Azure Virtual Desktop personal host pools.
When a group policy refresh occurs on the client, a task is created and scheduled to run every 5 minutes for the duration of one day. The task is called "Schedule created by enrollment client for automatically enrolling in MDM from Azure Active Directory."
To see the scheduled task, launch the Task Scheduler app.
If two-factor authentication is required, you'll be prompted to complete the process. Here's an example screenshot.
Two-factor authentication notification.
Tip
You can avoid this behavior by using Conditional Access Policies in Azure AD. Learn more by reading What is Conditional Access?.
To verify successful enrollment to MDM, go to Start > Settings > Accounts > Access work or school, then select your domain account.
Select Info to see the MDM enrollment information.
Work School Settings.
If you don't see the Info button or the enrollment information, enrollment might have failed. Check the status in Task Scheduler app.
Task Scheduler app
Select Start, then in the text box type task scheduler.
Task Scheduler search result.
Under Best match, select Task Scheduler to launch it.
In Task Scheduler Library, open Microsoft > Windows , then select EnterpriseMgmt.
Auto-enrollment scheduled task.
To see the result of the task, move the scroll bar to the right to see the Last Run Result. The message 0x80180026 is a failure message (MENROLL_E_DEVICE_MANAGEMENT_BLOCKED). You can see the logs in the History tab.
If the device enrollment is blocked, your IT admin might have enabled the Disable MDM Enrollment policy.
Note
The GPEdit console doesn't reflect the status of policies set by your IT admin on your device. It's only used by the user to set policies.
Configure the auto-enrollment for a group of devices
Requirements:
AD-joined PC running Windows 10, version 1709 or later
Enterprise has MDM service already configured (with Intune or a third-party service provider)
Enterprise AD must be integrated with Azure AD.
Ensure that PCs belong to same computer group.
Important
If you don't see the policy, it may be because you don't have the ADMX for Windows 10, version 1803, version 1809, or version 1903 installed. To fix the issue, use the following procedures. Note that the latest MDM.admx is backwards compatible.
Download:
1803 --> Administrative Templates (.admx) for Windows 10 April 2018 Update (1803)
1809 --> Administrative Templates (.admx) for Windows 10 October 2018 Update (1809)
1903 --> Administrative Templates (.admx) for Windows 10 May 2019 Update (1903)
1909 --> Administrative Templates (.admx) for Windows 10 November 2019 Update (1909)
2004 --> Administrative Templates (.admx) for Windows 10 May 2020 Update (2004)
20H2 --> Administrative Templates (.admx) for Windows 10 October 2020 Update (20H2)
21H1 --> Administrative Templates (.admx) for Windows 10 May 2021 Update (21H1)
21H2 --> Administrative Templates (.admx) for Windows 10 November 2021 Update (21H2)-v2.0
Install the package on the Domain Controller.
Navigate, depending on the version to the folder:
1803 --> C:\Program Files (x86)\Microsoft Group Policy\Windows 10 April 2018 Update (1803) v2
1809 --> C:\Program Files (x86)\Microsoft Group Policy\Windows 10 October 2018 Update (1809) v2
1903 --> C:\Program Files (x86)\Microsoft Group Policy\Windows 10 May 2019 Update (1903) v3
1909 --> C:\Program Files (x86)\Microsoft Group Policy\Windows 10 November 2019 Update (1909)
2004 --> C:\Program Files (x86)\Microsoft Group Policy\Windows 10 May 2020 Update (2004)
20H2 --> C:\Program Files (x86)\Microsoft Group Policy\Windows 10 October 2020 Update (20H2)
21H1 --> C:\Program Files (x86)\Microsoft Group Policy\Windows 10 May 2021 Update (21H1)
21H2 --> C:\Program Files (x86)\Microsoft Group Policy\Windows 10 November 2021 Update V2 (21H2)
Rename the extracted Policy Definitions folder to PolicyDefinitions.
Copy the PolicyDefinitions folder to \\contoso.com\SYSVOL\contoso.com\policies\PolicyDefinitions.
If this folder doesn't exist, then you'll be switching to a central policy store for your entire domain.
Wait for the SYSVOL DFSR replication to be completed for the policy to be available.
This procedure will work for any future version as well.
Create a Group Policy Object (GPO) and enable the Group Policy Computer Configuration > Policies > Administrative Templates > Windows Components > MDM > Enable automatic MDM enrollment using default Azure AD credentials.
Create a Security Group for the PCs.
Link the GPO.
Filter using Security Groups.
Troubleshoot auto-enrollment of devices
Investigate the log file if you have issues even after performing all the mandatory verification steps. The first log file to investigate is the event log on the target Windows 10 device.
To collect Event Viewer logs:
Open Event Viewer.
Navigate to Applications and Services Logs > Microsoft > Windows > DeviceManagement-Enterprise-Diagnostic-Provider > Admin.
Tip
For guidance on how to collect event logs for Intune, see Collect MDM Event Viewer Log YouTube video.
Search for event ID 75, which represents a successful auto-enrollment. Here's an example screenshot that shows the auto-enrollment completed successfully:
Event ID 75.
If you can't find event ID 75 in the logs, it indicates that the auto-enrollment failed. This failure can happen because of the following reasons:
The enrollment failed with error. In this case, search for event ID 76, which represents failed auto-enrollment. Here's an example screenshot that shows that the auto-enrollment failed:
Event ID 76.
To troubleshoot, check the error code that appears in the event. For more information, see Troubleshooting Windows device enrollment problems in Microsoft Intune.
The auto-enrollment didn't trigger at all. In this case, you'll not find either event ID 75 or event ID 76. To know the reason, you must understand the internal mechanisms happening on the device as described in the following section.
The auto-enrollment process is triggered by a task (Microsoft > Windows > EnterpriseMgmt) within the task-scheduler. This task appears if the Enable automatic MDM enrollment using default Azure AD credentials group policy (Computer Configuration > Policies > Administrative Templates > Windows Components > MDM) is successfully deployed to the target machine as shown in the following screenshot:
Task scheduler.
Note
This task isn't visible to standard users, run Scheduled Tasks with administrative credentials to find the task.
This task runs every 5 minutes for the duration of one day. To confirm if the task succeeded, check the task scheduler event logs: Applications and Services Logs > Microsoft > Windows > Task Scheduler > Operational. Look for an entry where the task scheduler created by enrollment client for automatically enrolling in MDM from Azure Active Directory is triggered by event ID 107.
Event ID 107.
When the task is completed, a new event ID 102 is logged.
Event ID 102.
The task scheduler log displays event ID 102 (task completed) regardless of the auto-enrollment success or failure. This status-display means that the task scheduler log is only useful to confirm if the auto-enrollment task is triggered or not. It doesn't indicate the success or failure of auto-enrollment.
If you can't see from the log that task Schedule created by enrollment client for automatically enrolling in MDM from Azure AD is initiated, there's possibly an issue with the group policy. Immediately run the command gpupdate /force in a command prompt to get the group policy object applied. If this step still doesn't help, further troubleshooting on Active Directory is required. One frequently seen error is related to some outdated enrollment entries in the registry on the target client device (HKLM > Software > Microsoft > Enrollments). If a device has been enrolled (can be any MDM solution and not only Intune), some enrollment information added into the registry is seen:
Outdated enrollment entries.
By default, these entries are removed when the device is un-enrolled, but occasionally the registry key remains even after un-enrollment. In this case, gpupdate /force fails to initiate the auto-enrollment task and error code 2149056522 is displayed in the Applications and Services Logs > Microsoft > Windows > Task Scheduler > Operational event log file under event ID 7016.
A resolution to this issue is to remove the registry key manually. If you don't know which registry key to remove, go for the key that displays most entries as the screenshot above. All other keys will display fewer entries as shown in the following screenshot:
Manually deleted entries.
Related topics
Group Policy Management Console
Create and Edit a Group Policy Object
Link a Group Policy Object
Filter Using Security Groups
Enforce a Group Policy Object Link
Group Policy Central Store
Getting started with Cloud Native Windows Endpoints
A Framework for Windows endpoint management transformation
Success with remote Windows Autopilot and Hybrid Azure Active Director join
Useful Links
Windows 10 Administrative Templates for Windows 10 November 2021 Update (21H2)-v2.0
Windows 10 Administrative Templates for Windows 10 May 2021 Update 21H1
Windows 10 Administrative Templates for Windows 10 November 2019 Update 1909
Windows 10 Administrative Templates for Windows 10 May 2019 Update 1903
Windows 10 Administrative Templates for Windows 10 October 2018 Update 1809
Recommended content
Enrollment for hybrid Azure AD-joined devices - Windows Autopilot
Use Windows Autopilot to enroll hybrid Azure AD-joined devices in Microsoft Intune.
Troubleshooting Windows device enrollment problems in Intune - Intune
Suggestions for troubleshooting some of the most common error messages when you enroll Windows devices in Microsoft Intune.
Troubleshoot Windows 10 Group Policy auto-enrollment in Microsoft Intune - Intune
Learn how to troubleshoot auto-enrollment.
Set up enrollment for Windows devices by using Microsoft Intune
Set up enrollment for Windows devices.
Prevent members of a group from applying a GPO
Assign Security Group Filters to the GPO
Article
12/09/2022
2 minutes to read
9 contributors
Applies to:
✅ Windows 10, ✅ Windows 11, ✅ Windows Server 2016, ✅ Windows Server 2019, ✅ Windows Server 2022
To make sure that your GPO is applied to the correct computers, use the Group Policy Management MMC snap-in to assign security group filters to the GPO.
Important
This deployment guide uses the method of adding the Domain Computers group to the membership group for the main isolated domain after testing is complete and you are ready to go live in production. To make this method work, you must prevent any computer that is a member of either the boundary or encryption zone from applying the GPO for the main isolated domain. For example, on the GPOs for the main isolated domain, deny Read and Apply Group Policy permissions to the membership groups for the boundary and encryption zones.
Administrative credentials
To complete these procedures, you must be a member of the Domain Administrators group, or otherwise be delegated permissions to modify the relevant GPOs.
In this topic:
Allow members of a group to apply a GPO
Prevent members of a group from applying a GPO
To allow members of a group to apply a GPO
Use the following procedure to add a group to the security filter on the GPO that allows group members to apply the GPO.
Open the Group Policy Management console.
In the navigation pane, find and then click the GPO that you want to modify.
In the details pane, under Security Filtering, click Authenticated Users, and then click Remove.
Note
You must remove the default permission granted to all authenticated users and computers to restrict the GPO to only the groups you specify. If the GPO contains User settings, and the Authenticated Users group is removed, and new security filtering is added using a security group that only contains user accounts, the GPO can fail to apply. Details and various workarounds are mentioned in this Microsoft blog.
Click Add.
In the Select User, Computer, or Group dialog box, type the name of the group whose members are to apply the GPO, and then click OK. If you do not know the name, you can click Advanced to browse the list of groups available in the domain.
To prevent members of a group from applying a GPO
Use the following procedure to add a group to the security filter on the GPO that prevents group members from applying the GPO. This is typically used to prevent members of the boundary and encryption zones from applying the GPOs for the isolated domain.
Open the Group Policy Management console.
In the navigation pane, find and then click the GPO that you want to modify.
In the details pane, click the Delegation tab.
Click Advanced.
Under the Group or user names list, click Add.
In the Select User, Computer, or Group dialog box, type the name of the group whose members are to be prevented from applying the GPO, and then click OK. If you do not know the name, you can click Advanced to browse the list of groups available in the domain.
Select the group in the Group or user names list, and then select the box in the Deny column for both Read and Apply group policy.
Click OK, and then in the Windows Security dialog box, click Yes.
The group appears in the list with Custom permissions.
Recommended content
Loopback processing of Group Policy - Windows Server
This article describes why you need to enable loopback processing for Group Policy.
Copy a GPO to Create a New GPO (Windows)
Learn how to make a copy of a GPO by using the Active Directory Users and devices MMC snap-in to create a GPO for boundary zone devices.
Permissions for this GPO are inconsistent - Windows Server
Describes a permissions issue that occurs when you run Group Policy Management Console in a Windows 2008 or Windows Server 2003 domain. A resolution is provided.
Create a Group Policy Object (Windows)
Learn how to use the Active Directory Users and Computers MMC snap-in to create a GPO. You must be a member of the Domain Administrators group.
Robocopy to replicate SQL backups
robocopyFullBackups.bat
ROBOCOPY \\192.168.1.10\SQLSRV01 D:\Backups\SQLSRV01\SQLSRV01 *.bak /S /XO /MT:16 /log:"C:\Robocopy\robocopyLogs\theFullLog.log"
ROBOCOPY \\192.168.1.10\SQLSRV01-other D:\Backups\SQLSRV01\SQLSRV01 *.bak /S /XO /MT:16 /log:"C:\Robocopy\robocopyLogs\theFullLog.log"
robocopyDiffBackups.bat
ROBOCOPY \\192.168.1.10\SQLSRV01 D:\Backups\SQLSRV01\SQLSRV01 *.dif /S /XO /MT:16 /log:"C:\Robocopy\robocopyLogs\theDiferentialLog.log"
ROBOCOPY \\192.168.1.10\SQLSRV01-other D:\Backups\SQLSRV01\SQLSRV01 *.dif /S /XO /MT:16 /log:"C:\Robocopy\robocopyLogs\theDifLog.log"
robocopyTrnBackups.bat
ROBOCOPY \\192.168.1.10\SQLSRV01 D:\Backups\SQLSRV01\SQLSRV01 *.trn /S /XO /MT:16 /log:"C:\Robocopy\robocopyLogs\theTransLog.log"
ROBOCOPY \\192.168.1.10\SQLSRV01-other D:\Backups\SQLSRV01\SQLSRV01 *.trn /S /XO /MT:16 /log:"C:\Robocopy\robocopyLogs\theTransLog.log"
robocopy
How to Force Delete a Folder on Windows 10 and 11
Reference:
https://www.howtogeek.com/811409/force-delete-folder-windows/
How to Force Delete a Folder on Windows 10 and 11
MAHESH MAKVANA
@maheshhari
JUN 28, 2022, 1:00 PM EST | 3 MIN READ
Windows 11 and 10 desktop backgrounds.
Are you having trouble deleting a folder from your Windows 10 or Windows 11 PC? If so, that may be a system folder or a folder being used by other apps. We’ll show you how to successfully delete “undeletable” folders on your computer.
RELATED: How to Delete, Move, or Rename Locked Files in Windows
Table of Contents
Reasons You Can't Delete a Folder on Windows
Method 1: Use Command Prompt
Method 2: Boot in Windows Safe Mode
Method 3: Use Third-Party Software
Method 4: Use WinRAR to Force Remove Folders
Reasons You Can’t Delete a Folder on Windows
The most common reason you can’t delete a folder is that your folder is a Windows system folder. In this case, the system prevents you from removing the folder as it can make your PC unstable.
What Is A Windows System File?
RELATED
What Is A Windows System File?
If you’re sure yours is not a system folder, then your “undeletable” folder may be in use by your installed apps. When a folder is being used by an app, Windows prevents you from making changes to that folder. In this case, you can close the app using your folder and then try to delete the folder.
If your case doesn’t match either of the above scenarios, you may want to use one of the following methods to force remove your folder.
Method 1: Use Command Prompt
One quick way to force delete a folder is to use Command Prompt. You can run a command from this tool that deletes your selected folder.
To do that, first, open your “Start” menu and search for “Command Prompt”. Then, on the right pane, click “Run as Administrator.”
Select "Run as Administrator" on the right.
You’ll see a “User Account Control” prompt. Select “Yes.”
When Command Prompt opens, type the following command and press Enter. In this command, replace PATH with the path to the folder you want to delete.
Tip: If your path has spaces in it, enclose the path with double quotes.
rmdir /s /q PATH
Advertisement
For example, to delete a folder named Unwanted in the Documents folder on your C drive, you’d use the following command.
Warning: The command permanently deletes your folder, so make sure you really want to do that.
rmdir /s /q C:\Documents\Unwanted
Type the command and press Enter.
The specified folder is now removed from your Windows PC, and you’re all set.
THE BEST TECH NEWSLETTER ANYWHERE
Join 425,000 subscribers and get a daily digest of features, articles, news, and trivia.
e-mail address
Sign Me Up!
By submitting your email, you agree to the Terms of Use and Privacy Policy.
Method 2: Boot in Windows Safe Mode
If you aren’t sure what app has hijacked your folder so you can’t delete it, reboot your PC in safe mode and then try to delete the folder. In safe mode, your PC only loads the essential Windows files, preventing any third-party apps from automatically launching.
To use this method, first, boot your Windows 10 or Windows 11 PC in safe mode using our guide.
Once you’re in safe mode, launch File Explorer and locate the folder to delete. Then, right-click this folder and choose “Delete.”
Your folder is now deleted.
You may want to remove the folder from Recycle Bin as well, which you can do by opening the Recycle Bin, right-clicking your folder, and choosing “Delete.”
And that’s all there is to getting rid of stubborn folders on your PC. Enjoy!
Method 3: Use Third-Party Software
If your folder still won’t delete, there’s a free third-party app called Unlocker that can help you remove your folders. This app basically unlocks your folder from any locks due to which it can’t be deleted, and then allows you to finally get rid of the folder.
Advertisement
To use this method, first, download and install the free Unlocker app on your PC. Then launch the newly installed app.
On Unlocker’s main window, choose the folder to delete. Then, at the bottom, click “OK.”
On the screen that follows, click the drop-down menu and select “Delete.” Then click “OK.”
Unlocker will unlock your folder and delete it from your PC. You’re all done.
Method 4: Use WinRAR to Force Remove Folders
This might sound strange but you can use WinRAR (a file compression app) to delete your stubborn folders. The way this works is that you create an archive out of your “undeletable” folder and then ask the app to delete the original folder after the archive is made.
Advertisement
That way, when WinRAR has created an archive from your folder, it deletes the original folder. You can then delete the newly-created archive as well.
To do that, first, grab the free version of WinRAR and install it on your PC. Then restart your Windows 10 or Windows 11 PC so WinRAR integrates with your context menu.
When your PC turns back on, open File Explorer and find the folder to delete. Then right-click this folder and choose “Add to Archive.”
On the “Archive Name and Parameters” window, in the “Archiving Options” section, enable the “Delete Files After Archiving” option. Then, at the bottom of the window, select “OK.”
Let WinRAR make an archive from your selected folder. When that’s done, WinRAR will remove the original folder. At this point, you may now delete your newly created archive.
And that’s how you go about ridding your Windows PC of any unwanted and stubborn folders. Very useful!
While you’re at it, consider clearing your Windows PC’s cache to get rid of unwanted files from your storage.
RELATED: How to Clear Your Cache on Windows 11
------------------
cmd Delete Folder – How to Remove Files and Folders in Windows
https://www.freecodecamp.org/news/cmd-delete-folder-how-to-remove-files-and-folders-in-windows/
cmd Delete Folder – How to Remove Files and Folders in Windows
Kris Koishigawa
Kris Koishigawa
cmd Delete Folder – How to Remove Files and Folders in Windows
Sometimes it's just faster to do things with the command line.
In this quick tutorial we'll go over how to open Command Prompt, some basic commands and flags, and how to delete files and folders in Command Prompt.
If you're already familiar with basic DOS commands, feel free to skip ahead.
How to open Command Prompt
To open Command Prompt, press the Windows key, and type in "cmd".
Then, click on "Run as Administrator":
Screenshot showing how to open Command Prompt as an administrator
After that, you'll see a Command Prompt window with administrative privileges:
command-prompt-new-window
Screenshot of Command Prompt window
If you can't open Command Prompt as an administrator, no worries. You can open a normal Command Prompt window by clicking "Open" instead of "Run as Administrator".
The only difference is that you may not be able to delete some protected files, which shouldn't be a problem in most cases.
How to delete files with the del command
Now that Command Prompt is open, use cd to change directories to where your files are.
I've prepared a directory on the desktop called Test Folder. You can use the command tree /f to see a, well, tree, of all the nested files and folders:
Screenshot after running tree /f in target directory
To delete a file, use the following command: del "<filename>".
For example, to delete Test file.txt, just run del "Test File.txt".
There may be a prompt asking if you want to delete the file. If so, type "y" and hit enter.
Note: Any files deleted with the del command cannot be recovered. Be very careful where and how you use this command.
After that, you can run tree /f to confirm that your file was deleted:
Screenshot after deleting file with del command
Also, bonus tip – Command Prompt has basic autocompletion. So you could just type in del test, press the tab key, and Command Prompt will change it to del "Test File.txt".
How to force delete files with the del command
Sometimes files are marked as read only, and you'll see the following error when you try to use the del command:
Screenshot of error after trying to delete a read only file
To get around this, use the /f flag to force delete the file. For example, del /f "Read Only Test File.txt":
Screenshot after deleting file with the force flag
How to delete folders with the rmdir command
To delete directories/folders, you'll need to use the rmdir or rd command. Both commands work the same way, but let's stick with rmdir since it's a bit more expressive.
Also, I'll use the terms directory and folder interchangeably for the rest of the tutorial. "Folder" is a newer term that became popular with early desktop GUIs, but folder and directory basically mean the same thing.
To remove a directory, just use the command rmdir <directory name>.
Note: Any directories deleted with the rmdir command cannot be recovered. Be very careful where and how you use this command.
In this case I want to remove a directory named Subfolder, so I'll use the command rmdir Subfolder:
Screenshot of a directory not empty error
But, if you remember earlier, Subfolder has a file in it named Nested Test File.
You could cd into the Subfolder directory and remove the file, then come back with cd .. and run the rmdir Subfolder command again, but that would get tedious. And just imagine if there were a bunch of other nested files and directories!
Like with the del command, there's a helpful flag we can use to make things much faster and easier.
How to use the /s flag with rmdir
To remove a directory, including all nested files and subdirectories, just use the /s flag:
Screenshot after running rmdir with the /s flag
There will probably be a prompt asking if you want to remove that directory. If so, just type "y" and hit enter.
And that's it! That should be everything you need to know to remove files and folders in the Windows Command Prompt.
All of these commands should work in PowerShell, which is basically Command Prompt version 2.0. Also, PowerShell has a bunch of cool aliases like ls and clear that should feel right at home if you're familiar with the Mac/Linux command line.
Did these commands help you? Are there any other commands that you find useful? Either way, let me know over on Twitter.
-------------
del
https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/del
Article
06/22/2022
2 minutes to read
10 contributors
Deletes one or more files. This command performs the same actions as the erase command.
The del command can also run from the Windows Recovery Console, using different parameters. For more information, see Windows Recovery Environment (WinRE).
Warning
If you use del to delete a file from your disk, you can't retrieve it.
Syntax
Copy
del [/p] [/f] [/s] [/q] [/a[:]<attributes>] <names>
erase [/p] [/f] [/s] [/q] [/a[:]<attributes>] <names>
Parameters
Parameter Description
<names> Specifies a list of one or more files or directories. Wildcards may be used to delete multiple files. If a directory is specified, all files within the directory will be deleted.
/p Prompts for confirmation before deleting the specified file.
/f Forces deletion of read-only files.
/s Deletes specified files from the current directory and all subdirectories. Displays the names of the files as they are being deleted.
/q Specifies quiet mode. You are not prompted for delete confirmation.
/a[:]<attributes> Deletes files based on the following file attributes:
r Read-only files
h Hidden files
i Not content indexed files
s System files
a Files ready for archiving
l Reparse points
- Used as a prefix meaning 'not'
.
/? Displays help at the command prompt.
Remarks
If you use the del /p command, you'll see the following message:
FileName, Delete (Y/N)?
To confirm the deletion, press Y. To cancel the deletion and to display the next file name (if you specified a group of files), press N. To stop the del command, press CTRL+C.
If you disable command extension, the /s parameter will display the names of any files that weren't found ,instead of displaying the names of files that are being deleted.
If you specify specific folders in the <names> parameter, all of the included files will also be deleted. For example, if you want to delete all of the files in the \work folder, type:
Copy
del \work
You can use wildcards (* and ?) to delete more than one file at a time. However, to avoid deleting files unintentionally, you should use wildcards cautiously. For example, if you type the following command:
Copy
del *.*
The del command displays the following prompt:
Are you sure (Y/N)?
To delete all of the files in the current directory, press Y and then press ENTER. To cancel the deletion, press N and then press ENTER.
Note
Before you use wildcard characters with the del command, use the same wildcard characters with the dir command to list all the files that will be deleted.
Examples
To delete all the files in a folder named Test on drive C, type either of the following:
Copy
del c:\test
del c:\test\*.*
To delete all the files in a folder where the folder has a space in its name, the full path needs to be wrapped in double quotes. Type either of the following:
Copy
del "c:\test folder\"
del "c:\test folder\*.*"
To delete all files with the .bat file name extension from the current directory, type:
Copy
del *.bat
To delete all read-only files in the current directory, type:
Copy
del /a:r *.*
Additional References
Command-Line Syntax Key
Windows Recovery Environment (WinRE)
Recommended content
rd
Reference article for the rd command, which deletes a directory.
goto
Reference article for the goto command, which directs cmd.exe to a labeled line in a batch program.
if
Reference article for the if command, which performs conditional processing in batch programs.
for
Reference article for the for command, which runs a specified command for each file, within a set of files.
SID duplication / Replication check
Check against active directory server or local hosts (may be local administrator replication when creating VMs or deploying without sysprep)
SID
S-1-7-21-1279609549-3715731210-3247935832-500
wmic useraccount get name,sid
net localgroup administrators
net user administrator
run control userpasswords2
run control userpasswords
The latest Windows 11 update may break your VPN connection
As per :
https://www.techradar.com/news/the-latest-windows-11-update-may-break-your-vpn-connection
By Sead Fadilpašić published
The only solution is to uninstall the patch

Microsoft’s monthly update to Windows 10 and Windows 11, which came as part of the most recent Patch Tuesday, appears to be preventing the software's built-in VPN tool from establishing a connection, effectively rendering it useless.
Microsoft is yet to confirm the problem, which has already shared multiple times on Reddit. Besides the Windows VPN, it seems the problem also affects a couple of third-party VPNs, with SonicWall, Cisco Meraki, and WatchGuard Firewalls all seeing issues.
A security researcher told BleepingComputer that the bug affects the Ubiquity Client-to-Site VPN connections for those using the Windows VPN client, as well.
The two problematic updates are KB5009543 for Windows 10, and KB5009566 for Windows 11. At the moment, the only way to fix the problem is to remove the patches which, as the publication explains, can be done through the command prompt, with the following commands:
Windows 10: wusa /uninstall /kb:5009543
Windows 11: wusa /uninstall /kb:5009566
The problem with this approach is that Microsoft bundles all of its fixes, so removing this patch will not only allow Windows admins to re-establish their L2TP VPN connections, but will also expose them to multiple known security vulnerabilities.
And with remote working still being necessary for the majority of companies, they’ll have a tough time choosing a lesser evil between privacy and vulnerability exposure.
One of the flaws addressed through Patch Tuesday was a wormable Windows 11 flaw, found in the HTTP Protocol Stack. There’s yet no malware abusing this flaw out there, but Microsoft said it allows the attacker to execute arbitrary code, remotely, without much user interaction, making it extremely dangerous.
To protect vulnerable devices, disabling the HTTP Trailer Support feature will suffice.
The vulnerability is tracked as CVE-2022-21907. Besides this one, a total of six zero-days, and almost 100 different flaws, were addressed in the patch.
Via: BleepingComputer
FIX
Windows VPN broken updates FIX
https://docs.microsoft.com/en-us/windows/release-health/windows-message-center#2777
Explore this latest release.
Explore the phased rollout and our commitment to quality.
Find out how the upgrade will be offered.
Learn more about this new feature update.
| Message | Date |
| Why you shouldn’t set these 25 Windows policies The Windows update experience, and the policies that control it, have changed dramatically over the last few years. As a result, some policies are no longer relevant or, based on your feedback, have been consolidated and replaced by a more effective option. Find out which policies are not recommended (and why), and what you should be using instead in Why you shouldn’t set these 25 Windows policies. | 2022-01-20 14:00 PT |
| Take action: Out-of-band update to address issues after installing the January Windows update Updated January 18, 2022 Microsoft is releasing Out-of-band (OOB) updates today, January 17, 2022, for some versions of Windows. This update addresses issues related to VPN connectivity, Windows Server Domain Controllers restarting, Virtual Machines start failures, and ReFS-formatted removable media failing to mount. All updates are available on the Microsoft Update Catalog, and some are also available on Windows Update as an optional update. Check the release notes for your version of Windows for more information. Updates for the following Windows versions are available on Windows Update as an optional update. For instructions, see the KB for your OS listed below:
Updates for the following Windows versions are available only on Microsoft Update Catalog. For instructions, see the KB for your OS listed below: Note: As of January 18, 2022, all affected versions have now been addressed with an out-of-band update. | 2022-01-17 14:00 PT |
| Take action: January 2022 security update available for all supported versions of Windows The January 2022 security update release, referred to as our "B" release, is now available for Windows 11 and all supported versions of Windows 10. We recommend that you install these updates promptly. For more information about the contents of this update, see the release notes, which are easily accessible from the Windows 11 and Windows 10 update history pages. (Note: Release notes may be published up to one hour after the updates are available for download.) For instructions on how to install this update on your home device, check this article. To learn more about the different types of monthly quality updates, see our Windows quality updates primer. To be informed about the latest updates and releases, follow us on Twitter @WindowsUpdate. Improvements and fixes for the Windows 11 update:
Short on time? Watch our short monthly release notes video for a summary of this month’s Windows 11 updates. We’ll also provide tips on using color filters and modifying your taskbar alignment, plus how to utilize closed captions for these and future videos. | 2022-01-11 10:00 PT |
| Take action: Out-of-band update to address a Windows Server issue Updated January 5, 2022 Microsoft is releasing Out-of-band (OOB) updates today, January 4, 2022, to resolve issues in which Windows Server might experience a black screen, slow sign in, or general slowness on Windows Server 2019 and Windows Server 2012 R2. The remaining affected platforms will be released in the coming days. To get the standalone update package, search for it in the Microsoft Update Catalog. You can import this update into Windows Server Update Services (WSUS) manually. See the Microsoft Update Catalog for instructions. Note These updates are not available from Windows Update and will not install automatically. For instructions on how to install this update for your operating system, see the KB for your OS listed below:
Note: As of January 5, 2022, all affected versions have now been addressed with an out-of-band update. | 2022-01-04 14:00 PT |
| Take action: December 2021 security update available for all supported versions of Windows The December 2021 security update release, referred to as our "B" release, is now available for Windows 11 and all supported versions of Windows 10. We recommend that you install these updates promptly. The Release Notes associated to this update contain a new video highlight with information on the contents in this release (Release notes might publish with a delay of up to an hour after the updates are available for download). For instructions on how to install this update on your home device, check this article. To learn more about the different types of monthly quality updates, see our Windows quality updates primer. To be informed about the latest updates and releases, follow us on Twitter @WindowsUpdate. IMPORTANT: There will be no preview, non-security “C” releases for Windows 10 or Windows 11 during the month of December. The "C" releases normally target the third week of the month. There will be a December "B" security update release, as usual. Highlights for the Windows 11 update:
| 2021-12-14 10:00 PT |
| Windows 10, version 2004 and Windows Server, version 2004 have reached end of servicing As of December 14, 2021, all editions of Windows 10, version 2004 and Windows Server, version 2004 have reached end of servicing. The December 2021 security update, released on December 14, is the last update available for devices running these versions of Windows. To help keep you protected and productive, Windows Update will automatically initiate a feature update for Windows 10 consumer devices and non-managed business devices that are at, or within several months of reaching end of servicing. This keeps your device supported and receiving monthly updates that are critical to security and ecosystem health. For these devices, you will be able to choose a convenient time for your device to restart and complete the update. For more information on end of servicing dates for currently supported versions of Windows 11 and Windows 10, see the Windows 10 Home and Pro Lifecycle page, Windows 10 Enterprise and Education Lifecycle page, and the Windows lifecycle FAQ. | 2021-12-14 10:00 PT |
| November 2021 Windows non-security preview "C" release available all supported versions of Windows The November 2021 non-security preview release, referred to as our "C" release, is now available for Windows 11 and other supported versions of Windows. Release notes associated to this update contain information on the contents of this release, and are available for Windows 11 under KB5007262. You can navigate the release notes pages for information about the contents of this release on other Windows versions. To learn more about the different types of monthly quality updates, see our Windows 10 quality updates primer. To be informed about the latest updates and releases, follow us on Twitter @WindowsUpdate. IMPORTANT: There will be no preview, non-security “C” releases for Windows 10 or Windows 11 during the month of December. The "C" releases normally target the third week of the month. There will be a December "B" security update release, as usual. Highlights for the Windows 11 update:
| 2021-11-22 14:00 PT |
| Manage Windows updates for cloud-connected devices using the Microsoft Graph PowerShell SDK The Windows Update for Business deployment service enables you to streamline how you manage Windows feature and monthly security updates. The Microsoft Graph PowerShell Software Development Kit (SDK) can make it easier for you to schedule, deploy, and expedite these updates. Explore the new learning module, Manage Windows updates for cloud-connected devices by using the Microsoft Graph PowerShell SDK, to become familiar with the processes for enrolling devices and managing updates. | 2021-11-18 16:00 PT |
| Windows 10, version 21H2 is now available Windows 10, version 21H2 is now available for users with select devices running Windows 10, version 2004 or later who are interested to install this release on their device by checking for updates via Windows Update settings. The Windows 10 November 2021 Update focuses on hybrid and remote environments for working, learning and playing. Devices currently on Windows 10, version 2004 or newer will have a faster overall update experience, as the update will install like a monthly update. We recommend that you update your devices to the latest version of Windows 10 or upgrade eligible devices to Windows 11. For more information on how to get the November 2021 Update, watch our video. Learn more about the future Windows 10 release cadence and support in How to get the Windows 10 November 2021 Update. If you are an IT administrator, check out What's new for IT pros in Windows 10, version 21H2 for information on commercial release channels, deployment tools, and enhancements for commercial organizations. | 2021-11-16 10:00 PT |
| Reminder: End of servicing for Windows 10 version 2004 - December 14, 2021 On December 14, 2021, all editions of Windows 10, version 2004 - also referred to as the May 2020 Update - will reach end of servicing. After that date, devices running these editions will no longer receive monthly security and quality updates. As always, we recommend that you update your devices to the latest version of Windows 10 as soon as possible to ensure that you can take advantage of the latest features and advanced protections from the latest security threats. Learn by reading our Windows IT Pro Blog post, Reminder: End of servicing for Windows 10, version 2004. For more information on end of service dates for currently supported versions of Windows 10, see the Windows 10 Home and Pro Lifecycle page, Windows 10 Enterprise and Education Lifecycle page, and Microsoft Lifecycle Policy search tool. | 2021-11-15 16:00 PT |
| Take action: Out-of-band update to address authentication issues on DCs relating to Kerberos delegation scenarios Updated December 14, 2021 Microsoft is releasing Out-of-band (OOB) updates today, November 14, 2021, to resolve issues in which authentication might fail on DCs with certain Kerberos delegation scenarios on all supported versions of Windows Server when used as a Domain Controller. This update also addresses failures of the S4U2Proxy with Protocol Transition option that occur because the authenticating service cannot obtain an evidence ticket. To get the standalone update package, search for it in the Microsoft Update Catalog. You can import this update into Windows Server Update Services (WSUS) manually. See the Microsoft Update Catalog for instructions. Note These updates are not available from Windows Update and will not install automatically. For instructions on how to install this update for your operating system, see the KB for your OS listed below: | 2021-11-14 |
...
...
...
IT Consultant
Exchange Online Limits - Office 365 Distribution group limits What are Exchange Online Limits What are Office 365 Distribution group limi...