Creating and Using a Limited Service Account for WMI & RPC Access
This guide outlines how to create and configure a limited service account in Active Directory for use with WMI and RPC-based remote access — commonly used by Block 64 tools like Blockbox. It includes step-by-step instructions for setting up the account, creating necessary firewall and Group Policy configurations, and applying required security permissions.
1. Create the Service Account and Security Group
-
Create a service account in Active Directory.
-
Set the password to never expire.
-
Example:
svc_blockbox_account
-
-
Create a Global Security Group (e.g.,
Blockbox Accounts
) and add the service account to it.-
This group will later be assigned permissions via GPO.
-
2. Create the Group Policy Object (GPO)
Create a new GPO to configure access to WMI, Remote Registry, and DCOM:
-
In Group Policy Management, create a new policy (e.g.,
Blockbox WMI Access
). -
Edit the GPO to include all subsequent configuration steps in this guide.
3. Create the WMI-Inbound Firewall Rule
This step enables inbound WMI traffic through the Windows Firewall.
💡 If your environment already allows WMI traffic through another GPO, this step may be skipped.
-
Navigate to:
Computer Configuration > Policies > Windows Settings > Security Settings > Windows Firewall > Inbound Rules
-
Add a new predefined rule for Windows Management Instrumentation (WMI).
- Leave the default allowance of all inbound WMI connections.
-
Select Allow the connection and complete the rule creation.
4. Allow Remote Registry Access
-
In the GPO, go to:
Computer Configuration > Policies > Windows Settings > Registry
-
Add a new key:
MACHINE\SYSTEM\CurrentControlSet\Control\SecurePipeServers\winreg
-
In the permissions tab, add the
Blockbox Accounts
group and grant Read access.
5. Allow DCOM Launch and Access
-
In the GPO, navigate to:
Computer Configuration > Policies > Windows Settings > Security Settings > Local Policies > Security Options
-
Edit the following settings:
-
DCOM: Machine Access Restrictions
-
Add the
Blockbox Accounts
group -
Allow Local Access and Remote Access
-
-
DCOM: Machine Launch Restrictions
-
Add the same group (
Blockbox Accounts
) -
Allow Local Launch, Remote Launch, Local Activation, and Remote Activation
-
-
6. Allow Read Access to WMI Namespaces Using PowerShell
WMI namespace permissions cannot be fully applied using Group Policy Objects (GPO) alone. To grant read access to the root\cimv2
namespace (used by the Block 64 Discovery Agent), you must run a PowerShell script on each endpoint to configure security settings locally.
🛠️ We recommend using a startup script for machine-level execution — though other deployment tools like Intune, SCCM, or RMM platforms can also be used.
a) Download the Script
Use the official Block 64 script available here:
Creating a Limited Service Account: PowerShell Script
This script:
-
Grants read permissions to the
root\cimv2
WMI namespace -
Applies the permission to the security group created in Step 1 (e.g.,
Blockbox Accounts
)
b) Save the Script to a Shared Folder
Store the .ps1
script in a secure and accessible shared folder, such as:
\\DomainController\Netlogon
Update folder permissions to ensure Domain Computers
can read and execute the script:
-
Right-click the folder > Properties > Security
-
Click Edit > Add
-
Add
Domain Computers
-
Grant the following permissions:
-
✅ Read & execute
-
✅ List folder contents
-
✅ Read
-
c) Deploy the Script via Group Policy (Startup Script)
To automate WMI namespace permissions, deploy the PowerShell script through a GPO as a Startup Script:
-
In the Group Policy Management Editor, navigate to:
Computer Configuration > Policies > Windows Settings > Scripts (Startup/Shutdown) -
Open the PowerShell Scripts tab and click Add
-
Browse to the script stored in your network share (e.g.,
\\DomainController\Netlogon\
) -
In the Script Parameters field, input the parameters required by the script.
If you're using the default Block 64 script, the syntax is:
root add "<DOMAIN>\<SECURITY GROUP>" Enable,MethodExecute,RemoteAccess,ReadSecurity
For example, if your domain isCOMPANY
and you previously created a security group called Blockbox Accounts, your parameter would look like:root add "COMPANY\Blockbox Accounts" Enable,MethodExecute,RemoteAccess,ReadSecurity
💡 Tip: Be sure the security group name matches exactly, and that the script is accessible to all machines affected by the GPO.
🔎 Startup scripts run with system-level permissions, ensuring the WMI namespace is correctly configured on each endpoint before any user login.
7. Add Remote Management Users Group to the Service Account
Add the Blockbox Accounts
security group to the built-in Remote Management Users group in Active Directory.
-
This ensures that all endpoints allow the group to perform WinRM calls.
8. Attach Policy to Organizational Unit
Apply the GPO to the appropriate Organizational Unit (OU):
-
In Group Policy Management, select your GPO.
-
Under Security Filtering, add the Domain Computers group.
-
Link the GPO to the target computer OU.
✅ For changes to take effect, endpoints must:
Reboot
Or run
gpupdate /force
Or wait for the next GPO refresh cycle