Added Wake flag and added LastLogon to SHSUser
This commit is contained in:
parent
e41c8897dd
commit
be0294c5ef
|
|
@ -51,7 +51,7 @@ Copyright = '(c) 2019 Chuck Beddow. All rights reserved.'
|
|||
# ProcessorArchitecture = ''
|
||||
|
||||
# Modules that must be imported into the global environment prior to importing this module
|
||||
# RequiredModules = @()
|
||||
RequiredModules = @('ConfigurationManager')
|
||||
|
||||
# Assemblies that must be loaded prior to importing this module
|
||||
# RequiredAssemblies = @()
|
||||
|
|
|
|||
7
Private/Invoke-Wake.ps1
Normal file
7
Private/Invoke-Wake.ps1
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
function Invoke-Wake($Computer) {
|
||||
Write-Host "Attemping to wake up $Computer, check in a few minutes"
|
||||
Push-Location
|
||||
Set-Location "$(Get-PSDrive -PSProvider CMSite)`:"
|
||||
Invoke-CMClientAction -DeviceName $Computer -ActionType ClientNotificationWakeUpClientNow
|
||||
Pop-Location
|
||||
}
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
$printerHost = "$printerName$domain"
|
||||
#Write-Host $printerHost
|
||||
$testHost = Resolve-DnsName $printerHost
|
||||
if($testHost -ne $null) {
|
||||
if($null -ne $testHost) {
|
||||
$hit = $true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
Phone=$null
|
||||
Email=$null
|
||||
Computers=$null
|
||||
LastLogon=$null
|
||||
}
|
||||
$obj = New-Object -TypeName PSObject -Property $props
|
||||
|
||||
|
|
@ -57,7 +58,7 @@
|
|||
Phone=$UserInfo.telephoneNumber
|
||||
Email=$UserInfo.EmailAddress
|
||||
Computers=$computerList
|
||||
|
||||
LastLogon=$UserInfo.LastLogonDate
|
||||
}
|
||||
|
||||
$obj = New-Object -TypeName PSObject -Property $props
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ Function Get-PC {
|
|||
-RemoteDesktopApp | remote into computer using RDP
|
||||
-RequestLauncher | starts request launcher
|
||||
-ResetRepository | remotely resets repository
|
||||
-Resources | more details about system resources
|
||||
-SCCM | queries sccm for the computer information
|
||||
-SHSPrinter | pulls data about a printer using snmp
|
||||
-SHSPrinterweb | pulls data about a printer and opens web interface and orion
|
||||
|
|
@ -62,6 +63,7 @@ Function Get-PC {
|
|||
-Usb | shows installed usb devices
|
||||
-UserProfileBackup | backups and restores user profiles
|
||||
-ViewerRemote | remote into the computer using RemoteViewer
|
||||
-Wake | attempts to wake on LAN
|
||||
-WinProfileRebuild | rebuilds user profiles
|
||||
|
||||
For more detailed help please see the documentation on AppDoc
|
||||
|
|
@ -110,6 +112,7 @@ Function Get-PC {
|
|||
[switch]$Usb,
|
||||
[Switch]$UserProfileBackup,
|
||||
[Switch]$ViewerRemote,
|
||||
[Switch]$Wake,
|
||||
[Switch]$WinProfileRebuild
|
||||
)
|
||||
|
||||
|
|
@ -301,6 +304,11 @@ Function Get-PC {
|
|||
break
|
||||
}
|
||||
|
||||
if ($Wake) {
|
||||
Invoke-Wake $comp
|
||||
continue
|
||||
}
|
||||
|
||||
#PING HERE - All commands after here either require the computer to be online or need to know
|
||||
#------------------------------------------------------------------------------------------------------------------------------------------------------------------#
|
||||
$Connection = Test-Connection -ComputerName $comp -Count 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue