| .. | ||
| Data | ||
| Private | ||
| Public | ||
| Get-PC.Format.ps1xml | ||
| Get-PC.psd1 | ||
| Get-PC.psm1 | ||
| HeaderExample | ||
| patchnotes.txt | ||
| README.md | ||
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
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 Workstation’s File System
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
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
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.
PS C:\> get-pc GSHZZ12345 -RemoteDesktopApp
Using -RemoteDesktopApp flag will launch RDP into the supplied hostname
Logoff Remote User
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
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
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 user’s 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
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:
PS C:\> get-pc GSHZZ12345 -b -v
Rebuild User’s Windows Profile
PS C:\> get-pc GSHZZ12345 -WinProfileRebuild
Using the -WinProfileRebuild flag will rename the user’s 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
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
PS C:\> get-pc GSHZZ12345 -GPUpdate
Using the -GPUpdate flag will attempt to update the group policy on the workstation.
Get Historical/SCCM Data
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 don’t 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 it’s “historical” the model of a computer doesn’t change.)
Get a Table/Gridview of Get-PC Output
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 computer’s applications in the GUI table
Get SHS User Info
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:
PS C:\> get-pc scarlton -SHSUser
PS C:\> get-pc 40504 -shsuser
Get SHS Printer Data
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.
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
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
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
PS C:\> get-pc GSHZZ12345 -cmdb
Using the -cmdb flag will launch the default web browser the cmdb page for the given hostname.
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
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
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