cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Powershell command for running a manual inventory on remote system

Can any Windows experts provide any tips?

I need to know the exact Powershell command to use for running a manual inventory on a remote system.

I've tried several commands that are ending up with the same error:"Connecting to remote server X failed with the following error message : WinRM cannot complete the operation.
Verify that the specified computer name is valid, that the computer is accessible over the network, and that a firewall exception for the WinRM service is enabled and allows access from this computer."

I think this is a security issue in my enterprise, but I need to know the exact command to take to my security team to beg for permission.

I can successfully run these commands on a remote system:

Get-Service ndinit -ComputerName X | stop/start-service
Get-Service mgssecsvc -ComputerName X | stop/start-service

Get-ChildItem \\systemX\c$\Windows\Temp\managesoft -Recurse

Get-Content -tail 10 \\systemX\c$\Windows\Temp\ManageSoft\tracker.log

As example I've tried variations on the below command, always ending in the above error. I just don't know if it's correct or not.

Invoke-Command -ComputerName systemX -ScriptBlock { & 'C:\Program Files (x86)\ManageSoft\Tracker\ndtrack.exe' -t machine}

Any help is appreciated. Thank you

(1) Solution
ChrisG
By Community Manager Community Manager
Community Manager

The command you're using here is a reasonable way to attempt this:

Invoke-Command -ComputerName systemX -ScriptBlock { & 'C:\Program Files (x86)\ManageSoft\Tracker\ndtrack.exe' -t machine}

However the PowerShell Invoke-Command cmdlet does depend on the Windows Remote Management service running on the target computer:

image.png

Your IT/security folk may not be that keen to allow remote connections like this, in which case your next port of call may be to have a discussion with them to get their input on whether there are any options for remotely executing commands on computers in your environment.

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)

View solution in original post

(1) Reply
ChrisG
By Community Manager Community Manager
Community Manager

The command you're using here is a reasonable way to attempt this:

Invoke-Command -ComputerName systemX -ScriptBlock { & 'C:\Program Files (x86)\ManageSoft\Tracker\ndtrack.exe' -t machine}

However the PowerShell Invoke-Command cmdlet does depend on the Windows Remote Management service running on the target computer:

image.png

Your IT/security folk may not be that keen to allow remote connections like this, in which case your next port of call may be to have a discussion with them to get their input on whether there are any options for remotely executing commands on computers in your environment.

(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)