🛡️ How to Block VBS Scripts Using Group Policy (Windows Server 2025)

🛡️ How to Block VBS Scripts Using Group Policy (Windows Server 2025)

VBScript (.vbs) files can be a security risk if misused. In this guide, I’ll walk you through how to block VBS scripts across domain users using Group Policy in Windows Server 2025.


🖥️ Step 1: Test VBScript Execution (Client Computer)

  • Go to the client computer
  • Create a VBScript file on the desktop with the .vbs extension
  • Run the .vbs file

✅ It will run successfully (before applying the policy)


🔧 Step 2: Configure Group Policy (Server Side)

  • Open Server Manager
  • Navigate to: Tools > Group Policy Management
  • Select your domain (e.g., xitiztechservices.local)
  • Go to your OU (e.g., Domain_Users)
  • Right-click → Create a GPO in this domain, and Link it here...
  • Name it: Block VBS Scripts Running


✏️ Step 3: Edit the GPO

  • Right-click the GPO → Edit
  • Navigate to: User Configuration > Policies > Windows Settings > Security Settings > Software Restriction Policies


🔐 Step 4: Create Software Restriction Policy

  • Right-click Software Restriction PoliciesNew Software Restriction Policies
  • This creates new Folder:

Security Levels 
Additional Rules        

➕ Step 5: Create Path Rule

  • Go to Additional Rules
  • Right-click → New Path Rule
  • Configure:

Path: *.VBS
Security Level: Disallowed        

  • Click Apply → OK


🔄 Step 6: Apply Policy Updates

Run the following on both server and client (as Administrator):

gpupdate /force        

  • Restart the client computer


🧪 Step 7: Verify

  • Run the .vbs file again on the client

❌ You’ll see:

Execution of the Windows Script Host failed. This program is blocked by group policy. For more information, contact your system administrator.

✅ Final Result

VBScript execution is now blocked for domain users, improving your organization’s security posture.


💡 Tip: This method can be extended to block other script types by modifying the path rule.


#WindowsServer #CyberSecurity #GroupPolicy #ITAdmin #SysAdmin #WindowsSecurity #TechTips #ITInfrastructure #LinkedInLearning

To view or add a comment, sign in

More articles by Xitiz Basnet

Explore content categories