---
title: Block 64 Administrator Credential Validation Script
description: Block 64 Credential Validation Script
---

[Skip to content](https://support.block64.com/block-64-credential-validation-script#main-content)

<https://support.block64.com/kb-tickets/new?hsLang=en> [Customer Portal](https://customerportal.block64.com/tickets-view?hsLang=en)

[![Logo - dark](https://support.block64.com/hs-fs/hubfs/Logo%20-%20dark.png?width=350&height=86&name=Logo%20-%20dark.png)](https://support.block64.com/?hsLang=en)

- [Home](https://support.block64.com/)
- [Insights Portal](https://insights.block64.com/login)
- Platform
  
  Show submenu for Platform

    - [Block 64](https://www.block64.com/)
    - [Why Block 64?](https://www.block64.com/#:~:text=What%20makes%2CBlock%2064%20different)
- Solutions
  
  Show submenu for Solutions

    - [Unified Visibility](https://www.block64.com/solutions/unified-visibility)
    - [Cost Optimization](https://www.block64.com/solutions/cost-optimization)
    - [Proactive Security](https://www.block64.com/solutions/proactive-security)
    - [Compliance](https://www.block64.com/solutions/continuous-compliance)
- Learn
  
  Show submenu for Learn

    - [Quick Start Guides](https://support.block64.com/getting-started)
    - [Integrations](https://support.block64.com/documentation#integrations)
    - [Blog](https://www.block64.com/blog)
- Support
  
  Show submenu for Support

    - [Trust Center](https://trust.block64.com/)
    - [Service Health](https://status.block64.com/)
    - [Partners](https://www.block64.com/partners)
    - [Contact Us](https://www.block64.com/contact)
- [Pricing](https://www.block64.com/pricing)
- [Get Started Free](https://www.block64.com/free-trial)

Open main navigation

Close main navigation

- [Home](https://support.block64.com/)
- [Insights Portal](https://insights.block64.com/login)
- Platform
  
  Show submenu for Platform

    - [Block 64](https://www.block64.com/)
    - [Why Block 64?](https://www.block64.com/#:~:text=What%20makes%2CBlock%2064%20different)
- Solutions
  
  Show submenu for Solutions

    - [Unified Visibility](https://www.block64.com/solutions/unified-visibility)
    - [Cost Optimization](https://www.block64.com/solutions/cost-optimization)
    - [Proactive Security](https://www.block64.com/solutions/proactive-security)
    - [Compliance](https://www.block64.com/solutions/continuous-compliance)
- Learn
  
  Show submenu for Learn

    - [Quick Start Guides](https://support.block64.com/getting-started)
    - [Integrations](https://support.block64.com/documentation#integrations)
    - [Blog](https://www.block64.com/blog)
- Support
  
  Show submenu for Support

    - [Trust Center](https://trust.block64.com/)
    - [Service Health](https://status.block64.com/)
    - [Partners](https://www.block64.com/partners)
    - [Contact Us](https://www.block64.com/contact)
- [Pricing](https://www.block64.com/pricing)
- [Get Started Free](https://www.block64.com/free-trial)
- <https://support.block64.com/kb-tickets/new>
- [Customer Portal](https://customerportal.block64.com/tickets-view)
- [Submit a Support Request](https://support.block64.com/kb-tickets/new)

[Submit a Support Request](https://support.block64.com/kb-tickets/new?hsLang=en)

 How can we assist you today?

- There are no suggestions because the search field is empty.

1. [Block 64 Support Center](https://support.block64.com/?hsLang=en)
2. [Troubleshooting](https://support.block64.com/troubleshooting?hsLang=en)
3. [Discovery: Block 64 Windows Application](https://support.block64.com/troubleshooting?hsLang=en#discovery-block-64-windows-application)

# Block 64 Administrator Credential Validation Script

### Overview

This PowerShell script helps verify whether a credential (local or domain) has the required permissions and remote access to support Block 64 Discovery tools. It performs a series of live connectivity tests against a target Windows machine using the provided username and password.

```
# ===    Block 64 Credential Validation Script    ===# This script tests remote access for C$, RPC, WMI, and validates key service statesClear-HostWrite-Host "===    Block 64 Credential Validation Script    ===" -ForegroundColor CyanWrite-Host "This script will test if the entered credential has remote access to:" -ForegroundColor WhiteWrite-Host "- Admin share (C$)" -ForegroundColor WhiteWrite-Host "- Remote Registry (RPC)" -ForegroundColor WhiteWrite-Host "- WMI service (connection test)" -ForegroundColor WhiteWrite-Host "- Essential service state check (WMI, RPC, SMB, WinRM)" -ForegroundColor WhiteWrite-Host "===================================================" -ForegroundColor Cyan# Prompt for input$target = Read-Host "Enter the target hostname or IP"$username = Read-Host "Enter the username (e.g., DOMAIN\\admin or hostname\\admin)"$password = Read-Host "Enter the password" -AsSecureString$creds = New-Object System.Management.Automation.PSCredential($username, $password)$plainPassword = [Runtime.InteropServices.Marshal]::PtrToStringAuto(    [Runtime.InteropServices.Marshal]::SecureStringToBSTR($password))$logPath = "C:\Temp"if (!(Test-Path $logPath)) { New-Item -Path $logPath -ItemType Directory -Force | Out-Null }$logFile = "$logPath\Block64_CredentialValidation_$(Get-Date -Format yyyyMMdd_HHmmss).txt"function Log {    param (        $message,        $color = "White"    )    Write-Host $message -ForegroundColor $color    Add-Content -Path $logFile -Value $message}try {    # 1. Test C$ Share    Log "`n[1/4] Testing access to C$ share..." "Cyan"    cmd.exe /c "net use \\$target\C$ /user:$username $plainPassword" | Out-Null    if ($LASTEXITCODE -eq 0) {        Log "Access to C$ share is working." "Green"        cmd.exe /c "net use \\$target\C$ /delete" | Out-Null    } else {        Log "Access to C$ share failed. Check credentials or firewall." "Red"    }    # 2. Remote Registry Access    Log "`n[2/4] Testing Remote Registry access..." "Cyan"    try {        $reg = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine', $target)        $subKey = $reg.OpenSubKey("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion")        $osName = $subKey.GetValue("ProductName")        if ($osName) {            Log "Remote Registry access is working (Detected OS: $osName)." "Green"        } else {            Log "Unable to read registry key." "Yellow"        }    } catch {        Log "Remote Registry access failed: $($_.Exception.Message)" "Red"        Log "Hint: Check 'RemoteRegistry' service and firewall (RPC)." "Yellow"    }    # 3. WMI Access Test (connection only)    Log "`n[3/4] Testing WMI access (connection only)..." "Cyan"    try {        $options = New-Object System.Management.ConnectionOptions        $options.Username = $username        $options.Password = $plainPassword        $options.EnablePrivileges = $true        $scope = New-Object System.Management.ManagementScope("\\$target\root\cimv2", $options)        $scope.Connect()        if ($scope.IsConnected) {            Log "WMI connection successful." "Green"        } else {            Log "WMI connection failed." "Red"        }    } catch {        Log "WMI connection failed: $($_.Exception.Message)" "Red"        Log "Hint: This simulates WBEMTest. WMI may be blocked by firewall, DCOM, or permissions." "Yellow"    }    # 4. Check Required Services    Log "`n[4/4] Checking required service states..." "Cyan"    $requiredServices = @("Winmgmt", "RemoteRegistry", "LanmanServer", "WinRM", "RpcSs")    $friendlyNames = @{        "LanmanServer"   = "C$ (SMB File Sharing / LanmanServer)"        "RemoteRegistry" = "RPC (Remote Registry)"        "Winmgmt"        = "WMI (Windows Management Instrumentation / Winmgmt)"        "WinRM"          = "WinRM (Windows Remote Management / WinRM)"        "RpcSs"          = "RPC Core (RPC Endpoint Mapper / RpcSs)"    }    try {        $services = Get-WmiObject -Class Win32_Service -ComputerName $target -Credential $creds |                    Where-Object { $_.Name -in $requiredServices }        foreach ($svc in $services) {            $svcLabel = $friendlyNames[$svc.Name]            $svcStatus = "${svcLabel}: $($svc.State)"            if ($svc.State -eq "Running") {                Log $svcStatus "Green"            } else {                Log $svcStatus "Yellow"            }        }    } catch {        Log "Could not retrieve service status: $($_.Exception.Message)" "Red"    }    Log "`n=== Validation Completed ===" "Cyan"    Log "Results saved to: $logFile" "Yellow"    Read-Host "`nPress Enter to exit..."} catch {    Write-Host "Unexpected error: $($_.Exception.Message)" -ForegroundColor Red    Read-Host "`nPress Enter to exit..."}
```

---

 

### How to Use It

#### 1. Save and Run it as Admin

1. Save the script file as: `Block64_CredentialValidation.ps1`
2. Right-click the file → **Run with PowerShell**

#### 2. Enter the Details

You'll be prompted for:

- The **target IP or hostname**
- A **username** with remote access (domain or local)
- Its **password**

#### 3. Review the Results

The results will be shown in the console, and also saved to:

`C:\Temp\Block64_CredentialValidation_YYYYMMDD_HHMMSS.txt`

 

Example output:

```
[1/4] Testing access to C$ share...Access to C$ share is working.[2/4] Testing Remote Registry access...Remote Registry access is working (Detected OS: Windows Server 2022).[3/4] Testing WMI access (connection only)...WMI connection successful.[4/4] Checking required service states...C$ (SMB File Sharing / LanmanServer): RunningRPC (Remote Registry): RunningRPC Core (RpcSs): RunningWMI (Winmgmt): RunningWinRM: Running
```

---

### What It Validates

The script checks whether the credential can:

| Check | Description |
| --- | --- |
| **C$ Share (SMB)** | Access to the administrative share (\\hostname\\C$), used for agentless inventory |
| **Remote Registry (RPC)** | Read registry information remotely |
| **WMI Connection** | Establish a remote connection to `root\cimv2` namespace (used for CPU, RAM, disk, OS info) |
| **Service Status** | Confirms that essential services required for scanning are **running** on the target system |

 

---

### Services Checked

| Friendly Name | Actual Service Name | Purpose |
| --- | --- | --- |
| **C$ (SMB File Sharing)** | LanmanServer | Enables Admin$ and file share access via SMB (used for credential validation and inventory) |
| **RPC (Remote Registry)** | RemoteRegistry | Allows remote registry access, used for software/hardware data collection |
| **RPC Core** | RpcSs | Core Windows service for Remote Procedure Call operations |
| **WMI** | Winmgmt | Enables WMI-based polling (CPU, RAM, Disk IOPS) |
| **WinRM** | WinRM | Leveraged by some tools as an alternative inventory method when WMI, SMB, or RPC are blocked. |

---

### If Your Credential Fails

If your credential fails one or more validation steps, we recommend the following options to proceed:

#### Option 1: Create a Clean Local Admin Account

Use our guided script to create a secure local administrator account (`block_svc`) with proper remote capabilities:

 [Creating a Local Administrator with Remote Capabilities](https://support.block64.com/creating-a-local-administrator-with-remote-capabilities?hsLang=en)

This script sets up:

- A local account with **administrator privileges**
- Remote access support for **SMB, WMI, and RPC**
- Proper firewall and policy settings (especially critical in **non-domain** or **cloud-hosted environments**)

Once created, re-run this validation script to confirm full access.

#### Option 2: Use a Domain-Limited Service Account

If your environment restricts the use of full local admin accounts, you can configure a **domain-limited service account** with only the required remote permissions.

 [Creating and Using a Limited Service Account](https://support.block64.com/creating-and-using-a-limited-service-account?hsLang=en)

This method is suitable for:

- **Domain-joined environments**
- Scenarios where **principle of least privilege** must be enforced
- Compliance-sensitive environments requiring tighter account control

Once created, re-run this validation script to confirm full access.

---

### Requirements

- PowerShell 5.1 or later
- Must be run as **Administrator**
- Remote services (WMI, RPC, SMB) must not be blocked by firewall or security tools
- For local accounts on non-domain machines: `LocalAccountTokenFilterPolicy = 1` is recommended

---

### Support Notes

- If **WMI or Remote Registry tests fail**, check firewall, DCOM, or that the services are running.
- The script does **not make any changes** to the remote system—only reads and reports.
- If issues persist, please share the saved output log when contacting support.

- [Getting Started](https://support.block64.com/getting-started?hsLang=en#main-content)

    - [Free Trial Onboarding](https://support.block64.com/getting-started?hsLang=en#free-trial-onboarding)
    - [Start Your Subscription](https://support.block64.com/getting-started?hsLang=en#start-your-subscription)
    - [Discovery Application Installation](https://support.block64.com/getting-started?hsLang=en#discovery-application-installation)
    - [Discovery Appliance Setup](https://support.block64.com/getting-started?hsLang=en#discovery-appliance-setup)
    - [Discovery Agent Deployment](https://support.block64.com/getting-started?hsLang=en#discovery-agent-deployment)
- [Insights Reports](https://support.block64.com/insights-reports?hsLang=en#main-content)

    - [IT Asset Management](https://support.block64.com/insights-reports?hsLang=en#it-asset-management)
    - [Security](https://support.block64.com/insights-reports?hsLang=en#security)
    - [Cloud & Infrastructure](https://support.block64.com/insights-reports?hsLang=en#cloud-infrastructure)
    - [Legacy Combine User Guide](https://support.block64.com/insights-reports?hsLang=en#legacy-combine-user-guide)
- [Troubleshooting](https://support.block64.com/troubleshooting?hsLang=en#main-content)

    - [Discovery: Insights Portal](https://support.block64.com/troubleshooting?hsLang=en#discovery-insights-portal)
    - [Insights Calculations](https://support.block64.com/troubleshooting?hsLang=en#insights-calculations)
    - [Discovery: Block 64 Windows Application](https://support.block64.com/troubleshooting?hsLang=en#discovery-block-64-windows-application)
    - [Discovery: BlockBox Appliance](https://support.block64.com/troubleshooting?hsLang=en#discovery-blockbox-appliance)
    - [Block 64 Discovery Agent](https://support.block64.com/troubleshooting?hsLang=en#block-64-discovery-agent)
- [Documentation](https://support.block64.com/documentation?hsLang=en#main-content)

    - [Insights: Integrations](https://support.block64.com/documentation?hsLang=en#insights-integrations)
    - [Privacy and Security](https://support.block64.com/documentation?hsLang=en#privacy-and-security)
    - [Block 64 API](https://support.block64.com/documentation?hsLang=en#block-64-api)
    - [Discovery: General Knowledge](https://support.block64.com/documentation?hsLang=en#discovery-general-knowledge)
- [FAQs](https://support.block64.com/faqs?hsLang=en#main-content)

    - [Security](https://support.block64.com/faqs?hsLang=en#security)
    - [Block 64 Discovery](https://support.block64.com/faqs?hsLang=en#block-64-discovery)
- [New Features & Updates](https://support.block64.com/new-features-updates?hsLang=en#main-content)

    - [New Features & Updates](https://support.block64.com/new-features-updates?hsLang=en#new-features-updates)
    - [Combine](https://support.block64.com/new-features-updates?hsLang=en#combine)
    - [Block 64 Discovery](https://support.block64.com/new-features-updates?hsLang=en#block-64-discovery)
    - [Remote Discovery Agent](https://support.block64.com/new-features-updates?hsLang=en#remote-discovery-agent)
    - [Combine API](https://support.block64.com/new-features-updates?hsLang=en#combine-api)
    - [BlockBox Virtual Appliance](https://support.block64.com/new-features-updates?hsLang=en#blockbox-virtual-appliance)

[![Logomark - dark](https://support.block64.com/hs-fs/hubfs/Logomark%20-%20dark.png?width=60&height=96&name=Logomark%20-%20dark.png "Logomark - dark")](http://block64.com)

300 Geary Ave, Toronto, ON M6H 2C5, Canada  
+1 800-875-5260  
[www.block64.com](https://www.block64.com/)

<https://www.linkedin.com/company/block-64/> <https://www.reddit.com/r/Block64/> <https://www.youtube.com/@block64corp> <https://www.block64.com/contact>