Skip to content

Instantly share code, notes, and snippets.

@devynspencer
Last active January 28, 2017 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devynspencer/811b546c309c48ec67dcc2bd6f8fb42f to your computer and use it in GitHub Desktop.
Save devynspencer/811b546c309c48ec67dcc2bd6f8fb42f to your computer and use it in GitHub Desktop.
workflow {
param(
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByValue)]
$ComputerName,
[pscredential] $Credential = "$env:USERDOMAIN\$env:USERNAME",
[switch] $All,
[switch] $Configuration,
[switch] $Users # sessions, user profiles, accounts, groups
[switch] $Hardware,
[switch] $Software,
[switch] $Network,
[switch] $Licensing
# TODO: finish sections and implement conditional logic in body
)
foreach -Parallel ($Computer in ($ComputerName | Online)) {
sequence {
$Session = New-PSSession -ComputerName $Computer -Credential $Credential
$Bios = Invoke-Command -Session $Session = { Get-WmiObject -Class Win32_Bios | select * }
$System = Get-WmiObject -Class Win32_ComputerSystem
$Os = Get-WmiObject -Class Win32_OperatingSystem
$Network = Get-WmiObject -Class Win32_NetworkAdapter
$NetworkConfiguration = Get-WmiObject -Class Win32_NetworkAdapterConfiguration # TODO: append this to $Network instead?
$Software = Get-WmiObject -Class Win32_Product # TODO: is this still dangerous?
Win32_ComputerSystemProduct
Win32_Battery
Win32_PhysicalMemory
Win32_DiskDrive
Win32_DesktopMonitor
Win32_CdRomDrive
Win32_PointingDevice
Win32_LogicalDisk
Win32_NetworkConnection
Win32_printer
Win32_PrinterDriver
Win32_StartupCommand
Win32_Process
$Services = Win32_Service
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment