A simple PowerShell code snippet that retrieves information’s on remote computers.
This code will work fine if WinRM or Winwdows Remote Management is configured properly on the remote computer.
And the user account has the right credentials to logon remotely on the remote computer.
If run on a domain controller with the proper privileges and remote management is configured on client computer, the PowerShell code below will work fine.
============================
#set the computer name
$computer = "FileServer"
#cmdlet to logon the computer specified on the parameter
Enter-PSSession -ComputerName $computer
# get all drives information, including free hard drive space
Get-WmiObject Win32_LogicalDisk | Where-Object {$_.DriveType -eq 3}
#get bios information on the remote computer
Get-WmiObject Win32_bios
#get available printers installed on the remote computer
Get-WmiObject Win32_printer
#get mapped drives set on the remote computer
Get-WmiObject Win32_networkconnection
============================
Cheers!!!
Comments
Post a Comment