How to access another server info from the present server by using power shell command

The below query will provide you the other server information from this server by using power shell command. This is like getting remote server information from this server.

Invoke-Command `
-ComputerName ProvideServerNamehere `
-ScriptBlock {
Get-EventLog -LogName Application|
Where-Object {$_.Message -like "*failed to open*"}|
Where-Object {$_.TimeWritten -like "*08/29/2018*"}|
Format-List
} `
-Credential Provide User Name Here without single quotes

Comments

Popular posts from this blog

Always On FailOver Events

SSAS Cube or Database backup with Powershell command "Backup-AsDatabase"

Rule "Not Clustered o the Cluster Service is up and online. " FAILED, The machine is clustered but the cluster is not online.