Repository navigation
Expand file tree
/
Copy pathGet-ComputerInfo.ps1
More file actions
52 lines (38 loc) · 1.91 KB
/
Copy pathGet-ComputerInfo.ps1
File metadata and controls
52 lines (38 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<#
.SYNOPSIS
Get Computer info
.DESCRIPTION
This tool returns a variety of information about an AD user and prompts for the user name
.EXAMPLE
No examples at this time.
.INPUTS
$cred - This prompts the user for credentials
Note - Be sure to use the credentials in the right domain
for which the target system resides. (e.g. bbcgrp\username or bbc\username)
$comp - This prompts the suer for the computer name or target that we are searching for
Note - This will accept a computer name or an IP address
.OUTPUTS
- OS version of the remote computer to the screen
- Current Logged on user of the remote computer
- All hotfix installs on the remote computer
.NOTES
Created by John Skinner
When prompted for your credentials, be sure to loggin to the domain where the target computer exists
Or this script will not be able to find the target computer.
.LINK
#>
# Get and store credentials and Prompte for Computer name or IP Address
# When prompted for your credentials, be sure to loggin to the domain where the target computer exists
$cred = Get-Credential
$comp = Read-Host -Prompt 'Enter the Computer Name or IP address'
Write-host "Getting Basic Computer Info..." -ForegroundColor cyan
#Get OS version on remote system
Get-WmiObject Win32_OperatingSystem -ComputerName $comp -Credential $cred |
Select PSComputerName, Caption, OSArchitecture, Version, BuildNumber | FL
Write-host "Getting Current Logged in User..." -ForegroundColor cyan
# Get Current logged on user
Get-WmiObject -ComputerName $comp -Credential $cred -Class Win32_ComputerSystem | Select-Object UserName
Write-host "Getting all installed Hotfix's..." -ForegroundColor cyan
#Get hotfix installed on remote computer
Get-HotFix -ComputerName $comp -Credential $cred
Write-host "Script Complete!" -ForegroundColor green