logo
down
shadow

How to quickly check if WMI information can be pulled from a remote computer


How to quickly check if WMI information can be pulled from a remote computer

By : Todd Gibbs
Date : November 16 2020, 06:23 AM
it should still fix some issue I know this is way after the fact, but I found a solution. I was looking for an if test to try and test the connection, but when it would fail, it would take a long time to fail. When a connection was made it would go through right away.
code :
$timeoutSeconds = 1 # set your timeout value here
$j = Start-Job -ScriptBlock {
    # your commands here, e.g.
    Test-Connection -ComputerName $args[0] -Count 1
} -ArgumentList $computer
#"job id = " + $j.id # report the job id as a diagnostic only
Wait-Job $j -Timeout $timeoutSeconds | out-null
if ($j.State -eq "Completed")
{
    #connection to PC has been verified and WMI commands can go here.
    $richtextbox1.Text = "Connection can be made to $computer"
}
elseif ($j.State -eq "Running")
{
    #After the timeout ($timeoutSeconds) has passed and the test is still running, I will assume the computer cannot be connected.
    $richtextbox1.Text = "Could not Connect to $computer"
}


Share : facebook icon twitter icon
Process Information on Remote Computer

Process Information on Remote Computer


By : Steven4Hawkes
Date : March 29 2020, 07:55 AM
help you fix your problem To perform remote administration functions, usually, the right answer is to use WMI.
Win32_Process class for process information. Win32_Service class for services.
Remote computer drive information is not precise

Remote computer drive information is not precise


By : Amal Alkahlout
Date : March 29 2020, 07:55 AM
I hope this helps you . The management scope is missing some path parts, the correct one should be:
code :
ManagementScope scope = new ManagementScope("\\\\FullComputerName\\root\\cimv2");
How to copy a file to a remote computer's desktop when the remote computer could be Windows 7 or XP?

How to copy a file to a remote computer's desktop when the remote computer could be Windows 7 or XP?


By : user3239989
Date : March 29 2020, 07:55 AM
like below fixes the issue I'm trying to create a script that copies a file to the desktop of a remote user. The two computers would be on the same network in the same domain. , Just always use the XP version:
code :
xcopy [path to local file] "\\%hostname%\c$\Documents and Settings\%user%\Desktop\"
Powershell lookup RAM information on remote computer and save Partnumbers in to diffent variable

Powershell lookup RAM information on remote computer and save Partnumbers in to diffent variable


By : user3633362
Date : March 29 2020, 07:55 AM
Does that help You get multiple objects from Get-WmiObject. You need a loop if you want to do something for each of them.
Also, URL-encoding things that you put into a URL is a good idea. and maybe putting it in double-quotes won't hurt.
code :
Add-Type -AssemblyName System.Web   # for [System.Web.HttpUtility]::UrlEncode()

$ComputerName = Read-Host "Write Computer Name"

$installed_memory = Get-WmiObject Win32_PhysicalMemory -ComputerName $ComputerName | Select-Object Manufacturer,PartNumber,SerialNumber,DeviceLocator,Capacity
$installed_memory | Format-Table -AutoSize

$ToChrome = Read-Host 'Do you want to search Google for the Partnumber(s)? Y Or N'

if ($ToChrome -eq 'Y') {
    $unique_numbers = $installed_memory.Partnumber.Trim() | Sort-Object -Unique
    foreach ($number in $unique_numbers) {
        $query = [System.Web.HttpUtility]::UrlEncode('"' + $number + '"')        
        Start-Process chrome.exe "https://www.google.com/search?q=$query"
    }
}
$installed_memory.Partnumber.Trim()
How to use SharpSVN to (quickly) check if a remote folder/file exists on the server

How to use SharpSVN to (quickly) check if a remote folder/file exists on the server


By : user3852859
Date : October 14 2020, 01:11 PM
may help you . Is is possible to use GetInfo and set the SvnInfoArgs.ThrowOnError to false.
Using SharpSVN syntax:
shadow
Privacy Policy - Terms - Contact Us © ourworld-yourmove.org