Get-PC/README.md
Zachary Gorman 4a01da0e5d Init commit
2024-06-11 11:27:55 -07:00

178 lines
7.4 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Get-PC
Get-PC is a custom Powershell module that contains many useful features for querying details about workstations and also performing many useful/common functions on those computers remotely.
## Installing
Get-PC is available through Software Center. Simply locate it there and choose install.
## Usage
**Get System Information**
```Powershell
PS C:\> get-pc hostname
```
Using *get-pc hostname* will query a workstation (or multiple workstations, comma separated) for information such as model, SSO client, currently logged in user, OS version, RAM, installed printers, etc…
**Access the Workstations File System**
```PowerShell
PS C:\> get-pc GSHZZ12345 -FileSystem
```
Using the -f (or -FileSystem) flag opens Windows File Explorer to the \\hostname\C$ path for you.
**Get a List of Installed Applications**
```PowerShell
PS C:\> get-pc GSHZZ12345 -Apps
```
Using the -a (or -Apps) flag will return a list of installed applications on the workstation.
**Remote onto a Workstation**
```PowerShell
PS C:\> get-pc GSHZZ12345 -ViewerRemote
```
Using the -V (or -ViewerRemote) flag will launch the SCCM ConfigMgr Remote Viewer and connect it to the supplied hostname.
 
Note: This requires that the SCCM Thick Client be installed on the workstation you are running Get-PC on. It can be installed via Software Center.
```PowerShell
PS C:\> get-pc GSHZZ12345 -RemoteDesktopApp
```
Using -RemoteDesktopApp flag will launch RDP into the supplied hostname
**Logoff Remote User**
```PowerShell
PS C:\> get-pc GSHZZ12345 -LogOffUser
```
Using the -L (or -LogOffUser) flag will attempt to log the currently signed on user off the workstation.
**Copy User Profiles**
```PowerShell
PS C:\> get-pc GSHZZ12345 -UserProfileBackup
```
Using -UserProfileBackup flag will allow you to copy a user profile to the Desktop Solutions shared drive. This automatically copies over the Desktop, Documents, Downloads, Favorites, Pictures, Videos, Chrome Bookmarks, and AppData/Roaming/Microsoft folder to a network location based on the chosen site
Any username can be entered that exists on the workstation, but the three most recent are displayed for convenience.
**Restore User Profiles**
```PowerShell
PS C:\> get-pc GSHZZ12345 -UserProfileBackup
```
Using -UserProfileBackup flag will allow you to also restore a user profile from the Desktop Solutions shared drive. Simply select R when prompted, then using the number next to the available back-up, select the one you want to restore. This will automatically copy over the Desktop, Documents, Downloads, Favorites, Pictures, Videos, and AppData/Roaming/Microsoft folder back to the users profile on the machine. (Their profile must exist on the machine or the copy will fail, so the user will have to login first before you can restore their files over successfully.)
Any username can be entered that exists on the workstation, but the three most recent are displayed for convenience.
**Bypass Security Prompt When Remoting On**
```PowerShell 
PS C:\> get-pc GSHZZ12345 -B
```
Using the -b (or -Bypass) flag will bypass the prompt the remote user sees to approve a user remoting onto the workstation. This is particularly useful for remoting onto Kiosked workstations.
 
TIP: -B can be used in addition to -V to bypass and remote on in one command:
```PowerShell
PS C:\> get-pc GSHZZ12345 -b -v
```
**Rebuild Users Windows Profile**
```PowerShell 
PS C:\> get-pc GSHZZ12345 -WinProfileRebuild
```
Using the -WinProfileRebuild flag will rename the users Windows profile folder with a timestamp and remove the appropriate registry key. Once the user signs back in, the files can be copied over to their new Windows profile from the .backup folder that was created. This command can also be use to automatically restore the files using the R option when prompted.
**Rename a PC**
```PowerShell
PS C:\> get-pc GSHZZ12345 -PCRename
```
Using the -PCRename flag will allow you to remotely rename a workstation. You will be prompted to enter your credentials. Upon successfully renaming the PC, it will then force a restart of the workstation so the new hostname takes effect.
**Update Group Policy**
```PowerShell
PS C:\> get-pc GSHZZ12345 -GPUpdate
```
Using the -GPUpdate flag will attempt to update the group policy on the workstation.
**Get Historical/SCCM Data**
```PowerShell
PS C:\> get-pc GSHZZ12345 -sccm
```
Using the -SCCM flag will query SCCM directly. Get-PC falls back to SCCM when a workstation is offline automatically, but this is useful when you dont necessarily need the current information about the machine particularly when querying multiple computers since querying SCCM is faster than reaching out to each machine for live data.
(For example, you know SCCM has the correct model information all the time, so even though its “historical” the model of a computer doesnt change.)
**Get a Table/Gridview of Get-PC Output**
```PowerShell
PS C:\> get-pc GSHZZ12345 -Tableview
```
Using the -T (or -Tableview) flag will have Get-PC open up a nice GUI window with all of the data it was able to query. This is useful for sorting large lists of workstations or copying into an Excel file to work with. You can also use -t in addition to -a to get a table view of installed applications on a machine.
Examples:
*get-pc GSHZZ12345 -t -a* will output the computers applications in the GUI table
**Get SHS User Info**
```PowerShell
PS C:\> get-pc GSHZZ12345 -shsuser
```
Using the -shsuser flag will have Get-PC return user information pulled from Active Directory. Either username or employeeID can be used for the query.
Examples:
```PowerShell
PS C:\> get-pc scarlton -SHSUser
PS C:\> get-pc 40504 -shsuser
```
**Get SHS Printer Data**
```PowerShell
PS C:\> get-pc PGSHZZ01 -shsprinter
```
Using the -shsprinter flag will pull SMTP data from the printer. It will fall back on cmdb data if the printer is offline.
```PowerShell
PS C:\> get-pc PGSHZZ01 -shsprinterweb
```
Using the -shsprinterweb flag will pull the same info as -shsprinter but will also launch the default web browser to the web interface and orion
**Get Connected Device Info**
```PowerShell
PS C:\> get-pc GSHZZ12345 -devices
```
Using the -devices flag will pull the currently connected USB devices and monitors. There is currently a look up table for common SHS supplied peripherals to help match on items supplied by IS.
**Get the Event Log**
```Powershell
PS C:\> get-pc GSHZZ12345 -EventLog
```
Using the -EventLog flag will pull the errors from event log for the given hostname. It will ask you how many days back you would like to see then launch in an out-gridview.
**Accessing CMDB**
```Powershell
PS C:\> get-pc GSHZZ12345 -cmdb
```
Using the -cmdb flag will launch the default web browser the cmdb page for the given hostname.
```Powershell
PS C:\> get-pc GSHZZ12345 -cmdblocation
```
Using the -cmdblocation flag will allow you to easily update the cmdb location of the given hostname.
**Launching Orion**
```Powershell
PS C:\> get-pc GSHZZ12345 -orion
```
Using the -orion flag will query the given hostname for its MAC address then launch the default web browser to the orion page for that MAC address.
**Updating Get-PC**
```PowerShell
PS C:\> get-pc -update
```
When there is an updated version of get-pc available the user will be notified on the first time using get-pc in that powershell window.
Using the -update flag will automatically download the most up-to-date version of get-pc to the user's machine.
## Authors
Chuck Beddow
Drew York