Before deploying Snow Windows agents via the console, the target Windows device must allow remote communication over specific ports and have required services enabled. The following PowerShell script checks:
-
Whether the required UDP and TCP ports are open (135, 137, 138, 139, 445).
-
Whether File and Printer Sharing is enabled.
-
Whether the Remote Procedure Call (RPC) service is running.
Run this script in an elevated PowerShell session to confirm prerequisites are met before attempting deployment.
<#
Description : Test prerequisites required to deploy agents via console.
.NOTES
Version: 1.0
Author: Julian Dalley
Creation Date: 2024 04 23
Purpose/Change: Check that the prerequisites for deploying snow Windows agents via the console are met.
Reference : https://docs.snowsoftware.com/snow-inventory-server/en/UUID-eecf54a4-28dc-3957-c0a5-56309d578da0.html
>>>RUN IN POWERSHELL ISE WITH ADMINISTRATOR PRIVILEDGES<<<
#>
# Function to check if a UDP port is open
function Test-UDPPort {
param (
[string]$computerName,
[int]$port
)
$udpClient = New-Object System.Net.Sockets.UdpClient
try {
$udpClient.Connect($computerName, $port)
return $true
}
catch {
return $false
}
finally {
$udpClient.Close()
}
}
# Function to check if a TCP port is open
function Test-TCPPort {
param (
[string]$computerName,
[int]$port
)
$tcpClient = New-Object System.Net.Sockets.TcpClient
try {
$tcpClient.Connect($computerName, $port)
return $true
}
catch {
return $false
}
finally {
$tcpClient.Close()
}
}
# Check UDP ports 137 and 138
$udpPorts = @(
@{Port=137;Description="UDP 137"},
@{Port=138;Description="UDP 138"}
)
foreach ($udpPort in $udpPorts) {
$isOpen = Test-UDPPort -computerName "localhost" -port $udpPort.Port
if ($isOpen) {
Write-Host -ForegroundColor Green "$($udpPort.Description) is open."
}
else {
Write-Host -ForegroundColor Red "$($udpPort.Description) is closed."
}
}
# Check TCP ports 139, 445, and 135 (RPC)
$tcpPorts = @(
@{Port=139;Description="TCP 139"},
@{Port=445;Description="TCP 445"},
@{Port=135;Description="TCP 135 (RPC)"}
)
foreach ($tcpPort in $tcpPorts) {
$isOpen = Test-TCPPort -computerName "localhost" -port $tcpPort.Port
if ($isOpen) {
Write-Host -ForegroundColor Green "$($tcpPort.Description) is open."
}
else {
Write-Host -ForegroundColor Red "$($tcpPort.Description) is closed."
}
}
# Check if file and printer sharing is enabled
$filePrinterSharing = Get-WmiObject -Class Win32_Share -Filter "Type = 0"
if ($filePrinterSharing) {
Write-Host -ForegroundColor Green "File and printer sharing is enabled."
}
else {
Write-Host -ForegroundColor Red "File and printer sharing is disabled."
}
# Check if RPC service is running
$rpcService = Get-Service -Name "RpcSs"
if ($rpcService.Status -eq "Running") {
Write-Host -ForegroundColor Green "RPC service is running."
}
else {
Write-Host -ForegroundColor Red "RPC service is not running."
}Related Articles
Running an Automation Script via the InstallShield SAB on a Windows Server Core Docker Image 23Number of Views FlexNet Inventory Agent tracker (ndtrack) process may trigger a security software warning due to PowerShell script executi… 86Number of Views Export Windows Event logs for powershell using a PowerShell script 7Number of Views Snow Inventory Agent: How to verify the authenticity of Snow Powershell scripts 18Number of Views PowerShell script to monitor the log files generated and deleted in a folder 12Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago